X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fprefetch.h;h=4c9c716b81f9016d79def776d3f875a7825b111a;hb=81653e0f25be18c124e0ef66e631ad95138cd8cf;hp=5c675d172229551826cdb0c8399f7dcfd28848a9;hpb=0de3ca79be9e5111019982280f606fc084ab846a;p=libucw.git diff --git a/lib/prefetch.h b/lib/prefetch.h index 5c675d17..4c9c716b 100644 --- a/lib/prefetch.h +++ b/lib/prefetch.h @@ -1,32 +1,36 @@ /* - * Sherlock Library -- Prefetch + * UCW Library -- Prefetch * - * (c) 1997--2003 Martin Mares + * (c) 1997--2006 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. */ -#ifndef _SHERLOCK_PREFETCH_H -#define _SHERLOCK_PREFETCH_H +#ifndef _UCW_PREFETCH_H +#define _UCW_PREFETCH_H -#if defined(__athlon) || defined(__i686) +#if defined(__k6) + /* K6 doesn't have prefetches */ +#elif defined(__athlon) || defined(__k8) || \ + defined(__i686) || \ + defined(__pentium4) || defined(__prescott) || defined(__nocona) + +#define HAVE_PREFETCH static inline void prefetch(void *addr) { asm volatile ("prefetcht0 %0" : : "m" (*(byte*)addr)); } #else - -#if !defined(__k6) #warning "Don't know how to prefetch on your CPU. Please fix lib/prefetch.h." #endif +#ifndef HAVE_PREFETCH static inline void prefetch(void *addr UNUSED) { } - #endif #endif