summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/semaphore.h
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@nuclecu.unam.mx>1997-08-06 19:14:48 +0000
committerMiguel de Icaza <miguel@nuclecu.unam.mx>1997-08-06 19:14:48 +0000
commite2819e52a162873ff5061de81bb749831bdb5de9 (patch)
tree6067ea700202750ba335a423696f2972700e5f76 /include/asm-sparc64/semaphore.h
parent17a005074429bbf143e40401f405ae4363e56828 (diff)
Merge to 2.1.38.
IMPORTANT NOTE: I could not figure out what information is the one that should be used for the following files (ie, those that were in our tree, or those that came from Linus' patch), please, check these: include/asm-mips/jazz.h include/asm-mips/jazzdma.h include/asm-mips/ioctls.h
Diffstat (limited to 'include/asm-sparc64/semaphore.h')
-rw-r--r--include/asm-sparc64/semaphore.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h
index 57dc42260..297173a89 100644
--- a/include/asm-sparc64/semaphore.h
+++ b/include/asm-sparc64/semaphore.h
@@ -24,20 +24,17 @@ extern void __up(struct semaphore * sem);
#define wake_one_more(sem) atomic_inc(&sem->waking);
-extern __inline__ int waking_non_zero(struct semaphore *sem)
-{
- unsigned long flags;
- int ret = 0;
-
- save_flags(flags);
- cli();
- if (atomic_read(&sem->waking) > 0) {
- atomic_dec(&sem->waking);
- ret = 1;
- }
- restore_flags(flags);
- return ret;
-}
+#define waking_non_zero(sem) \
+({ unsigned long flags; \
+ int ret = 0; \
+ save_and_cli(flags); \
+ if (atomic_read(&sem->waking) > 0) { \
+ atomic_dec(&sem->waking); \
+ ret = 1; \
+ } \
+ restore_flags(flags); \
+ ret; \
+})
extern __inline__ void down(struct semaphore * sem)
{