diff options
author | marius <marius@FreeBSD.org> | 2006-01-12 11:40:39 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2006-01-12 11:40:39 +0000 |
commit | 402d4e2682da8d6457b915d4c089122644940011 (patch) | |
tree | 48e54d6965df7593d492159f606d6782a0732f63 | |
parent | fcfa85f99052b9be4dbdc4d256c94943bfd8a628 (diff) | |
download | FreeBSD-src-402d4e2682da8d6457b915d4c089122644940011.zip FreeBSD-src-402d4e2682da8d6457b915d4c089122644940011.tar.gz |
- The inline asm in this file uses output operands before all input
operands are consumed so use the appropriate constraint modifier.
Before this change GCC used one register for both an input and an
unrelated output operand of in_addword(), causing the input to be
overwritten before it was consumed and thus breaking in_addword().
For in_cksum_hdr() and in_pseudo() this change is more or less
cosmetic.
- Fix a misspelling in a nearby comment.
Reported & tested by: yongari
MFC after: 1 week
-rw-r--r-- | sys/sparc64/include/in_cksum.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sparc64/include/in_cksum.h b/sys/sparc64/include/in_cksum.h index 7fbba02..2e46f46 100644 --- a/sys/sparc64/include/in_cksum.h +++ b/sys/sparc64/include/in_cksum.h @@ -85,7 +85,7 @@ in_addword(u_short sum, u_short b) "addcc %0, %1, %0\n" "srl %0, 16, %0\n" "addc %0, 0, %0\n" - : "=r" (__ret), "=r" (__tmp) : "r" (sum), "r" (b)); + : "=&r" (__ret), "=&r" (__tmp) : "r" (sum), "r" (b)); return (__ret); } @@ -102,7 +102,7 @@ in_pseudo(u_int sum, u_int b, u_int c) "addcc %0, %1, %0\n" "srl %0, 16, %0\n" "addc %0, 0, %0\n" - : "=r" (sum), "=r" (__tmp) : "0" (sum), "r" (b), "r" (c)); + : "=r" (sum), "=&r" (__tmp) : "0" (sum), "r" (b), "r" (c)); return (sum); } @@ -113,7 +113,7 @@ in_cksum_hdr(struct ip *ip) /* * Use 32 bit memory accesses and additions - addition with carry only - * works for 32 bits, and fixing up alignent issues for 64 is probably + * works for 32 bits, and fixing up alignment issues for 64 is probably * more trouble than it's worth. * This may read outside of the ip header, but does not cross a page * boundary in doing so, so that should be OK. @@ -158,8 +158,8 @@ in_cksum_hdr(struct ip *ip) "not %0\n" "sll %0, 16, %0\n" "srl %0, 16, %0\n" - : "=r" (__ret), "=r" (__tmp1), "=r" (__tmp2), "=r" (__tmp3), - "=r" (__tmp4) : "1" (ip)); + : "=&r" (__ret), "=r" (__tmp1), "=&r" (__tmp2), "=&r" (__tmp3), + "=&r" (__tmp4) : "1" (ip)); #undef __LD_ADD return (__ret); } |