]> mj.ucw.cz Git - libucw.git/blobdiff - lib/prefetch.h
CONFIG_INCREMENTAL doesn't belong to the free version
[libucw.git] / lib / prefetch.h
index 5c675d172229551826cdb0c8399f7dcfd28848a9..8c97906d8630f85ca4435f146483edc16aae025a 100644 (file)
@@ -1,32 +1,42 @@
 /*
- *     Sherlock Library -- Prefetch
+ *     UCW Library -- Prefetch
  *
- *     (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2005 Martin Mares <mj@ucw.cz>
  *
  *     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(__pentium4)
 
+#define HAVE_PREFETCH
 static inline void prefetch(void *addr)
 {
   asm volatile ("prefetcht0 %0" : : "m" (*(byte*)addr));
 }
 
-#else
+#elif defined(__k6)
+  /* K6 doesn't have prefetches */
+
+#elif defined(__athlon) || defined(__i686)
 
-#if !defined(__k6)
+#define HAVE_PREFETCH
+static inline void prefetch(void *addr)
+{
+  asm volatile ("prefetcht0 %0" : : "m" (*(byte*)addr));
+}
+
+#else
 #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