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

Next file: linux/include/asm-arm/dma.h
Previous file: linux/include/asm-alpha/smplock.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.17/linux/include/asm-alpha/spinlock.h linux/include/asm-alpha/spinlock.h
@@ -2,103 +2,6 @@
 #define _ALPHA_SPINLOCK_H
 
 #include <asm/system.h>
-
-/*
- * These are the generic versions of the spinlocks
- * and read-write locks.. We should actually do a
- * <linux/spinlock.h> with all of this. Oh, well.
- */
-#define spin_lock_irqsave(lock, flags) \
-  do { local_irq_save(flags); spin_lock(lock); } while (0)
-#define spin_lock_irq(lock) \
-  do { local_irq_disable(); spin_lock(lock); } while (0)
-#define spin_lock_bh(lock) \
-  do { local_bh_disable(); spin_lock(lock); } while (0)
-
-#define read_lock_irqsave(lock, flags) \
-  do { local_irq_save(flags); read_lock(lock); } while (0)
-#define read_lock_irq(lock) \
-  do { local_irq_disable(); read_lock(lock); } while (0)
-#define read_lock_bh(lock) \
-  do { local_bh_disable(); read_lock(lock); } while (0)
-
-#define write_lock_irqsave(lock, flags) \
-  do { local_irq_save(flags); write_lock(lock); } while (0)
-#define write_lock_irq(lock) \
-  do { local_irq_disable(); write_lock(lock); } while (0)
-#define write_lock_bh(lock) \
-  do { local_bh_disable(); write_lock(lock); } while (0)
-
-#define spin_unlock_irqrestore(lock, flags) \
-  do { spin_unlock(lock); local_irq_restore(flags); } while (0)
-#define spin_unlock_irq(lock) \
-  do { spin_unlock(lock); local_irq_enable(); } while (0)
-#define spin_unlock_bh(lock) \
-  do { spin_unlock(lock); local_bh_enable(); } while (0)
-
-#define read_unlock_irqrestore(lock, flags) \
-  do { read_unlock(lock); local_irq_restore(flags); } while (0)
-#define read_unlock_irq(lock) \
-  do { read_unlock(lock); local_irq_enable(); } while (0)
-#define read_unlock_bh(lock) \
-  do { read_unlock(lock); local_bh_enable(); } while (0)
-
-#define write_unlock_irqrestore(lock, flags) \
-  do { write_unlock(lock); local_irq_restore(flags); } while (0)
-#define write_unlock_irq(lock) \
-  do { write_unlock(lock); local_irq_enable(); } while (0)
-#define write_unlock_bh(lock) \
-  do { write_unlock(lock); local_bh_enable(); } while (0)
-
-#ifndef __SMP__
-
-/*
- * Your basic spinlocks, allowing only a single CPU anywhere
- *
- * Gcc-2.7.x has a nasty bug with empty initializers.
- */
-#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-  typedef struct { } spinlock_t;
-  #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
-#else
-  typedef struct { int gcc_is_buggy; } spinlock_t;
-  #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
-#endif
-
-#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
- * but only one writer.
- *
- * NOTE! it is quite common to have readers in interrupts
- * but no interrupt writers. For those circumstances we
- * can "mix" irq-safe locks - any writer needs to get a
- * irq-safe write-lock, but readers can get non-irqsafe
- * read-locks.
- *
- * Gcc-2.7.x has a nasty bug with empty initializers.
- */
-#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-  typedef struct { } rwlock_t;
-  #define RW_LOCK_UNLOCKED (rwlock_t) { }
-#else
-  typedef struct { int gcc_is_buggy; } rwlock_t;
-  #define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
-#endif
-
-#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__ */
-
 #include <linux/kernel.h>
 #include <asm/current.h>
 
@@ -264,5 +167,4 @@
 	: "m" (__dummy_lock(lock)));
 }
 
-#endif /* SMP */
 #endif /* _ALPHA_SPINLOCK_H */

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