diff options
| author | Jeremy Allison <jra@samba.org> | 2005-06-22 17:35:06 -0700 |
|---|---|---|
| committer | Steve French <sfrench@hera.kernel.org> | 2005-06-22 17:35:06 -0700 |
| commit | 1bdf7a78c2b21fb94dfe7994dbe89310b18479d2 (patch) | |
| tree | 7741cfd476f9c622a10c198da421fdb3e38708b9 /include/asm-sparc64/processor.h | |
| parent | ac67055ef2378ea95c34b593ddf9d0a0737a240a (diff) | |
| parent | a4936044001694f033fe4ea94d6034d51a6b465c (diff) | |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'include/asm-sparc64/processor.h')
| -rw-r--r-- | include/asm-sparc64/processor.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index bc1445b904e..d0bee241356 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h @@ -192,6 +192,40 @@ extern unsigned long get_wchan(struct task_struct *task); #define cpu_relax() barrier() +/* Prefetch support. This is tuned for UltraSPARC-III and later. + * UltraSPARC-I will treat these as nops, and UltraSPARC-II has + * a shallower prefetch queue than later chips. + */ +#define ARCH_HAS_PREFETCH +#define ARCH_HAS_PREFETCHW +#define ARCH_HAS_SPINLOCK_PREFETCH + +static inline void prefetch(const void *x) +{ + /* We do not use the read prefetch mnemonic because that + * prefetches into the prefetch-cache which only is accessible + * by floating point operations in UltraSPARC-III and later. + * By contrast, "#one_write" prefetches into the L2 cache + * in shared state. + */ + __asm__ __volatile__("prefetch [%0], #one_write" + : /* no outputs */ + : "r" (x)); +} + +static inline void prefetchw(const void *x) +{ + /* The most optimal prefetch to use for writes is + * "#n_writes". This brings the cacheline into the + * L2 cache in "owned" state. + */ + __asm__ __volatile__("prefetch [%0], #n_writes" + : /* no outputs */ + : "r" (x)); +} + +#define spin_lock_prefetch(x) prefetchw(x) + #endif /* !(__ASSEMBLY__) */ #endif /* !(__ASM_SPARC64_PROCESSOR_H) */ |
