Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm Move loading of r1 with 0xffff to cpu_in_ck...



details:   https://anonhg.NetBSD.org/src/rev/6aece91e6994
branches:  trunk
changeset: 783420:6aece91e6994
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Dec 20 07:16:00 2012 +0000

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

diffstat:

 sys/arch/arm/arm/cpu_in_cksum_fold.S  |  10 ++++++++++
 sys/arch/arm/arm/cpu_in_cksum_v4hdr.S |  12 +-----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diffs (49 lines):

diff -r b4f8b0a85469 -r 6aece91e6994 sys/arch/arm/arm/cpu_in_cksum_fold.S
--- a/sys/arch/arm/arm/cpu_in_cksum_fold.S      Thu Dec 20 07:12:26 2012 +0000
+++ b/sys/arch/arm/arm/cpu_in_cksum_fold.S      Thu Dec 20 07:16:00 2012 +0000
@@ -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
diff -r b4f8b0a85469 -r 6aece91e6994 sys/arch/arm/arm/cpu_in_cksum_v4hdr.S
--- a/sys/arch/arm/arm/cpu_in_cksum_v4hdr.S     Thu Dec 20 07:12:26 2012 +0000
+++ b/sys/arch/arm/arm/cpu_in_cksum_v4hdr.S     Thu Dec 20 07:16:00 2012 +0000
@@ -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 @@
 #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



Home | Main Index | Thread Index | Old Index