Skip to content

Commit

Permalink
sh: prefetch()/prefetchw() support.
Browse files Browse the repository at this point in the history
SH-2/3/4 are able to prefetch, add support for it..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Sep 27, 2006
1 parent e7be853 commit e86d6b6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/asm-sh/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit e86d6b6

Please sign in to comment.