提交 d8f57aa4 编写于 作者: W Will Deacon

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: NNicolas Pitre <nico@linaro.org>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 27a84793
...@@ -112,12 +112,19 @@ static inline void prefetch(const void *ptr) ...@@ -112,12 +112,19 @@ static inline void prefetch(const void *ptr)
:: "p" (ptr)); :: "p" (ptr));
} }
#if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
#define ARCH_HAS_PREFETCHW #define ARCH_HAS_PREFETCHW
#define prefetchw(ptr) prefetch(ptr) static inline void prefetchw(const void *ptr)
{
#define ARCH_HAS_SPINLOCK_PREFETCH __asm__ __volatile__(
#define spin_lock_prefetch(x) do { } while (0) ".arch_extension mp\n"
__ALT_SMP_ASM(
WASM(pldw) "\t%a0",
WASM(pld) "\t%a0"
)
:: "p" (ptr));
}
#endif
#endif #endif
#define HAVE_ARCH_PICK_MMAP_LAYOUT #define HAVE_ARCH_PICK_MMAP_LAYOUT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册