aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorChris Zankel <chris@zankel.net>2009-04-16 03:28:09 -0400
committerChris Zankel <chris@zankel.net>2009-05-12 00:48:23 -0400
commit7dbe5c542464a511f0ea6a14e3ff08874d7e21d5 (patch)
treebf0d993c1c14726f167da89769050723145909c4 /arch/xtensa
parent35e71f90687fd904b43e3427673827ac3e77b4d1 (diff)
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 f84d3f00774a..e4d831a30772 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)
113 are modified, we must also specify them as outputs, or gcc 113 are modified, we must also specify them as outputs, or gcc
114 will assume they contain their original values. */ 114 will assume they contain their original values. */
115 : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr) 115 : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr)
116 : "1" (iph), "2" (ihl)); 116 : "1" (iph), "2" (ihl)
117 : "memory");
117 118
118 return csum_fold(sum); 119 return csum_fold(sum);
119} 120}
@@ -227,7 +228,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
227 "1:\t" 228 "1:\t"
228 : "=r" (sum), "=&r" (__dummy) 229 : "=r" (sum), "=&r" (__dummy)
229 : "r" (saddr), "r" (daddr), 230 : "r" (saddr), "r" (daddr),
230 "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)); 231 "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
232 : "memory");
231 233
232 return csum_fold(sum); 234 return csum_fold(sum);
233} 235}