ARM: Convert VFP/Crunch/XscaleCP thread_release() to exit_thread()
[safe/jmp/linux-2.6] / arch / arm / include / asm / uaccess.h
index d0f51ff..1d6bd40 100644 (file)
 /*
  * User space memory access functions
  */
-#include <linux/sched.h>
+#include <linux/string.h>
+#include <linux/thread_info.h>
 #include <asm/errno.h>
 #include <asm/memory.h>
 #include <asm/domain.h>
 #include <asm/system.h>
+#include <asm/unified.h>
 
 #define VERIFY_READ 0
 #define VERIFY_WRITE 1
@@ -225,7 +227,7 @@ do {                                                                        \
 
 #define __get_user_asm_byte(x,addr,err)                                \
        __asm__ __volatile__(                                   \
-       "1:     ldrbt   %1,[%2],#0\n"                           \
+       "1:     ldrbt   %1,[%2]\n"                              \
        "2:\n"                                                  \
        "       .section .fixup,\"ax\"\n"                       \
        "       .align  2\n"                                    \
@@ -261,7 +263,7 @@ do {                                                                        \
 
 #define __get_user_asm_word(x,addr,err)                                \
        __asm__ __volatile__(                                   \
-       "1:     ldrt    %1,[%2],#0\n"                           \
+       "1:     ldrt    %1,[%2]\n"                              \
        "2:\n"                                                  \
        "       .section .fixup,\"ax\"\n"                       \
        "       .align  2\n"                                    \
@@ -306,7 +308,7 @@ do {                                                                        \
 
 #define __put_user_asm_byte(x,__pu_addr,err)                   \
        __asm__ __volatile__(                                   \
-       "1:     strbt   %1,[%2],#0\n"                           \
+       "1:     strbt   %1,[%2]\n"                              \
        "2:\n"                                                  \
        "       .section .fixup,\"ax\"\n"                       \
        "       .align  2\n"                                    \
@@ -339,7 +341,7 @@ do {                                                                        \
 
 #define __put_user_asm_word(x,__pu_addr,err)                   \
        __asm__ __volatile__(                                   \
-       "1:     strt    %1,[%2],#0\n"                           \
+       "1:     strt    %1,[%2]\n"                              \
        "2:\n"                                                  \
        "       .section .fixup,\"ax\"\n"                       \
        "       .align  2\n"                                    \
@@ -364,8 +366,10 @@ do {                                                                       \
 
 #define __put_user_asm_dword(x,__pu_addr,err)                  \
        __asm__ __volatile__(                                   \
-       "1:     strt    " __reg_oper1 ", [%1], #4\n"            \
-       "2:     strt    " __reg_oper0 ", [%1], #0\n"            \
+ ARM(  "1:     strt    " __reg_oper1 ", [%1], #4\n"    )       \
+ ARM(  "2:     strt    " __reg_oper0 ", [%1]\n"        )       \
+ THUMB(        "1:     strt    " __reg_oper1 ", [%1]\n"        )       \
+ THUMB(        "2:     strt    " __reg_oper0 ", [%1, #4]\n"    )       \
        "3:\n"                                                  \
        "       .section .fixup,\"ax\"\n"                       \
        "       .align  2\n"                                    \
@@ -385,7 +389,9 @@ do {                                                                        \
 #ifdef CONFIG_MMU
 extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n);
 extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n);
+extern unsigned long __must_check __copy_to_user_std(void __user *to, const void *from, unsigned long n);
 extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
+extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n);
 #else
 #define __copy_from_user(to,from,n)    (memcpy(to, (void __force *)from, n), 0)
 #define __copy_to_user(to,from,n)      (memcpy((void __force *)to, from, n), 0)
@@ -400,7 +406,7 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u
        if (access_ok(VERIFY_READ, from, n))
                n = __copy_from_user(to, from, n);
        else /* security hole - plug it */
-               memzero(to, n);
+               memset(to, 0, n);
        return n;
 }