Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45537
b: refs/heads/master
c: 434f98c
h: refs/heads/master
i:
  45535: dcdbb71
v: v3
  • Loading branch information
Robert Jennings authored and Paul Mackerras committed Jan 22, 2007
1 parent ff84fa7 commit 3628c88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06cd9396778d5b70ba27fa8158db78d6bc0f007b
refs/heads/master: 434f98c48fc1d2a1f562a28a1562a7b53e940957
8 changes: 5 additions & 3 deletions trunk/include/asm-powerpc/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)

/*
* Atomically test *v and decrement if it is greater than 0.
* The function returns the old value of *v minus 1.
* The function returns the old value of *v minus 1, even if
* the atomic variable, v, was not decremented.
*/
static __inline__ int atomic_dec_if_positive(atomic_t *v)
{
Expand All @@ -216,14 +217,15 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
__asm__ __volatile__(
LWSYNC_ON_SMP
"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\
addic. %0,%0,-1\n\
cmpwi %0,1\n\
addi %0,%0,-1\n\
blt- 2f\n"
PPC405_ERR77(0,%1)
" stwcx. %0,0,%1\n\
bne- 1b"
ISYNC_ON_SMP
"\n\
2:" : "=&r" (t)
2:" : "=&b" (t)
: "r" (&v->counter)
: "cc", "memory");

Expand Down

0 comments on commit 3628c88

Please sign in to comment.