diff options
Diffstat (limited to 'include/asm-sh/uaccess.h')
-rw-r--r-- | include/asm-sh/uaccess.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h index 6c0014dd2ef7..5c3b00c2f107 100644 --- a/include/asm-sh/uaccess.h +++ b/include/asm-sh/uaccess.h | |||
@@ -168,6 +168,7 @@ do { \ | |||
168 | __gu_err; \ | 168 | __gu_err; \ |
169 | }) | 169 | }) |
170 | 170 | ||
171 | #ifdef CONFIG_MMU | ||
171 | #define __get_user_check(x,ptr,size) \ | 172 | #define __get_user_check(x,ptr,size) \ |
172 | ({ \ | 173 | ({ \ |
173 | long __gu_err, __gu_val; \ | 174 | long __gu_err, __gu_val; \ |
@@ -257,6 +258,18 @@ __asm__("stc r7_bank, %1\n\t" \ | |||
257 | : "r" (addr) \ | 258 | : "r" (addr) \ |
258 | : "t"); \ | 259 | : "t"); \ |
259 | }) | 260 | }) |
261 | #else /* CONFIG_MMU */ | ||
262 | #define __get_user_check(x,ptr,size) \ | ||
263 | ({ \ | ||
264 | long __gu_err, __gu_val; \ | ||
265 | if (__access_ok((unsigned long)(ptr), (size))) { \ | ||
266 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | ||
267 | (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
268 | } else \ | ||
269 | __gu_err = -EFAULT; \ | ||
270 | __gu_err; \ | ||
271 | }) | ||
272 | #endif | ||
260 | 273 | ||
261 | #define __get_user_asm(x, addr, err, insn) \ | 274 | #define __get_user_asm(x, addr, err, insn) \ |
262 | ({ \ | 275 | ({ \ |