diff options
-rw-r--r-- | arch/powerpc/Kconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/cmpxchg.h | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/spinlock.h | 5 |
3 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index fa395179ddd6..6ca5d5cabeb1 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -139,6 +139,7 @@ config PPC | |||
139 | select OLD_SIGACTION if PPC32 | 139 | select OLD_SIGACTION if PPC32 |
140 | select HAVE_DEBUG_STACKOVERFLOW | 140 | select HAVE_DEBUG_STACKOVERFLOW |
141 | select HAVE_IRQ_EXIT_ON_IRQ_STACK | 141 | select HAVE_IRQ_EXIT_ON_IRQ_STACK |
142 | select ARCH_USE_CMPXCHG_LOCKREF if PPC64 | ||
142 | 143 | ||
143 | config GENERIC_CSUM | 144 | config GENERIC_CSUM |
144 | def_bool CPU_LITTLE_ENDIAN | 145 | def_bool CPU_LITTLE_ENDIAN |
diff --git a/arch/powerpc/include/asm/cmpxchg.h b/arch/powerpc/include/asm/cmpxchg.h index e245aab7f191..d463c68fe7f0 100644 --- a/arch/powerpc/include/asm/cmpxchg.h +++ b/arch/powerpc/include/asm/cmpxchg.h | |||
@@ -300,6 +300,7 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, | |||
300 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | 300 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ |
301 | cmpxchg_local((ptr), (o), (n)); \ | 301 | cmpxchg_local((ptr), (o), (n)); \ |
302 | }) | 302 | }) |
303 | #define cmpxchg64_relaxed cmpxchg64_local | ||
303 | #else | 304 | #else |
304 | #include <asm-generic/cmpxchg-local.h> | 305 | #include <asm-generic/cmpxchg-local.h> |
305 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | 306 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) |
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h index 5f54a744dcc5..5162f8cd18c0 100644 --- a/arch/powerpc/include/asm/spinlock.h +++ b/arch/powerpc/include/asm/spinlock.h | |||
@@ -54,6 +54,11 @@ | |||
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 | |||
57 | /* | 62 | /* |
58 | * This returns the old value in the lock, so we succeeded | 63 | * This returns the old value in the lock, so we succeeded |
59 | * in getting the lock if the return value is 0. | 64 | * in getting the lock if the return value is 0. |