diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-06-04 21:32:01 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-04 21:32:01 -0700 |
commit | ae5de0ff0bc24664a053109c6caa782ba2ad7c53 (patch) | |
tree | d1362b5cf494f2495d318f6ca6eccd79aae77997 /arch/sparc64/lib/checksum.S | |
parent | 672c6108a51bf559d19595d9f8193dfd81f0f752 (diff) | |
download | blackbird-op-linux-ae5de0ff0bc24664a053109c6caa782ba2ad7c53.tar.gz blackbird-op-linux-ae5de0ff0bc24664a053109c6caa782ba2ad7c53.zip |
[SPARC64]: Fix missing fold at end of checksums.
Both csum_partial() and the csum_partial_copy*() family of routines
forget to do a final fold on the computed checksum value on sparc64.
So do the standard Sparc "add + set condition codes, add carry"
sequence, then make sure the high 32-bits of the return value are
clear.
Based upon some excellent detective work and debugging done by
Richard Braun and Samuel Thibault.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/lib/checksum.S')
-rw-r--r-- | arch/sparc64/lib/checksum.S | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sparc64/lib/checksum.S b/arch/sparc64/lib/checksum.S index ba9cd3ccc2b2..1d230f693dc4 100644 --- a/arch/sparc64/lib/checksum.S +++ b/arch/sparc64/lib/checksum.S @@ -165,8 +165,9 @@ csum_partial_end_cruft: sll %g1, 8, %g1 or %o5, %g1, %o4 -1: add %o2, %o4, %o2 +1: addcc %o2, %o4, %o2 + addc %g0, %o2, %o2 csum_partial_finish: retl - mov %o2, %o0 + srl %o2, 0, %o0 |