Commit 7c29ca5b authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

alpha: fix bitops

Documentation/atomic_ops.txt defines these primitives must contain a memory
barrier both before and after their memory operation.  This is consistent with
the atomic ops implementation on alpha.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 26333576
...@@ -117,6 +117,9 @@ test_and_set_bit(unsigned long nr, volatile void *addr) ...@@ -117,6 +117,9 @@ test_and_set_bit(unsigned long nr, volatile void *addr)
int *m = ((int *) addr) + (nr >> 5); int *m = ((int *) addr) + (nr >> 5);
__asm__ __volatile__( __asm__ __volatile__(
#ifdef CONFIG_SMP
" mb\n"
#endif
"1: ldl_l %0,%4\n" "1: ldl_l %0,%4\n"
" and %0,%3,%2\n" " and %0,%3,%2\n"
" bne %2,2f\n" " bne %2,2f\n"
...@@ -158,6 +161,9 @@ test_and_clear_bit(unsigned long nr, volatile void * addr) ...@@ -158,6 +161,9 @@ test_and_clear_bit(unsigned long nr, volatile void * addr)
int *m = ((int *) addr) + (nr >> 5); int *m = ((int *) addr) + (nr >> 5);
__asm__ __volatile__( __asm__ __volatile__(
#ifdef CONFIG_SMP
" mb\n"
#endif
"1: ldl_l %0,%4\n" "1: ldl_l %0,%4\n"
" and %0,%3,%2\n" " and %0,%3,%2\n"
" beq %2,2f\n" " beq %2,2f\n"
...@@ -199,6 +205,9 @@ test_and_change_bit(unsigned long nr, volatile void * addr) ...@@ -199,6 +205,9 @@ test_and_change_bit(unsigned long nr, volatile void * addr)
int *m = ((int *) addr) + (nr >> 5); int *m = ((int *) addr) + (nr >> 5);
__asm__ __volatile__( __asm__ __volatile__(
#ifdef CONFIG_SMP
" mb\n"
#endif
"1: ldl_l %0,%4\n" "1: ldl_l %0,%4\n"
" and %0,%3,%2\n" " and %0,%3,%2\n"
" xor %0,%3,%0\n" " xor %0,%3,%0\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment