aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mn10300/include/asm/uaccess.h73
-rw-r--r--arch/mn10300/unit-asb2303/include/unit/clock.h6
-rw-r--r--arch/mn10300/unit-asb2305/include/unit/clock.h6
3 files changed, 45 insertions, 40 deletions
diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h
index 8a3a4dd55763..167e10ff06d9 100644
--- a/arch/mn10300/include/asm/uaccess.h
+++ b/arch/mn10300/include/asm/uaccess.h
@@ -129,42 +129,47 @@ extern int fixup_exception(struct pt_regs *regs);
129struct __large_struct { unsigned long buf[100]; }; 129struct __large_struct { unsigned long buf[100]; };
130#define __m(x) (*(struct __large_struct *)(x)) 130#define __m(x) (*(struct __large_struct *)(x))
131 131
132#define __get_user_nocheck(x, ptr, size) \ 132#define __get_user_nocheck(x, ptr, size) \
133({ \ 133({ \
134 __typeof(*(ptr)) __gu_val; \ 134 unsigned long __gu_addr; \
135 unsigned long __gu_addr; \ 135 int __gu_err; \
136 int __gu_err; \ 136 __gu_addr = (unsigned long) (ptr); \
137 __gu_addr = (unsigned long) (ptr); \ 137 switch (size) { \
138 switch (size) { \ 138 case 1: { \
139 case 1: __get_user_asm("bu"); break; \ 139 unsigned char __gu_val; \
140 case 2: __get_user_asm("hu"); break; \ 140 __get_user_asm("bu"); \
141 case 4: __get_user_asm("" ); break; \ 141 (x) = *(__force __typeof__(*(ptr))*) &__gu_val; \
142 default: __get_user_unknown(); break; \ 142 break; \
143 } \ 143 } \
144 x = (__typeof__(*(ptr))) __gu_val; \ 144 case 2: { \
145 __gu_err; \ 145 unsigned short __gu_val; \
146 __get_user_asm("hu"); \
147 (x) = *(__force __typeof__(*(ptr))*) &__gu_val; \
148 break; \
149 } \
150 case 4: { \
151 unsigned int __gu_val; \
152 __get_user_asm(""); \
153 (x) = *(__force __typeof__(*(ptr))*) &__gu_val; \
154 break; \
155 } \
156 default: \
157 __get_user_unknown(); \
158 break; \
159 } \
160 __gu_err; \
146}) 161})
147 162
148#define __get_user_check(x, ptr, size) \ 163#define __get_user_check(x, ptr, size) \
149({ \ 164({ \
150 __typeof__(*(ptr)) __gu_val; \ 165 int _e; \
151 unsigned long __gu_addr; \ 166 if (likely(__access_ok((unsigned long) (ptr), (size)))) \
152 int __gu_err; \ 167 _e = __get_user_nocheck((x), (ptr), (size)); \
153 __gu_addr = (unsigned long) (ptr); \ 168 else { \
154 if (likely(__access_ok(__gu_addr,size))) { \ 169 _e = -EFAULT; \
155 switch (size) { \ 170 (x) = (__typeof__(x))0; \
156 case 1: __get_user_asm("bu"); break; \ 171 } \
157 case 2: __get_user_asm("hu"); break; \ 172 _e; \
158 case 4: __get_user_asm("" ); break; \
159 default: __get_user_unknown(); break; \
160 } \
161 } \
162 else { \
163 __gu_err = -EFAULT; \
164 __gu_val = 0; \
165 } \
166 x = (__typeof__(*(ptr))) __gu_val; \
167 __gu_err; \
168}) 173})
169 174
170#define __get_user_asm(INSN) \ 175#define __get_user_asm(INSN) \
diff --git a/arch/mn10300/unit-asb2303/include/unit/clock.h b/arch/mn10300/unit-asb2303/include/unit/clock.h
index 8b450e920af1..2a0bf79ab968 100644
--- a/arch/mn10300/unit-asb2303/include/unit/clock.h
+++ b/arch/mn10300/unit-asb2303/include/unit/clock.h
@@ -20,9 +20,9 @@ extern unsigned long mn10300_ioclk; /* IOCLK (crystal speed) in HZ */
20extern unsigned long mn10300_iobclk; 20extern unsigned long mn10300_iobclk;
21extern unsigned long mn10300_tsc_per_HZ; 21extern unsigned long mn10300_tsc_per_HZ;
22 22
23#define MN10300_IOCLK ((unsigned long)mn10300_ioclk) 23#define MN10300_IOCLK mn10300_ioclk
24/* If this processors has a another clock, uncomment the below. */ 24/* If this processors has a another clock, uncomment the below. */
25/* #define MN10300_IOBCLK ((unsigned long)mn10300_iobclk) */ 25/* #define MN10300_IOBCLK mn10300_iobclk */
26 26
27#else /* !CONFIG_MN10300_RTC */ 27#else /* !CONFIG_MN10300_RTC */
28 28
@@ -35,7 +35,7 @@ extern unsigned long mn10300_tsc_per_HZ;
35#define MN10300_TSCCLK MN10300_IOCLK 35#define MN10300_TSCCLK MN10300_IOCLK
36 36
37#ifdef CONFIG_MN10300_RTC 37#ifdef CONFIG_MN10300_RTC
38#define MN10300_TSC_PER_HZ ((unsigned long)mn10300_tsc_per_HZ) 38#define MN10300_TSC_PER_HZ mn10300_tsc_per_HZ
39#else /* !CONFIG_MN10300_RTC */ 39#else /* !CONFIG_MN10300_RTC */
40#define MN10300_TSC_PER_HZ (MN10300_TSCCLK/HZ) 40#define MN10300_TSC_PER_HZ (MN10300_TSCCLK/HZ)
41#endif /* !CONFIG_MN10300_RTC */ 41#endif /* !CONFIG_MN10300_RTC */
diff --git a/arch/mn10300/unit-asb2305/include/unit/clock.h b/arch/mn10300/unit-asb2305/include/unit/clock.h
index 7d514841ffda..67be3f2eb18e 100644
--- a/arch/mn10300/unit-asb2305/include/unit/clock.h
+++ b/arch/mn10300/unit-asb2305/include/unit/clock.h
@@ -20,9 +20,9 @@ extern unsigned long mn10300_ioclk; /* IOCLK (crystal speed) in HZ */
20extern unsigned long mn10300_iobclk; 20extern unsigned long mn10300_iobclk;
21extern unsigned long mn10300_tsc_per_HZ; 21extern unsigned long mn10300_tsc_per_HZ;
22 22
23#define MN10300_IOCLK ((unsigned long)mn10300_ioclk) 23#define MN10300_IOCLK mn10300_ioclk
24/* If this processors has a another clock, uncomment the below. */ 24/* If this processors has a another clock, uncomment the below. */
25/* #define MN10300_IOBCLK ((unsigned long)mn10300_iobclk) */ 25/* #define MN10300_IOBCLK mn10300_iobclk */
26 26
27#else /* !CONFIG_MN10300_RTC */ 27#else /* !CONFIG_MN10300_RTC */
28 28
@@ -35,7 +35,7 @@ extern unsigned long mn10300_tsc_per_HZ;
35#define MN10300_TSCCLK MN10300_IOCLK 35#define MN10300_TSCCLK MN10300_IOCLK
36 36
37#ifdef CONFIG_MN10300_RTC 37#ifdef CONFIG_MN10300_RTC
38#define MN10300_TSC_PER_HZ ((unsigned long)mn10300_tsc_per_HZ) 38#define MN10300_TSC_PER_HZ mn10300_tsc_per_HZ
39#else /* !CONFIG_MN10300_RTC */ 39#else /* !CONFIG_MN10300_RTC */
40#define MN10300_TSC_PER_HZ (MN10300_TSCCLK/HZ) 40#define MN10300_TSC_PER_HZ (MN10300_TSCCLK/HZ)
41#endif /* !CONFIG_MN10300_RTC */ 41#endif /* !CONFIG_MN10300_RTC */