diff options
author | Will Deacon <will.deacon@arm.com> | 2013-06-26 20:03:40 +0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-09-30 19:42:55 +0400 |
commit | d8f57aa4bc5860df68d4c332d2a89c131417ee7b (patch) | |
tree | b7df2d2846e07ca6410cf7c9e652b36fee043330 /arch/arm | |
parent | 27a84793e42084392181ef2ef51a954f1cf0c519 (diff) | |
download | linux-d8f57aa4bc5860df68d4c332d2a89c131417ee7b.tar.xz |
ARM: prefetch: add support for prefetchw using pldw on SMP ARMv7+ CPUs
SMP ARMv7 CPUs implement the pldw instruction, which allows them to
prefetch data cachelines in an exclusive state.
This patch defines the prefetchw macro using pldw for CPUs that support
it.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/processor.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index 26164c92fa30..c3d5fc124a05 100644 --- a/arch/arm/include/asm/processor.h +++ b/arch/arm/include/asm/processor.h @@ -112,12 +112,19 @@ static inline void prefetch(const void *ptr) :: "p" (ptr)); } +#if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP) #define ARCH_HAS_PREFETCHW -#define prefetchw(ptr) prefetch(ptr) - -#define ARCH_HAS_SPINLOCK_PREFETCH -#define spin_lock_prefetch(x) do { } while (0) - +static inline void prefetchw(const void *ptr) +{ + __asm__ __volatile__( + ".arch_extension mp\n" + __ALT_SMP_ASM( + WASM(pldw) "\t%a0", + WASM(pld) "\t%a0" + ) + :: "p" (ptr)); +} +#endif #endif #define HAVE_ARCH_PICK_MMAP_LAYOUT |