summaryrefslogtreecommitdiffstats
path: root/include/asm-m68k/spinlock.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
commit86464aed71025541805e7b1515541aee89879e33 (patch)
treee01a457a4912a8553bc65524aa3125d51f29f810 /include/asm-m68k/spinlock.h
parent88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff)
Merge with Linux 2.2.1.
Diffstat (limited to 'include/asm-m68k/spinlock.h')
-rw-r--r--include/asm-m68k/spinlock.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/asm-m68k/spinlock.h b/include/asm-m68k/spinlock.h
index 6c049a124..1c3ace986 100644
--- a/include/asm-m68k/spinlock.h
+++ b/include/asm-m68k/spinlock.h
@@ -10,10 +10,10 @@
*/
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
typedef struct { } spinlock_t;
-#define SPIN_LOCK_UNLOCKED { }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) { }
#else
typedef struct { int gcc_is_buggy; } spinlock_t;
-#define SPIN_LOCK_UNLOCKED { 0 }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#endif
#define spin_lock_init(lock) do { } while(0)
@@ -38,9 +38,16 @@ typedef struct { int gcc_is_buggy; } spinlock_t;
* 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 { }
+#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) do { } while(0)
#define read_unlock(lock) do { } while(0)