aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/uaccess.h
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2006-09-27 04:21:02 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 04:21:02 -0400
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 { \
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({ \