diff options
author | Anton Blanchard <anton@samba.org> | 2010-02-09 20:02:36 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-02-16 22:03:15 -0500 |
commit | 864b9e6fd76489aab422bac62162f57c52e06ed8 (patch) | |
tree | 5ba9673f295abda55a23ae33e11a75de9b8292bf /arch/powerpc/include/asm/bitops.h | |
parent | 4e14a4d17a8cd66ccab180d32c977091922cfbed (diff) |
powerpc: Use lwarx/ldarx hint in bit locks
This patch implements the lwarx/ldarx hint bit for bit locks.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/bitops.h')
-rw-r--r-- | arch/powerpc/include/asm/bitops.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h index 56f2f2ea563..3c7c37bd92e 100644 --- a/arch/powerpc/include/asm/bitops.h +++ b/arch/powerpc/include/asm/bitops.h | |||
@@ -65,7 +65,7 @@ static __inline__ void fn(unsigned long mask, \ | |||
65 | unsigned long *p = (unsigned long *)_p; \ | 65 | unsigned long *p = (unsigned long *)_p; \ |
66 | __asm__ __volatile__ ( \ | 66 | __asm__ __volatile__ ( \ |
67 | prefix \ | 67 | prefix \ |
68 | "1:" PPC_LLARX "%0,0,%3\n" \ | 68 | "1:" PPC_LLARX(%0,0,%3,0) "\n" \ |
69 | stringify_in_c(op) "%0,%0,%2\n" \ | 69 | stringify_in_c(op) "%0,%0,%2\n" \ |
70 | PPC405_ERR77(0,%3) \ | 70 | PPC405_ERR77(0,%3) \ |
71 | PPC_STLCX "%0,0,%3\n" \ | 71 | PPC_STLCX "%0,0,%3\n" \ |
@@ -103,31 +103,31 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr) | |||
103 | 103 | ||
104 | /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output | 104 | /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output |
105 | * operands. */ | 105 | * operands. */ |
106 | #define DEFINE_TESTOP(fn, op, prefix, postfix) \ | 106 | #define DEFINE_TESTOP(fn, op, prefix, postfix, eh) \ |
107 | static __inline__ unsigned long fn( \ | 107 | static __inline__ unsigned long fn( \ |
108 | unsigned long mask, \ | 108 | unsigned long mask, \ |
109 | volatile unsigned long *_p) \ | 109 | volatile unsigned long *_p) \ |
110 | { \ | 110 | { \ |
111 | unsigned long old, t; \ | 111 | unsigned long old, t; \ |
112 | unsigned long *p = (unsigned long *)_p; \ | 112 | unsigned long *p = (unsigned long *)_p; \ |
113 | __asm__ __volatile__ ( \ | 113 | __asm__ __volatile__ ( \ |
114 | prefix \ | 114 | prefix \ |
115 | "1:" PPC_LLARX "%0,0,%3\n" \ | 115 | "1:" PPC_LLARX(%0,0,%3,eh) "\n" \ |
116 | stringify_in_c(op) "%1,%0,%2\n" \ | 116 | stringify_in_c(op) "%1,%0,%2\n" \ |
117 | PPC405_ERR77(0,%3) \ | 117 | PPC405_ERR77(0,%3) \ |
118 | PPC_STLCX "%1,0,%3\n" \ | 118 | PPC_STLCX "%1,0,%3\n" \ |
119 | "bne- 1b\n" \ | 119 | "bne- 1b\n" \ |
120 | postfix \ | 120 | postfix \ |
121 | : "=&r" (old), "=&r" (t) \ | 121 | : "=&r" (old), "=&r" (t) \ |
122 | : "r" (mask), "r" (p) \ | 122 | : "r" (mask), "r" (p) \ |
123 | : "cc", "memory"); \ | 123 | : "cc", "memory"); \ |
124 | return (old & mask); \ | 124 | return (old & mask); \ |
125 | } | 125 | } |
126 | 126 | ||
127 | DEFINE_TESTOP(test_and_set_bits, or, LWSYNC_ON_SMP, ISYNC_ON_SMP) | 127 | DEFINE_TESTOP(test_and_set_bits, or, LWSYNC_ON_SMP, ISYNC_ON_SMP, 0) |
128 | DEFINE_TESTOP(test_and_set_bits_lock, or, "", ISYNC_ON_SMP) | 128 | DEFINE_TESTOP(test_and_set_bits_lock, or, "", ISYNC_ON_SMP, 1) |
129 | DEFINE_TESTOP(test_and_clear_bits, andc, LWSYNC_ON_SMP, ISYNC_ON_SMP) | 129 | DEFINE_TESTOP(test_and_clear_bits, andc, LWSYNC_ON_SMP, ISYNC_ON_SMP, 0) |
130 | DEFINE_TESTOP(test_and_change_bits, xor, LWSYNC_ON_SMP, ISYNC_ON_SMP) | 130 | DEFINE_TESTOP(test_and_change_bits, xor, LWSYNC_ON_SMP, ISYNC_ON_SMP, 0) |
131 | 131 | ||
132 | static __inline__ int test_and_set_bit(unsigned long nr, | 132 | static __inline__ int test_and_set_bit(unsigned long nr, |
133 | volatile unsigned long *addr) | 133 | volatile unsigned long *addr) |