aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-frv/checksum.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-06-05 12:07:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-06-05 13:31:21 -0400
commit609a70ac927b72da647ccee7873d928d45055eae (patch)
treea9d9268d5a517001f2895de9a0a85f7050fbcee8 /include/asm-frv/checksum.h
parent5a515bcbea580a65ced92405b083299df9003748 (diff)
FRV: ip_fast_csum() requires a memory clobber on its inline asm
ip_fast_csum() requires a memory clobber on its inline asm as it accesses memory in a fashion that gcc can't predict. The GCC manual says: If your assembler instructions access memory in an unpredictable fashion, add `memory' to the list of clobbered registers. This will cause GCC to not keep memory values cached in registers across the assembler instruction and not optimize stores or loads to that memory. The bug hasn't been noticed in FRV, but it has been seen in PA-RISC. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-frv/checksum.h')
-rw-r--r--include/asm-frv/checksum.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-frv/checksum.h b/include/asm-frv/checksum.h
index 9b1689850187..269da09ff637 100644
--- a/include/asm-frv/checksum.h
+++ b/include/asm-frv/checksum.h
@@ -75,7 +75,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
75 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (inc), "=&r"(tmp) 75 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (inc), "=&r"(tmp)
76 : "0" (sum), "1" (iph), "2" (ihl), "3" (4), 76 : "0" (sum), "1" (iph), "2" (ihl), "3" (4),
77 "m"(*(volatile struct { int _[100]; } *)iph) 77 "m"(*(volatile struct { int _[100]; } *)iph)
78 : "icc0", "icc1" 78 : "icc0", "icc1", "memory"
79 ); 79 );
80 80
81 return (__force __sum16)~sum; 81 return (__force __sum16)~sum;