提交 e86d6b66 编写于 作者: P Paul Mundt

sh: prefetch()/prefetchw() support.

SH-2/3/4 are able to prefetch, add support for it..
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 e7be853d
...@@ -266,5 +266,18 @@ extern unsigned long get_wchan(struct task_struct *p); ...@@ -266,5 +266,18 @@ extern unsigned long get_wchan(struct task_struct *p);
#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
#define cpu_relax() barrier() #define cpu_relax() barrier()
#if defined(CONFIG_CPU_SH2A) || defined(CONFIG_CPU_SH3) || \
defined(CONFIG_CPU_SH4)
#define PREFETCH_STRIDE L1_CACHE_BYTES
#define ARCH_HAS_PREFETCH
#define ARCH_HAS_PREFETCHW
static inline void prefetch(void *x)
{
__asm__ __volatile__ ("pref @%0\n\t" : : "r" (x) : "memory");
}
#define prefetchw(x) prefetch(x)
#endif
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __ASM_SH_PROCESSOR_H */ #endif /* __ASM_SH_PROCESSOR_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册