patch-2.3.35 linux/include/asm-sparc/spinlock.h

Next file: linux/include/asm-sparc/stat.h
Previous file: linux/include/asm-sparc/shmparam.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.34/linux/include/asm-sparc/spinlock.h linux/include/asm-sparc/spinlock.h
@@ -32,16 +32,8 @@
 extern void _do_spin_unlock(spinlock_t *lock);
 
 #define spin_trylock(lp)	_spin_trylock(lp)
-
 #define spin_lock(lock)		_do_spin_lock(lock, "spin_lock")
-#define spin_lock_irq(lock)	do { __cli(); _do_spin_lock(lock, "spin_lock_irq"); } while(0)
-#define spin_lock_bh(lock)	do { local_bh_disable(); _do_spin_lock(lock, "spin_lock_irq"); } while(0)
-#define spin_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_spin_lock(lock, "spin_lock_irqsave"); } while(0)
-
 #define spin_unlock(lock)	_do_spin_unlock(lock)
-#define spin_unlock_irq(lock)	do { _do_spin_unlock(lock); __sti(); } while(0)
-#define spin_unlock_bh(lock)	do { _do_spin_unlock(lock); local_bh_enable(); } while(0)
-#define spin_unlock_irqrestore(lock, flags) do { _do_spin_unlock(lock); __restore_flags(flags); } while(0)
 
 struct _rwlock_debug {
 	volatile unsigned int lock;
@@ -63,9 +55,6 @@
 	_do_read_lock(lock, "read_lock"); \
 	__restore_flags(flags); \
 } while(0)
-#define read_lock_irq(lock)	do { __cli(); _do_read_lock(lock, "read_lock_irq"); } while(0)
-#define read_lock_bh(lock)	do { local_bh_disable(); _do_read_lock(lock, "read_lock_irq"); } while(0)
-#define read_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_read_lock(lock, "read_lock_irqsave"); } while(0)
 
 #define read_unlock(lock) \
 do {	unsigned long flags; \
@@ -73,9 +62,6 @@
 	_do_read_unlock(lock, "read_unlock"); \
 	__restore_flags(flags); \
 } while(0)
-#define read_unlock_irq(lock)	do { _do_read_unlock(lock, "read_unlock_irq"); __sti(); } while(0)
-#define read_unlock_bh(lock)	do { _do_read_unlock(lock, "read_unlock_irq"); local_bh_enable(); } while(0)
-#define read_unlock_irqrestore(lock, flags) do { _do_read_unlock(lock, "read_unlock_irqrestore"); __restore_flags(flags); } while(0)
 
 #define write_lock(lock) \
 do {	unsigned long flags; \
@@ -83,9 +69,6 @@
 	_do_write_lock(lock, "write_lock"); \
 	__restore_flags(flags); \
 } while(0)
-#define write_lock_irq(lock)	do { __cli(); _do_write_lock(lock, "write_lock_irq"); } while(0)
-#define write_lock_bh(lock)	do { local_bh_disable(); _do_write_lock(lock, "write_lock_irq"); } while(0)
-#define write_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_write_lock(lock, "write_lock_irqsave"); } while(0)
 
 #define write_unlock(lock) \
 do {	unsigned long flags; \
@@ -93,9 +76,6 @@
 	_do_write_unlock(lock); \
 	__restore_flags(flags); \
 } while(0)
-#define write_unlock_irq(lock)	do { _do_write_unlock(lock); __sti(); } while(0)
-#define write_unlock_bh(lock)	do { _do_write_unlock(lock); local_bh_enable(); } while(0)
-#define write_unlock_irqrestore(lock, flags) do { _do_write_unlock(lock); __restore_flags(flags); } while(0)
 
 #else /* !SPIN_LOCK_DEBUG */
 
@@ -139,82 +119,6 @@
 	__asm__ __volatile__("stb %%g0, [%0]" : : "r" (lock) : "memory");
 }
 
-extern __inline__ void spin_lock_irq(spinlock_t *lock)
-{
-	__asm__ __volatile__("
-	rd	%%psr, %%g2
-	or	%%g2, %0, %%g2
-	wr	%%g2, 0x0, %%psr
-	nop; nop; nop;
-1:	ldstub	[%1], %%g2
-	orcc	%%g2, 0x0, %%g0
-	bne,a	2f
-	 ldub	[%1], %%g2
-	.text	2
-2:	orcc	%%g2, 0x0, %%g0
-	bne,a	2b
-	 ldub	[%1], %%g2
-	b,a	1b
-	.previous
-"	: /* No outputs */
-	: "i" (PSR_PIL), "r" (lock)
-	: "g2", "memory", "cc");
-}
-
-#define spin_lock_bh(___lk) do { local_bh_disable(); spin_lock(___lk); } while(0)
-
-extern __inline__ void spin_unlock_irq(spinlock_t *lock)
-{
-	__asm__ __volatile__("
-	rd	%%psr, %%g2
-	andn	%%g2, %1, %%g2
-	stb	%%g0, [%0]
-	wr	%%g2, 0x0, %%psr
-	nop; nop; nop;
-"	: /* No outputs. */
-	: "r" (lock), "i" (PSR_PIL)
-	: "g2", "memory");
-}
-
-#define spin_unlock_bh(___lk) do { spin_unlock(___lk); local_bh_enable(); } while(0)
-
-#define spin_lock_irqsave(__lock, flags)	\
-do {						\
-	register spinlock_t *__lp asm("g1");	\
-	__lp = (__lock);			\
-	__asm__ __volatile__(			\
-	"rd	%%psr, %0\n\t"			\
-	"or	%0, %1, %%g2\n\t"		\
-	"wr	%%g2, 0x0, %%psr\n\t"		\
-	"nop; nop; nop;\n"			\
-	"1:\n\t"				\
-	"ldstub	[%2], %%g2\n\t"			\
-	"orcc	%%g2, 0x0, %%g0\n\t"		\
-	"bne,a	2f\n\t"				\
-	" ldub	[%2], %%g2\n\t"			\
-	".text	2\n"				\
-	"2:\n\t"				\
-	"orcc	%%g2, 0x0, %%g0\n\t"		\
-	"bne,a	2b\n\t"				\
-	" ldub	[%2], %%g2\n\t"			\
-	"b,a	1b\n\t"				\
-	".previous\n"				\
-	: "=r" (flags)				\
-	: "i" (PSR_PIL), "r" (__lp)		\
-	: "g2", "memory", "cc");		\
-} while(0)
-
-extern __inline__ void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
-{
-	__asm__ __volatile__("
-	stb	%%g0, [%0]
-	wr	%1, 0x0, %%psr
-	nop; nop; nop;
-"	: /* No outputs. */
-	: "r" (lock), "r" (flags)
-	: "memory", "cc");
-}
-
 /* Read-write spinlocks, allowing multiple readers
  * but only one writer.
  *
@@ -299,24 +203,6 @@
 }
 
 #define write_unlock(rw)	do { (rw)->lock = 0; } while(0)
-#define read_lock_irq(lock)	do { __cli(); _read_lock(lock); } while (0)
-#define read_unlock_irq(lock)	do { _read_unlock(lock); __sti(); } while (0)
-#define write_lock_irq(lock)	do { __cli(); write_lock(lock); } while (0)
-#define write_unlock_irq(lock)	do { write_unlock(lock); __sti(); } while (0)
-
-#define read_lock_bh(lock)	do { local_bh_disable(); _read_lock(lock); } while (0)
-#define read_unlock_bh(lock)	do { _read_unlock(lock); local_bh_enable(); } while (0)
-#define write_lock_bh(lock)	do { local_bh_disable(); write_lock(lock); } while (0)
-#define write_unlock_bh(lock)	do { write_unlock(lock); local_bh_enable(); } while (0)
-
-#define read_lock_irqsave(lock, flags)	\
-	do { __save_and_cli(flags); _read_lock(lock); } while (0)
-#define read_unlock_irqrestore(lock, flags) \
-	do { _read_unlock(lock); __restore_flags(flags); } while (0)
-#define write_lock_irqsave(lock, flags)	\
-	do { __save_and_cli(flags); write_lock(lock); } while (0)
-#define write_unlock_irqrestore(lock, flags) \
-	do { write_unlock(lock); __restore_flags(flags); } while (0)
 
 #endif /* SPIN_LOCK_DEBUG */
 

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