diff options
Diffstat (limited to 'include/asm-powerpc/spinlock.h')
-rw-r--r-- | include/asm-powerpc/spinlock.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h index 26b8744ed529..895cb6d3a42a 100644 --- a/include/asm-powerpc/spinlock.h +++ b/include/asm-powerpc/spinlock.h | |||
@@ -46,7 +46,7 @@ static __inline__ unsigned long __spin_trylock(raw_spinlock_t *lock) | |||
46 | 46 | ||
47 | token = LOCK_TOKEN; | 47 | token = LOCK_TOKEN; |
48 | __asm__ __volatile__( | 48 | __asm__ __volatile__( |
49 | "1: lwarx %0,0,%2 # __spin_trylock\n\ | 49 | "1: lwarx %0,0,%2\n\ |
50 | cmpwi 0,%0,0\n\ | 50 | cmpwi 0,%0,0\n\ |
51 | bne- 2f\n\ | 51 | bne- 2f\n\ |
52 | stwcx. %1,0,%2\n\ | 52 | stwcx. %1,0,%2\n\ |
@@ -124,8 +124,8 @@ static void __inline__ __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long | |||
124 | 124 | ||
125 | static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) | 125 | static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) |
126 | { | 126 | { |
127 | __asm__ __volatile__(SYNC_ON_SMP" # __raw_spin_unlock" | 127 | __asm__ __volatile__("# __raw_spin_unlock\n\t" |
128 | : : :"memory"); | 128 | LWSYNC_ON_SMP: : :"memory"); |
129 | lock->slock = 0; | 129 | lock->slock = 0; |
130 | } | 130 | } |
131 | 131 | ||
@@ -167,7 +167,7 @@ static long __inline__ __read_trylock(raw_rwlock_t *rw) | |||
167 | long tmp; | 167 | long tmp; |
168 | 168 | ||
169 | __asm__ __volatile__( | 169 | __asm__ __volatile__( |
170 | "1: lwarx %0,0,%1 # read_trylock\n" | 170 | "1: lwarx %0,0,%1\n" |
171 | __DO_SIGN_EXTEND | 171 | __DO_SIGN_EXTEND |
172 | " addic. %0,%0,1\n\ | 172 | " addic. %0,%0,1\n\ |
173 | ble- 2f\n" | 173 | ble- 2f\n" |
@@ -192,7 +192,7 @@ static __inline__ long __write_trylock(raw_rwlock_t *rw) | |||
192 | 192 | ||
193 | token = WRLOCK_TOKEN; | 193 | token = WRLOCK_TOKEN; |
194 | __asm__ __volatile__( | 194 | __asm__ __volatile__( |
195 | "1: lwarx %0,0,%2 # write_trylock\n\ | 195 | "1: lwarx %0,0,%2\n\ |
196 | cmpwi 0,%0,0\n\ | 196 | cmpwi 0,%0,0\n\ |
197 | bne- 2f\n" | 197 | bne- 2f\n" |
198 | PPC405_ERR77(0,%1) | 198 | PPC405_ERR77(0,%1) |
@@ -249,8 +249,9 @@ static void __inline__ __raw_read_unlock(raw_rwlock_t *rw) | |||
249 | long tmp; | 249 | long tmp; |
250 | 250 | ||
251 | __asm__ __volatile__( | 251 | __asm__ __volatile__( |
252 | "eieio # read_unlock\n\ | 252 | "# read_unlock\n\t" |
253 | 1: lwarx %0,0,%1\n\ | 253 | LWSYNC_ON_SMP |
254 | "1: lwarx %0,0,%1\n\ | ||
254 | addic %0,%0,-1\n" | 255 | addic %0,%0,-1\n" |
255 | PPC405_ERR77(0,%1) | 256 | PPC405_ERR77(0,%1) |
256 | " stwcx. %0,0,%1\n\ | 257 | " stwcx. %0,0,%1\n\ |
@@ -262,8 +263,8 @@ static void __inline__ __raw_read_unlock(raw_rwlock_t *rw) | |||
262 | 263 | ||
263 | static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) | 264 | static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) |
264 | { | 265 | { |
265 | __asm__ __volatile__(SYNC_ON_SMP" # write_unlock" | 266 | __asm__ __volatile__("# write_unlock\n\t" |
266 | : : :"memory"); | 267 | LWSYNC_ON_SMP: : :"memory"); |
267 | rw->lock = 0; | 268 | rw->lock = 0; |
268 | } | 269 | } |
269 | 270 | ||