patch-2.1.15 linux/arch/i386/lib/checksum.c

Next file: linux/arch/i386/mm/fault.c
Previous file: linux/arch/i386/kernel/vm86.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.14/linux/arch/i386/lib/checksum.c linux/arch/i386/lib/checksum.c
@@ -70,8 +70,7 @@
 2:	    movl %%edx, %%ecx
 	    andl $0x1c, %%edx
 	    je 4f
-	    shrl $2, %%edx
-	    testl %%esi, %%esi
+	    shrl $2, %%edx	# This clears CF
 3:	    adcl (%%esi), %%eax
 	    lea 4(%%esi), %%esi
 	    dec %%edx
@@ -117,52 +116,48 @@
 	addw %%bx, %%ax
 	adcl $0, %%eax
 2:
-	movl %%ecx, %%edx
+	pushl %%ecx
 	shrl $5, %%ecx
 	jz 2f
 	testl %%esi, %%esi
 1:	movl (%%esi), %%ebx
+	movl 4(%%esi), %%edx
 	adcl %%ebx, %%eax
 	movl %%ebx, (%%edi)
-
-	movl 4(%%esi), %%ebx
-	adcl %%ebx, %%eax
-	movl %%ebx, 4(%%edi)
+	adcl %%edx, %%eax
+	movl %%edx, 4(%%edi)
 
 	movl 8(%%esi), %%ebx
+	movl 12(%%esi), %%edx
 	adcl %%ebx, %%eax
 	movl %%ebx, 8(%%edi)
-
-	movl 12(%%esi), %%ebx
-	adcl %%ebx, %%eax
-	movl %%ebx, 12(%%edi)
+	adcl %%edx, %%eax
+	movl %%edx, 12(%%edi)
 
 	movl 16(%%esi), %%ebx
+	movl 20(%%esi), %%edx
 	adcl %%ebx, %%eax
 	movl %%ebx, 16(%%edi)
-
-	movl 20(%%esi), %%ebx
-	adcl %%ebx, %%eax
-	movl %%ebx, 20(%%edi)
+	adcl %%edx, %%eax
+	movl %%edx, 20(%%edi)
 
 	movl 24(%%esi), %%ebx
+	movl 28(%%esi), %%edx
 	adcl %%ebx, %%eax
 	movl %%ebx, 24(%%edi)
-
-	movl 28(%%esi), %%ebx
-	adcl %%ebx, %%eax
-	movl %%ebx, 28(%%edi)
+	adcl %%edx, %%eax
+	movl %%edx, 28(%%edi)
 
 	lea 32(%%esi), %%esi
 	lea 32(%%edi), %%edi
 	dec %%ecx
 	jne 1b
 	adcl $0, %%eax
-2:	movl %%edx, %%ecx
-	andl $28, %%edx
+2:	popl %%edx
+	movl %%edx, %%ecx
+	andl $0x1c, %%edx
 	je 4f
-	shrl $2, %%edx
-	testl %%esi, %%esi
+	shrl $2, %%edx		# This clears CF
 3:	movl (%%esi), %%ebx
 	adcl %%ebx, %%eax
 	movl %%ebx, (%%edi)

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