summaryrefslogtreecommitdiff
path: root/include/asm-sh/uaccess.h
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2006-09-27 17:21:02 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 17:21:02 +0900
commite96636ccfa373a00a0ee0558e1971baa7856d8b5 (patch)
treec4f98b1c92f30f17c8c0d36419977789fe537aab /include/asm-sh/uaccess.h
parente7f93a355c7e32c26eab8910cf53b7506bb046c5 (diff)
sh: Various nommu fixes.
This fixes up some of the various outstanding nommu bugs on SH. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/uaccess.h')
-rw-r--r--include/asm-sh/uaccess.h13
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 { \
__gu_err; \
})
+#ifdef CONFIG_MMU
#define __get_user_check(x,ptr,size) \
({ \
long __gu_err, __gu_val; \
@@ -257,6 +258,18 @@ __asm__("stc r7_bank, %1\n\t" \
: "r" (addr) \
: "t"); \
})
+#else /* CONFIG_MMU */
+#define __get_user_check(x,ptr,size) \
+({ \
+ long __gu_err, __gu_val; \
+ if (__access_ok((unsigned long)(ptr), (size))) { \
+ __get_user_size(__gu_val, (ptr), (size), __gu_err); \
+ (x) = (__typeof__(*(ptr)))__gu_val; \
+ } else \
+ __gu_err = -EFAULT; \
+ __gu_err; \
+})
+#endif
#define __get_user_asm(x, addr, err, insn) \
({ \