patch-2.2.0-pre1 linux/arch/i386/lib/usercopy.c

Next file: linux/arch/i386/mm/init.c
Previous file: linux/arch/i386/lib/old-checksum.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.132/linux/arch/i386/lib/usercopy.c linux/arch/i386/lib/usercopy.c
@@ -29,6 +29,8 @@
  */
 
 #define __do_strncpy_from_user(dst,src,count,res)			   \
+do {									   \
+	int __d0, __d1, __d2;						   \
 	__asm__ __volatile__(						   \
 		"	testl %1,%1\n"					   \
 		"	jz 2f\n"					   \
@@ -41,16 +43,18 @@
 		"1:	subl %1,%0\n"					   \
 		"2:\n"							   \
 		".section .fixup,\"ax\"\n"				   \
-		"3:	movl %2,%0\n"					   \
+		"3:	movl %5,%0\n"					   \
 		"	jmp 2b\n"					   \
 		".previous\n"						   \
 		".section __ex_table,\"a\"\n"				   \
 		"	.align 4\n"					   \
 		"	.long 0b,3b\n"					   \
 		".previous"						   \
-		: "=d"(res), "=c"(count)				   \
-		: "i"(-EFAULT), "0"(count), "1"(count), "S"(src), "D"(dst) \
-		: "si", "di", "ax", "memory")
+		: "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1),	   \
+		  "=&D" (__d2)						   \
+		: "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
+		: "memory");						   \
+} while (0)
 
 long
 __strncpy_from_user(char *dst, const char *src, long count)
@@ -74,14 +78,16 @@
  * Zero Userspace
  */
 
-#define __do_clear_user(addr,size)						\
-	__asm__ __volatile__(						\
+#define __do_clear_user(addr,size)					\
+do {									\
+	int __d0;							\
+  	__asm__ __volatile__(						\
 		"0:	rep; stosl\n"					\
-		"	movl %1,%0\n"					\
+		"	movl %2,%0\n"					\
 		"1:	rep; stosb\n"					\
 		"2:\n"							\
 		".section .fixup,\"ax\"\n"				\
-		"3:	lea 0(%1,%0,4),%0\n"				\
+		"3:	lea 0(%2,%0,4),%0\n"				\
 		"	jmp 2b\n"					\
 		".previous\n"						\
 		".section __ex_table,\"a\"\n"				\
@@ -89,9 +95,9 @@
 		"	.long 0b,3b\n"					\
 		"	.long 1b,2b\n"					\
 		".previous"						\
-		: "=&c"(size)						\
-		: "r"(size & 3), "0"(size / 4), "D"(addr), "a"(0)	\
-		: "di")
+		: "=&c"(size), "=&D" (__d0)				\
+		: "r"(size & 3), "0"(size / 4), "1"(addr), "a"(0));	\
+} while (0)
 
 unsigned long
 clear_user(void *to, unsigned long n)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov