Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19016
b: refs/heads/master
c: 4b16bfb
h: refs/heads/master
v: v3
  • Loading branch information
Zoltan Menyhart authored and Tony Luck committed Jan 17, 2006
1 parent 9d34c47 commit 0436ab7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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: 8d08aed8d7714683b33666cc066e20f957dda01d
refs/heads/master: 4b16bfbf8f8013fefb49592d030ff87651ab48cb
8 changes: 4 additions & 4 deletions trunk/include/asm-ia64/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static inline void
down (struct semaphore *sem)
{
might_sleep();
if (atomic_dec_return(&sem->count) < 0)
if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1)
__down(sem);
}

Expand All @@ -75,7 +75,7 @@ down_interruptible (struct semaphore * sem)
int ret = 0;

might_sleep();
if (atomic_dec_return(&sem->count) < 0)
if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1)
ret = __down_interruptible(sem);
return ret;
}
Expand All @@ -85,15 +85,15 @@ down_trylock (struct semaphore *sem)
{
int ret = 0;

if (atomic_dec_return(&sem->count) < 0)
if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1)
ret = __down_trylock(sem);
return ret;
}

static inline void
up (struct semaphore * sem)
{
if (atomic_inc_return(&sem->count) <= 0)
if (ia64_fetchadd(1, &sem->count.counter, rel) <= -1)
__up(sem);
}

Expand Down

0 comments on commit 0436ab7

Please sign in to comment.