Commit 8b13d89a authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

[PATCH] GCC 2.95.4 needs the spinlock workaround

From: Mikael Pettersson <mikpe@csd.uu.se>

2.5.73 removed the workaround needed to prevent gcc-2.95.x from
miscompiling spinlocks on UP.  It turns out that some versions of
gcc-2.95 still do have problems with empty structs, so re-introduce
the workaround.
parent 92ce78fd
......@@ -146,8 +146,13 @@ typedef struct {
/*
* gcc versions before ~2.95 have a nasty bug with empty initializers.
*/
typedef struct { } spinlock_t;
#define SPIN_LOCK_UNLOCKED (spinlock_t) { }
#if (__GNUC__ > 2)
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
/*
* If CONFIG_SMP is unset, declare the _raw_* definitions as nops
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment