diff options
| author | Andrew Morton <akpm@zip.com.au> | 2002-08-13 01:04:37 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@penguin.transmeta.com> | 2002-08-13 01:04:37 -0700 |
| commit | 8e4f2fd31bf737abb392e694898a1496157623b5 (patch) | |
| tree | 66643de8e85139074409eaad0bab93b08a01c21a /include/linux/prefetch.h | |
| parent | 456f17cd1a2873b3e83cee85bcb30708037cb4e8 (diff) | |
[PATCH] fix ARCH_HAS_PREFETCH
include/linux/prefetch.h does a strange thing: if the arch doesn't have
the prefectch functions, this header defines no-op version of them and
then defines ARCH_HAS_PREFETCH. So there's no way for mainline code to
know if the architecture *really* has prefetch instructions.
This information loss is unfortunate. Examples:
for (i = 0; i < N; i++)
prefetch(foo[i]);
Problem is, if `prefetch' is a no-op, the compiler will still
generate an empty busy-wait loop. Which it must do. We need to
know the truth about ARCH_HAS_PREFETCH to correctly elide that loop.
Diffstat (limited to 'include/linux/prefetch.h')
| -rw-r--r-- | include/linux/prefetch.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h index 8d7d3ffeb481..73c4a344156b 100644 --- a/include/linux/prefetch.h +++ b/include/linux/prefetch.h @@ -39,17 +39,14 @@ */ #ifndef ARCH_HAS_PREFETCH -#define ARCH_HAS_PREFETCH static inline void prefetch(const void *x) {;} #endif #ifndef ARCH_HAS_PREFETCHW -#define ARCH_HAS_PREFETCHW static inline void prefetchw(const void *x) {;} #endif #ifndef ARCH_HAS_SPINLOCK_PREFETCH -#define ARCH_HAS_SPINLOCK_PREFETCH #define spin_lock_prefetch(x) prefetchw(x) #endif |
