aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/include/asm/qrwlock.h17
-rw-r--r--arch/x86/include/asm/spinlock.h4
-rw-r--r--arch/x86/include/asm/spinlock_types.h4
4 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b660088c220d..fcefdda5136d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -121,6 +121,7 @@ config X86
121 select MODULES_USE_ELF_RELA if X86_64 121 select MODULES_USE_ELF_RELA if X86_64
122 select CLONE_BACKWARDS if X86_32 122 select CLONE_BACKWARDS if X86_32
123 select ARCH_USE_BUILTIN_BSWAP 123 select ARCH_USE_BUILTIN_BSWAP
124 select ARCH_USE_QUEUE_RWLOCK
124 select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION 125 select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION
125 select OLD_SIGACTION if X86_32 126 select OLD_SIGACTION if X86_32
126 select COMPAT_OLD_SIGACTION if IA32_EMULATION 127 select COMPAT_OLD_SIGACTION if IA32_EMULATION
diff --git a/arch/x86/include/asm/qrwlock.h b/arch/x86/include/asm/qrwlock.h
new file mode 100644
index 000000000000..70f46f07f94e
--- /dev/null
+++ b/arch/x86/include/asm/qrwlock.h
@@ -0,0 +1,17 @@
1#ifndef _ASM_X86_QRWLOCK_H
2#define _ASM_X86_QRWLOCK_H
3
4#include <asm-generic/qrwlock_types.h>
5
6#if !defined(CONFIG_X86_OOSTORE) && !defined(CONFIG_X86_PPRO_FENCE)
7#define queue_write_unlock queue_write_unlock
8static inline void queue_write_unlock(struct qrwlock *lock)
9{
10 barrier();
11 ACCESS_ONCE(*(u8 *)&lock->cnts) = 0;
12}
13#endif
14
15#include <asm-generic/qrwlock.h>
16
17#endif /* _ASM_X86_QRWLOCK_H */
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index 0f62f5482d91..54f1c8068c02 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -187,6 +187,7 @@ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
187 cpu_relax(); 187 cpu_relax();
188} 188}
189 189
190#ifndef CONFIG_QUEUE_RWLOCK
190/* 191/*
191 * Read-write spinlocks, allowing multiple readers 192 * Read-write spinlocks, allowing multiple readers
192 * but only one writer. 193 * but only one writer.
@@ -269,6 +270,9 @@ static inline void arch_write_unlock(arch_rwlock_t *rw)
269 asm volatile(LOCK_PREFIX WRITE_LOCK_ADD(%1) "%0" 270 asm volatile(LOCK_PREFIX WRITE_LOCK_ADD(%1) "%0"
270 : "+m" (rw->write) : "i" (RW_LOCK_BIAS) : "memory"); 271 : "+m" (rw->write) : "i" (RW_LOCK_BIAS) : "memory");
271} 272}
273#else
274#include <asm/qrwlock.h>
275#endif /* CONFIG_QUEUE_RWLOCK */
272 276
273#define arch_read_lock_flags(lock, flags) arch_read_lock(lock) 277#define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
274#define arch_write_lock_flags(lock, flags) arch_write_lock(lock) 278#define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
diff --git a/arch/x86/include/asm/spinlock_types.h b/arch/x86/include/asm/spinlock_types.h
index 4f1bea19945b..73c4c007200f 100644
--- a/arch/x86/include/asm/spinlock_types.h
+++ b/arch/x86/include/asm/spinlock_types.h
@@ -34,6 +34,10 @@ typedef struct arch_spinlock {
34 34
35#define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } 35#define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
36 36
37#ifdef CONFIG_QUEUE_RWLOCK
38#include <asm-generic/qrwlock_types.h>
39#else
37#include <asm/rwlock.h> 40#include <asm/rwlock.h>
41#endif
38 42
39#endif /* _ASM_X86_SPINLOCK_TYPES_H */ 43#endif /* _ASM_X86_SPINLOCK_TYPES_H */