X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Fasm-ia64%2Fsemaphore.h;h=f483eeb95dd1dabfd248803492bb0a6a7561b6ec;hb=fab8d6ddf6dee2608869005d45fe97f70e4f5bdd;hp=bb8906285fab24104df8acf9c7f3ba1c35733ccf;hpb=c1d962035d49565d8c7a2d97519012ccb861778a;p=powerpc.git diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h index bb8906285f..f483eeb95d 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); }