diff options
Diffstat (limited to 'arch/powerpc/include/asm/spinlock.h')
-rw-r--r-- | arch/powerpc/include/asm/spinlock.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h index 5f54a744dcc5..35aa339410bd 100644 --- a/arch/powerpc/include/asm/spinlock.h +++ b/arch/powerpc/include/asm/spinlock.h | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <asm/synch.h> | 28 | #include <asm/synch.h> |
29 | #include <asm/ppc-opcode.h> | 29 | #include <asm/ppc-opcode.h> |
30 | 30 | ||
31 | #define arch_spin_is_locked(x) ((x)->slock != 0) | 31 | #define smp_mb__after_unlock_lock() smp_mb() /* Full ordering for lock. */ |
32 | 32 | ||
33 | #ifdef CONFIG_PPC64 | 33 | #ifdef CONFIG_PPC64 |
34 | /* use 0x800000yy when locked, where yy == CPU number */ | 34 | /* use 0x800000yy when locked, where yy == CPU number */ |
@@ -54,6 +54,16 @@ | |||
54 | #define SYNC_IO | 54 | #define SYNC_IO |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) | ||
58 | { | ||
59 | return lock.slock == 0; | ||
60 | } | ||
61 | |||
62 | static inline int arch_spin_is_locked(arch_spinlock_t *lock) | ||
63 | { | ||
64 | return !arch_spin_value_unlocked(*lock); | ||
65 | } | ||
66 | |||
57 | /* | 67 | /* |
58 | * This returns the old value in the lock, so we succeeded | 68 | * This returns the old value in the lock, so we succeeded |
59 | * in getting the lock if the return value is 0. | 69 | * in getting the lock if the return value is 0. |