diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-22 12:21:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-22 12:21:02 -0500 |
commit | b4a2c87dada12010239b4d5f8f9bc0eb964a614f (patch) | |
tree | b33903197ae17defc3d61b8d8d744a3e87c22686 /include | |
parent | e45521a8d44da2c4efd17fc8e853f7917e99b57a (diff) | |
parent | e89debcd18a3ef74b27894e479d6b9e658fc6de6 (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[POWERPC] Update defconfigs
[POWERPC] atomic_dec_if_positive sign extension fix
[POWERPC] Fix OF node refcnt underflow in 836x and 832x platform code
[POWERPC] Make it blatantly clear; mpc5200 device tree is not yet stable
[POWERPC] Fix broken DMA on non-LPAR pSeries
[POWERPC] Fix cell's mmio nvram to properly parse device tree
[POWERPC] Remove bogus sanity check in pci -> OF node code
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/atomic.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h index 53283e2540b3..f038e33e6d48 100644 --- a/include/asm-powerpc/atomic.h +++ b/include/asm-powerpc/atomic.h | |||
@@ -207,7 +207,8 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | |||
207 | 207 | ||
208 | /* | 208 | /* |
209 | * Atomically test *v and decrement if it is greater than 0. | 209 | * Atomically test *v and decrement if it is greater than 0. |
210 | * The function returns the old value of *v minus 1. | 210 | * The function returns the old value of *v minus 1, even if |
211 | * the atomic variable, v, was not decremented. | ||
211 | */ | 212 | */ |
212 | static __inline__ int atomic_dec_if_positive(atomic_t *v) | 213 | static __inline__ int atomic_dec_if_positive(atomic_t *v) |
213 | { | 214 | { |
@@ -216,14 +217,15 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) | |||
216 | __asm__ __volatile__( | 217 | __asm__ __volatile__( |
217 | LWSYNC_ON_SMP | 218 | LWSYNC_ON_SMP |
218 | "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ | 219 | "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ |
219 | addic. %0,%0,-1\n\ | 220 | cmpwi %0,1\n\ |
221 | addi %0,%0,-1\n\ | ||
220 | blt- 2f\n" | 222 | blt- 2f\n" |
221 | PPC405_ERR77(0,%1) | 223 | PPC405_ERR77(0,%1) |
222 | " stwcx. %0,0,%1\n\ | 224 | " stwcx. %0,0,%1\n\ |
223 | bne- 1b" | 225 | bne- 1b" |
224 | ISYNC_ON_SMP | 226 | ISYNC_ON_SMP |
225 | "\n\ | 227 | "\n\ |
226 | 2:" : "=&r" (t) | 228 | 2:" : "=&b" (t) |
227 | : "r" (&v->counter) | 229 | : "r" (&v->counter) |
228 | : "cc", "memory"); | 230 | : "cc", "memory"); |
229 | 231 | ||