Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae5de0ff authored by David S. Miller's avatar David S. Miller
Browse files

[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: default avatarDavid S. Miller <davem@davemloft.net>
parent 672c6108
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -221,11 +221,12 @@ FUNC_NAME: /* %o0=src, %o1=dst, %o2=len, %o3=sum */
	sll		%g1, 8, %g1
	or		%o5, %g1, %o4

1:	add		%o3, %o4, %o3
1:	addcc		%o3, %o4, %o3
	addc		%g0, %o3, %o3

70:
	retl
	 mov		%o3, %o0
	 srl		%o3, 0, %o0

95:	mov		0, GLOBAL_SPARE
	brlez,pn	%o2, 4f