Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 1 | #ifndef SMP_SPINLOCK_H |
| 2 | #define SMP_SPINLOCK_H |
| 3 | |
Eric Biederman | 2c018fb | 2003-07-21 20:13:45 +0000 | [diff] [blame^] | 4 | #ifdef CONFIG_SMP |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 5 | #include <arch/smp/spinlock.h> |
Eric Biederman | 2c018fb | 2003-07-21 20:13:45 +0000 | [diff] [blame^] | 6 | #else /* !CONFIG_SMP */ |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 7 | |
| 8 | /* Most GCC versions have a nasty bug with empty initializers */ |
| 9 | #if (__GNUC__ > 2) |
| 10 | typedef struct { } spinlock_t; |
| 11 | #define SPIN_LOCK_UNLOCKED (spinlock_t) { } |
| 12 | #else |
| 13 | typedef struct { int gcc_is_buggy; } spinlock_t; |
| 14 | #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } |
| 15 | #endif |
| 16 | |
| 17 | #define barrier() do {} while(0) |
| 18 | #define spin_is_locked(lock) 0 |
| 19 | #define spin_unlock_wait(lock) do {} while(0) |
| 20 | #define spin_lock(lock) do {} while(0) |
| 21 | #define spin_unlock(lock) do {} while(0) |
| 22 | #endif |
| 23 | |
| 24 | #endif /* SMP_SPINLOCK_H */ |