microblaze: Simple __copy_tofrom_user for noMMU
[linux-2.6-block.git] / arch / microblaze / include / asm / uaccess.h
index 65adad61e7e90b4bbf05cc161caaf4a6a6757290..371bd6e56d9a20e60624147a050366f9fd06d2ea 100644 (file)
@@ -189,7 +189,7 @@ extern long strnlen_user(const char *src, long count);
 
 #define __put_user(x, ptr)                                             \
 ({                                                                     \
-       __typeof__(*(ptr)) __gu_val = x;                                \
+       __typeof__(*(ptr)) volatile __gu_val = (x);                     \
        long __gu_err = 0;                                              \
        switch (sizeof(__gu_val)) {                                     \
        case 1:                                                         \
@@ -272,8 +272,9 @@ static inline int clear_user(char *to, int size)
        return size;
 }
 
-extern unsigned long __copy_tofrom_user(void __user *to,
-               const void __user *from, unsigned long size);
+#define __copy_from_user(to, from, n)  copy_from_user((to), (from), (n))
+#define __copy_from_user_inatomic(to, from, n) \
+               copy_from_user((to), (from), (n))
 
 #define copy_to_user(to, from, n)                                      \
        (access_ok(VERIFY_WRITE, (to), (n)) ?                           \
@@ -290,10 +291,6 @@ extern unsigned long __copy_tofrom_user(void __user *to,
                        (void __user *)(from), (n))                     \
                : -EFAULT)
 
-#define __copy_from_user(to, from, n)  copy_from_user((to), (from), (n))
-#define __copy_from_user_inatomic(to, from, n) \
-               copy_from_user((to), (from), (n))
-
 extern int __strncpy_user(char *to, const char __user *from, int len);
 extern int __strnlen_user(const char __user *sstr, int len);
 
@@ -305,6 +302,9 @@ extern int __strnlen_user(const char __user *sstr, int len);
 
 #endif /* CONFIG_MMU */
 
+extern unsigned long __copy_tofrom_user(void __user *to,
+               const void __user *from, unsigned long size);
+
 /*
  * The exception table consists of pairs of addresses: the first is the
  * address of an instruction that is allowed to fault, and the second is