patch-2.3.11 linux/include/asm-alpha/spinlock.h
Next file: linux/include/asm-arm/arch-arc/time.h
Previous file: linux/include/asm-alpha/softirq.h
Back to the patch index
Back to the overall index
- Lines: 44
- Date:
Mon Jul 19 13:12:47 1999
- Orig file:
v2.3.10/linux/include/asm-alpha/spinlock.h
- Orig date:
Tue Jun 22 10:46:52 1999
diff -u --recursive --new-file v2.3.10/linux/include/asm-alpha/spinlock.h linux/include/asm-alpha/spinlock.h
@@ -65,11 +65,12 @@
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#endif
-#define spin_lock_init(lock) ((void) 0)
-#define spin_lock(lock) ((void) 0)
-#define spin_trylock(lock) (1)
-#define spin_unlock_wait(lock) ((void) 0)
-#define spin_unlock(lock) ((void) 0)
+#define spin_lock_init(lock) ((void)(lock))
+#define spin_lock(lock) ((void)(lock))
+#define spin_trylock(lock) ((void)(lock), 1)
+#define spin_unlock_wait(lock) ((void)(lock))
+#define spin_unlock(lock) ((void)(lock))
+#define spin_is_locked(lock) ((void)(lock), 0)
/*
* Read-write spinlocks, allowing multiple readers
@@ -91,10 +92,10 @@
#define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
#endif
-#define read_lock(lock) ((void) 0)
-#define read_unlock(lock) ((void) 0)
-#define write_lock(lock) ((void) 0)
-#define write_unlock(lock) ((void) 0)
+#define read_lock(lock) ((void)(lock))
+#define read_unlock(lock) ((void)(lock))
+#define write_lock(lock) ((void)(lock))
+#define write_unlock(lock) ((void)(lock))
#else /* __SMP__ */
@@ -131,8 +132,8 @@
#define spin_lock_init(x) ((x)->lock = 0)
#endif
-#define spin_unlock_wait(x) \
- ({ do { barrier(); } while(((volatile spinlock_t *)x)->lock); })
+#define spin_is_locked(x) ((x)->lock != 0)
+#define spin_unlock_wait(x) ({ do { barrier(); } while ((x)->lock); })
typedef struct { unsigned long a[100]; } __dummy_lock_t;
#define __dummy_lock(lock) (*(__dummy_lock_t *)(lock))
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)