@@ -34,6 +34,7 @@ config ARM
select ARCH_SUPPORTS_ATOMIC_RMW
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_CMPXCHG_LOCKREF
+ select ARCH_USE_QUEUED_RWLOCKS if !CPU_V6
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
select ARCH_WANT_IPC_PARSE_VERSION
select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
@@ -18,6 +18,7 @@ generic-y += preempt.h
generic-y += seccomp.h
generic-y += serial.h
generic-y += trace_clock.h
+generic-y += qrwlock.h
generated-y += mach-types.h
generated-y += unistd-nr.h
@@ -128,6 +128,7 @@ static inline int arch_spin_is_contended(arch_spinlock_t *lock)
}
#define arch_spin_is_contended arch_spin_is_contended
+#ifdef CONFIG_CPU_V6
/*
* RWLOCKS
*
@@ -270,4 +271,11 @@ static inline int arch_read_trylock(arch_rwlock_t *rw)
}
}
+#else
+
+#include <asm/qrwlock.h>
+#define smp_mb__after_spinlock() smp_mb()
+
+#endif
+
#endif /* __ASM_SPINLOCK_H */
@@ -29,6 +29,14 @@ typedef struct {
u32 lock;
} arch_rwlock_t;
-#define __ARCH_RW_LOCK_UNLOCKED { 0 }
+#ifdef CONFIG_CPU_V6
+
+#define __ARCH_RW_LOCK_UNLOCKED { 0 }
+
+#else
+
+#include <asm-generic/qrwlock_types.h>
+
+#endif
#endif
Use the generic qrwlock implementation for rwlock. The WFE mechanism is used as part of the spinlock implementation. Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> --- arch/arm/Kconfig | 1 + arch/arm/include/asm/Kbuild | 1 + arch/arm/include/asm/spinlock.h | 8 ++++++++ arch/arm/include/asm/spinlock_types.h | 10 +++++++++- 4 files changed, 19 insertions(+), 1 deletion(-)