sh: prefetch()/prefetchw() support.
authorPaul Mundt <lethal@linux-sh.org>
Wed, 27 Sep 2006 05:20:54 +0000 (14:20 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 27 Sep 2006 05:20:54 +0000 (14:20 +0900)
SH-2/3/4 are able to prefetch, add support for it..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
include/asm-sh/processor.h

index eeb0f48bb99ead4f5b8d71d92d22df7f7a1d0fbb..e99aff706cf7d5736379e6f284a36515a063ae43 100644 (file)
@@ -266,5 +266,18 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define cpu_sleep()    __asm__ __volatile__ ("sleep" : : : "memory")
 #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 /* __ASM_SH_PROCESSOR_H */