Merge branch 'master'
[safe/jmp/linux-2.6] / include / asm-sparc64 / uaccess.h
index 5690142..c91d1e3 100644 (file)
@@ -59,12 +59,6 @@ static inline int access_ok(int type, const void __user * addr, unsigned long si
        return 1;
 }
 
-/* this function will go away soon - use access_ok() instead */
-static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
-{
-       return 0;
-}
-
 /*
  * 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
@@ -76,26 +70,14 @@ static inline int __deprecated verify_area(int type, const void __user * addr, u
  * with the main instruction path.  This means when everything is well,
  * we don't even have to jump over them.  Further, they do not intrude
  * on our cache or tlb entries.
- *
- * There is a special way how to put a range of potentially faulting
- * insns (like twenty ldd/std's with now intervening other instructions)
- * You specify address of first in insn and 0 in fixup and in the next
- * exception_table_entry you specify last potentially faulting insn + 1
- * and in fixup the routine which should handle the fault.
- * That fixup code will get
- * (faulting_insn_address - first_insn_in_the_range_address)/4
- * in %g2 (ie. index of the faulting instruction in the range).
  */
 
-struct exception_table_entry
-{
-        unsigned insn, fixup;
+struct exception_table_entry {
+        unsigned int insn, fixup;
 };
 
-/* Special exable search, which handles ranges.  Returns fixup */
-unsigned long search_extables_range(unsigned long addr, unsigned long *g2);
-
 extern void __ret_efault(void);
+extern void __retl_efault(void);
 
 /* Uh, these should become the main single-value transfer routines..
  * They automatically use the right size if we just have the right
@@ -154,7 +136,7 @@ __asm__ __volatile__(                                                       \
        "b      2b\n\t"                                                 \
        " mov   %3, %0\n\n\t"                                           \
        ".previous\n\t"                                                 \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, 3b\n\t"                                             \
        ".previous\n\n\t"                                               \
@@ -166,7 +148,7 @@ if (__builtin_constant_p(ret) && ret == -EFAULT)                    \
 __asm__ __volatile__(                                                  \
        "/* Put user asm ret, inline. */\n"                             \
 "1:\t" "st"#size "a %1, [%2] %%asi\n\n\t"                              \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, __ret_efault\n\n\t"                                 \
        ".previous\n\n\t"                                               \
@@ -181,7 +163,7 @@ __asm__ __volatile__(                                                       \
        "ret\n\t"                                                       \
        " restore %%g0, %3, %%o0\n\n\t"                                 \
        ".previous\n\t"                                                 \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, 3b\n\n\t"                                           \
        ".previous\n\n\t"                                               \
@@ -224,7 +206,7 @@ __asm__ __volatile__(                                                       \
        "b      2b\n\t"                                                 \
        " mov   %3, %0\n\n\t"                                           \
        ".previous\n\t"                                                 \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, 3b\n\n\t"                                           \
        ".previous\n\t"                                                 \
@@ -236,7 +218,7 @@ if (__builtin_constant_p(retval) && retval == -EFAULT)                      \
 __asm__ __volatile__(                                                  \
        "/* Get user asm ret, inline. */\n"                             \
 "1:\t" "ld"#size "a [%1] %%asi, %0\n\n\t"                              \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b,__ret_efault\n\n\t"                                  \
        ".previous\n\t"                                                 \
@@ -251,7 +233,7 @@ __asm__ __volatile__(                                                       \
        "ret\n\t"                                                       \
        " restore %%g0, %2, %%o0\n\n\t"                                 \
        ".previous\n\t"                                                 \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, 3b\n\n\t"                                           \
        ".previous\n\t"                                                 \
@@ -269,7 +251,7 @@ copy_from_user(void *to, const void __user *from, unsigned long size)
 {
        unsigned long ret = ___copy_from_user(to, from, size);
 
-       if (ret)
+       if (unlikely(ret))
                ret = copy_from_user_fixup(to, from, size);
        return ret;
 }
@@ -285,7 +267,7 @@ copy_to_user(void __user *to, const void *from, unsigned long size)
 {
        unsigned long ret = ___copy_to_user(to, from, size);
 
-       if (ret)
+       if (unlikely(ret))
                ret = copy_to_user_fixup(to, from, size);
        return ret;
 }
@@ -301,7 +283,7 @@ copy_in_user(void __user *to, void __user *from, unsigned long size)
 {
        unsigned long ret = ___copy_in_user(to, from, size);
 
-       if (ret)
+       if (unlikely(ret))
                ret = copy_in_user_fixup(to, from, size);
        return ret;
 }