summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/in_cksum.h
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-13 14:00:10 +0000
committered <ed@FreeBSD.org>2009-06-13 14:00:10 +0000
commitac0e32dbc72b4af6d27493fb54a626ef180cbd98 (patch)
tree5e2a69aef59fe73e612a571433766c7ca847a112 /sys/i386/include/in_cksum.h
parentc8fca13eccd61e436c99dda952916977b9715b32 (diff)
downloadFreeBSD-src-ac0e32dbc72b4af6d27493fb54a626ef180cbd98.zip
FreeBSD-src-ac0e32dbc72b4af6d27493fb54a626ef180cbd98.tar.gz
Clobber "cc" instead of using volatile; remove obsolete register keyword.
Submitted by: Christoph Mallon
Diffstat (limited to 'sys/i386/include/in_cksum.h')
-rw-r--r--sys/i386/include/in_cksum.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/i386/include/in_cksum.h b/sys/i386/include/in_cksum.h
index 7e7f815..c692f69 100644
--- a/sys/i386/include/in_cksum.h
+++ b/sys/i386/include/in_cksum.h
@@ -57,9 +57,9 @@
static __inline u_int
in_cksum_hdr(const struct ip *ip)
{
- register u_int sum = 0;
+ u_int sum = 0;
- __asm __volatile (
+ __asm(
"addl %1, %0\n"
"adcl %2, %0\n"
"adcl %3, %0\n"
@@ -72,6 +72,7 @@ in_cksum_hdr(const struct ip *ip)
"g" (((const u_int32_t *)ip)[2]),
"g" (((const u_int32_t *)ip)[3]),
"g" (((const u_int32_t *)ip)[4])
+ : "cc"
);
sum = (sum & 0xffff) + (sum >> 16);
if (sum > 0xffff)
@@ -91,12 +92,12 @@ in_cksum_update(struct ip *ip)
static __inline u_short
in_addword(u_short sum, u_short b)
{
- /* __volatile is necessary because the condition codes are used. */
- __asm __volatile (
+ __asm(
"addw %1, %0\n"
"adcw $0, %0"
: "+r" (sum)
- : "r" (b)
+ : "g" (b)
+ : "cc"
);
return (sum);
}
@@ -104,14 +105,14 @@ in_addword(u_short sum, u_short b)
static __inline u_short
in_pseudo(u_int sum, u_int b, u_int c)
{
- /* __volatile is necessary because the condition codes are used. */
- __asm __volatile (
+ __asm(
"addl %1, %0\n"
"adcl %2, %0\n"
"adcl $0, %0"
: "+r" (sum)
: "g" (b),
"g" (c)
+ : "cc"
);
sum = (sum & 0xffff) + (sum >> 16);
if (sum > 0xffff)
OpenPOWER on IntegriCloud