* [PATCH] v850: Use __volatile__ qualifier on test_bit asm statements
@ 2004-07-05 9:32 Miles Bader
0 siblings, 0 replies; only message in thread
From: Miles Bader @ 2004-07-05 9:32 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
Otherwise recent versions of gcc seem to optimize away some necessary tests.
Signed-off-by: Miles Bader <miles@gnu.org>
include/asm-v850/bitops.h | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff -ruN -X../cludes linux-2.6.7-uc0/include/asm-v850/bitops.h linux-2.6.7-uc0-v850-20040705/include/asm-v850/bitops.h
--- linux-2.6.7-uc0/include/asm-v850/bitops.h 2004-05-11 13:20:53.000000000 +0900
+++ linux-2.6.7-uc0-v850-20040705/include/asm-v850/bitops.h 2004-07-05 18:21:33.000000000 +0900
@@ -127,20 +127,20 @@
#define test_and_change_bit(nr, addr) __tns_atomic_bit_op ("not1", nr, addr)
-#define __const_test_bit(nr, addr) \
- ({ int __test_bit_res; \
- __asm__ ("tst1 (%1 - 0x123), %2; setf nz, %0" \
- : "=r" (__test_bit_res) \
- : "g" (((nr) & 0x7) + 0x123), \
- "m" (*((const char *)(addr) + ((nr) >> 3)))); \
- __test_bit_res; \
+#define __const_test_bit(nr, addr) \
+ ({ int __test_bit_res; \
+ __asm__ __volatile__ ("tst1 (%1 - 0x123), %2; setf nz, %0" \
+ : "=r" (__test_bit_res) \
+ : "g" (((nr) & 0x7) + 0x123), \
+ "m" (*((const char *)(addr) + ((nr) >> 3)))); \
+ __test_bit_res; \
})
extern __inline__ int __test_bit (int nr, const void *addr)
{
int res;
- __asm__ ("tst1 %1, [%2]; setf nz, %0"
- : "=r" (res)
- : "r" (nr & 0x7), "r" (addr + (nr >> 3)));
+ __asm__ __volatile__ ("tst1 %1, [%2]; setf nz, %0"
+ : "=r" (res)
+ : "r" (nr & 0x7), "r" (addr + (nr >> 3)));
return res;
}
#define test_bit(nr,addr) \
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-07-05 9:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-05 9:32 [PATCH] v850: Use __volatile__ qualifier on test_bit asm statements Miles Bader
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.