summaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorChris Zankel <chris@zankel.net>2009-04-16 00:28:09 -0700
committerChris Zankel <chris@zankel.net>2009-05-11 21:48:23 -0700
commit7dbe5c542464a511f0ea6a14e3ff08874d7e21d5 (patch)
treebf0d993c1c14726f167da89769050723145909c4 /arch/xtensa
parent35e71f90687fd904b43e3427673827ac3e77b4d1 (diff)
downloadop-kernel-dev-7dbe5c542464a511f0ea6a14e3ff08874d7e21d5.zip
op-kernel-dev-7dbe5c542464a511f0ea6a14e3ff08874d7e21d5.tar.gz
xtensa: Fix checksum header file
We need to add a "memory" dependency (barrier) in assembly macros that access (read or write) memory. Otherwise, the compiler might ill-optimize the order of memory accesses. Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/include/asm/checksum.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/xtensa/include/asm/checksum.h b/arch/xtensa/include/asm/checksum.h
index f84d3f0..e4d831a 100644
--- a/arch/xtensa/include/asm/checksum.h
+++ b/arch/xtensa/include/asm/checksum.h
@@ -113,7 +113,8 @@ static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
are modified, we must also specify them as outputs, or gcc
will assume they contain their original values. */
: "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr)
- : "1" (iph), "2" (ihl));
+ : "1" (iph), "2" (ihl)
+ : "memory");
return csum_fold(sum);
}
@@ -227,7 +228,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
"1:\t"
: "=r" (sum), "=&r" (__dummy)
: "r" (saddr), "r" (daddr),
- "r" (htonl(len)), "r" (htonl(proto)), "0" (sum));
+ "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
+ : "memory");
return csum_fold(sum);
}
OpenPOWER on IntegriCloud