summaryrefslogtreecommitdiff
path: root/include/asm-ia64/semaphore.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-20 09:16:58 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-20 09:16:58 +0300
commit497992917edf03994088ec8757b8262e1d9f568a (patch)
tree7e82975f98d3d3c9f80e10c981601db23eef5bd1 /include/asm-ia64/semaphore.h
parent7e732bfc5570b8f9bb5f155cf36e94b2e7d6bf6a (diff)
parent386d1d50c8eef254653b1015fde06622ef38ba76 (diff)
downloadlinux-497992917edf03994088ec8757b8262e1d9f568a.tar.xz
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Diffstat (limited to 'include/asm-ia64/semaphore.h')
-rw-r--r--include/asm-ia64/semaphore.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h
index bb8906285fab..f483eeb95dd1 100644
--- a/include/asm-ia64/semaphore.h
+++ b/include/asm-ia64/semaphore.h
@@ -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);
}
@@ -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;
}
@@ -85,7 +85,7 @@ 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;
}
@@ -93,7 +93,7 @@ down_trylock (struct semaphore *sem)
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);
}