Module Name:    src
Committed By:   matt
Date:           Thu Dec 20 07:16:01 UTC 2012

Modified Files:
        src/sys/arch/arm/arm: cpu_in_cksum_fold.S cpu_in_cksum_v4hdr.S

Log Message:
Move loading of r1 with 0xffff to cpu_in_cksum_fold.S


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/arm/cpu_in_cksum_fold.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/cpu_in_cksum_v4hdr.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm/cpu_in_cksum_fold.S
diff -u src/sys/arch/arm/arm/cpu_in_cksum_fold.S:1.1 src/sys/arch/arm/arm/cpu_in_cksum_fold.S:1.2
--- src/sys/arch/arm/arm/cpu_in_cksum_fold.S:1.1	Wed Dec 19 15:05:16 2012
+++ src/sys/arch/arm/arm/cpu_in_cksum_fold.S	Thu Dec 20 07:16:00 2012
@@ -31,6 +31,16 @@
  * This file is intended to be included at the end of a in_cksum routine
  * to reduce the 33-bit sum in <carry>, ip to a 16-bit return value.
  */
+	/*
+	 * We now have a 33-bit (r0 + carry) sum which needs to resolved to a
+	 * 16-bit sum.  But first, let's put 0xffff in a register.
+	 */
+#ifdef _ARM_ARCH_7
+	movw	r1, #0xffff		/* load 0xffff */
+#else
+	mov	r1, #0x10000		/* load 0x10000 */
+	sub	r1, r1, #1		/* subtract by 1 to get 0xffff */
+#endif
 
 	/*
 	 * Add the final carry bit.  If it overflows, we have a 33-bit value

Index: src/sys/arch/arm/arm/cpu_in_cksum_v4hdr.S
diff -u src/sys/arch/arm/arm/cpu_in_cksum_v4hdr.S:1.3 src/sys/arch/arm/arm/cpu_in_cksum_v4hdr.S:1.4
--- src/sys/arch/arm/arm/cpu_in_cksum_v4hdr.S:1.3	Wed Dec 19 15:05:16 2012
+++ src/sys/arch/arm/arm/cpu_in_cksum_v4hdr.S	Thu Dec 20 07:16:01 2012
@@ -29,7 +29,7 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: cpu_in_cksum_v4hdr.S,v 1.3 2012/12/19 15:05:16 matt Exp $")
+RCSID("$NetBSD: cpu_in_cksum_v4hdr.S,v 1.4 2012/12/20 07:16:01 matt Exp $")
 
 ENTRY(cpu_in_cksum_v4hdr)
 #ifdef _ARM_ARCH_DWORD_OK
@@ -53,16 +53,6 @@ ENTRY(cpu_in_cksum_v4hdr)
 #endif
 	adcs	ip, ip, r1		/* accumulate */
 	adcs	ip, ip, r0		/* accumulate */
-	/*
-	 * We now have a 33-bit (r0 + carry) sum which needs to resolved to a
-	 * 16-bit sum.  But first, let's put 0xffff in a register.
-	 */
-#ifdef _ARM_ARCH_7
-	movw	r1, #0xffff		/* load 0xffff */
-#else
-	mov	r1, #0x10000		/* load 0x10000 */
-	sub	r1, r1, #1		/* subtract by 1 to get 0xffff */
-#endif
 
 	/*
 	 * We now have the 33-bit result in <carry>, ip.  Pull in the

Reply via email to