patch-2.1.37 linux/include/asm-sparc/semaphore.h
Next file: linux/include/asm-sparc/smp.h
Previous file: linux/include/asm-sparc/processor.h
Back to the patch index
Back to the overall index
- Lines: 33
- Date:
Mon May 12 10:35:43 1997
- Orig file:
v2.1.36/linux/include/asm-sparc/semaphore.h
- Orig date:
Wed Apr 23 19:01:28 1997
diff -u --recursive --new-file v2.1.36/linux/include/asm-sparc/semaphore.h linux/include/asm-sparc/semaphore.h
@@ -28,20 +28,18 @@
* XXX spinlock can allow this to be done without grabbing the IRQ
* XXX global lock.
*/
-static 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_flags(flags); \
+ cli(); \
+ if (atomic_read(&sem->waking) > 0) { \
+ atomic_dec(&sem->waking); \
+ ret = 1; \
+ } \
+ restore_flags(flags); \
+ ret; \
+})
/* This isn't quite as clever as the x86 side, I'll be fixing this
* soon enough.
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov