patch-2.2.14 linux/include/asm-alpha/spinlock.h

Next file: linux/include/asm-alpha/system.h
Previous file: linux/include/asm-alpha/softirq.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.13/linux/include/asm-alpha/spinlock.h linux/include/asm-alpha/spinlock.h
@@ -25,6 +25,7 @@
 #define spin_unlock(lock)			((void) 0)
 #define spin_lock_irq(lock)			cli()
 #define spin_unlock_irq(lock)			sti()
+#define spin_is_locked(lock)			(0)
 
 #define spin_lock_irqsave(lock, flags)		save_and_cli(flags)
 #define spin_unlock_irqrestore(lock, flags)	restore_flags(flags)
@@ -97,6 +98,9 @@
 #define SPIN_LOCK_UNLOCKED	(spinlock_t) { 0 }
 #define spin_lock_init(x)	((x)->lock = 0)
 #endif
+
+#define spin_is_locked(lp) \
+	(*((volatile unsigned int *)(&((lp)->lock))) != 0)
 
 #define spin_unlock_wait(x) \
 	({ do { barrier(); } while(((volatile spinlock_t *)x)->lock); })

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)