patch-2.4.10 linux/include/asm-mips/uaccess.h

Next file: linux/include/asm-mips64/a.out.h
Previous file: linux/include/asm-mips/tx3912.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/include/asm-mips/uaccess.h linux/include/asm-mips/uaccess.h
@@ -45,8 +45,12 @@
  *  - AND "addr+size" doesn't have any high-bits set
  *  - OR we are in kernel mode.
  */
-#define __access_ok(addr,size,mask) \
-        (((__signed__ long)((mask)&(addr | size | (addr+size)))) >= 0)
+#define __ua_size(size)							\
+	(__builtin_constant_p(size) && (signed long) (size) > 0 ? 0 : (size))
+
+#define __access_ok(addr,size,mask)                                     \
+	(((signed long)((mask)&(addr | (addr + size) | __ua_size(size)))) >= 0)
+
 #define __access_mask ((long)(get_fs().seg))
 
 #define access_ok(type,addr,size) \
@@ -214,8 +218,8 @@
 #define __put_user_asm(insn) \
 ({ \
 __asm__ __volatile__( \
-	"1:\t" insn "\t%1,%2\n\t" \
-	"move\t%0,$0\n" \
+	"1:\t" insn "\t%z1, %2\t\t\t# __put_user_asm\n\t" \
+	"move\t%0, $0\n" \
 	"2:\n\t" \
 	".section\t.fixup,\"ax\"\n" \
 	"3:\tli\t%0,%3\n\t" \
@@ -225,14 +229,14 @@
 	".word\t1b,3b\n\t" \
 	".previous" \
 	:"=r" (__pu_err) \
-	:"r" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT)); })
+	:"Jr" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT)); })
 
 #define __put_user_asm_ll32 \
 ({ \
 __asm__ __volatile__( \
-	"1:\tsw\t%1,%2\n\t" \
-	"2:\tsw\t%D1,%3\n" \
-	"move\t%0,$0\n" \
+	"1:\tsw\t%1, %2\t\t\t# __put_user_asm_ll32\n\t" \
+	"2:\tsw\t%D1, %3\n" \
+	"move\t%0, $0\n" \
 	"3:\n\t" \
 	".section\t.fixup,\"ax\"\n" \
 	"4:\tli\t%0,%4\n\t" \

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)