aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/spinlock.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 5162f8cd18c0..a30ef6999d66 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -28,8 +28,6 @@
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)
32
33#ifdef CONFIG_PPC64 31#ifdef CONFIG_PPC64
34/* use 0x800000yy when locked, where yy == CPU number */ 32/* use 0x800000yy when locked, where yy == CPU number */
35#ifdef __BIG_ENDIAN__ 33#ifdef __BIG_ENDIAN__
@@ -59,6 +57,11 @@ static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
59 return lock.slock == 0; 57 return lock.slock == 0;
60} 58}
61 59
60static inline int arch_spin_is_locked(arch_spinlock_t *lock)
61{
62 return !arch_spin_value_unlocked(*lock);
63}
64
62/* 65/*
63 * This returns the old value in the lock, so we succeeded 66 * This returns the old value in the lock, so we succeeded
64 * in getting the lock if the return value is 0. 67 * in getting the lock if the return value is 0.