patch-2.4.0-test2 linux/arch/arm/lib/uaccess.S

Next file: linux/arch/arm/mm/Makefile
Previous file: linux/arch/arm/lib/testsetbit.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/arch/arm/lib/uaccess.S linux/arch/arm/lib/uaccess.S
@@ -538,13 +538,18 @@
 
 		.section .fixup,"ax"
 		.align	0
-		/* We took an exception.  Zero out the buffer and pretend no
-		   data was copied.  */
-9001:		ldr	r0, [sp], #4
-		ldr	r1, [sp]
-		teq	r1, #0
+		/*
+		 * We took an exception.  r0 contains a pointer to
+		 * the byte not copied.
+		 */
+9001:		ldr	r2, [sp], #4			@ void *to
+		sub	r2, r0, r2			@ bytes copied
+		ldr	r1, [sp], #4			@ unsigned long count
+		subs	r4, r1, r2			@ bytes left to copy
+		movne	r1, r4
 		blne	SYMBOL_NAME(__memzero)
-		LOADREGS(fd,sp!, {r0, r4 - r7, pc})
+		mov	r0, r4
+		LOADREGS(fd,sp!, {r4 - r7, pc})
 		.previous
 
 /* Prototype: int __arch_clear_user(void *addr, size_t sz)

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