Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ab483570a13be2a34c0502b166df8f8b26802103
Commit:     ab483570a13be2a34c0502b166df8f8b26802103
Parent:     124d395fd05efb65d00ca23c7bcc86c272bd8813
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 20:35:04 2007 +0200
Committer:  Thomas Gleixner <[EMAIL PROTECTED]>
CommitDate: Fri Oct 19 20:35:04 2007 +0200

    x86 & generic: change to __builtin_prefetch()
    
    gcc 3.2+ supports __builtin_prefetch, so it's possible to use it on all
    architectures. Change the generic fallback in linux/prefetch.h to use it
    instead of noping it out. gcc should do the right thing when the
    architecture doesn't support prefetching
    
    Undefine the x86-64 inline assembler version and use the fallback.
    
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 include/asm-x86/processor_64.h |    6 ------
 include/linux/prefetch.h       |    9 ++-------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/include/asm-x86/processor_64.h b/include/asm-x86/processor_64.h
index f422bec..398c391 100644
--- a/include/asm-x86/processor_64.h
+++ b/include/asm-x86/processor_64.h
@@ -390,12 +390,6 @@ static inline void sync_core(void)
        asm volatile("cpuid" : "=a" (tmp) : "0" (1) : 
"ebx","ecx","edx","memory");
 } 
 
-#define ARCH_HAS_PREFETCH
-static inline void prefetch(void *x) 
-{ 
-       asm volatile("prefetcht0 (%0)" :: "r" (x));
-} 
-
 #define ARCH_HAS_PREFETCHW 1
 static inline void prefetchw(void *x) 
 { 
diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h
index 1adfe66..af7c36a 100644
--- a/include/linux/prefetch.h
+++ b/include/linux/prefetch.h
@@ -34,17 +34,12 @@
        
 */
 
-/*
- *     These cannot be do{}while(0) macros. See the mental gymnastics in
- *     the loop macro.
- */
- 
 #ifndef ARCH_HAS_PREFETCH
-static inline void prefetch(const void *x) {;}
+#define prefetch(x) __builtin_prefetch(x)
 #endif
 
 #ifndef ARCH_HAS_PREFETCHW
-static inline void prefetchw(const void *x) {;}
+#define prefetchw(x) __builtin_prefetch(x,1)
 #endif
 
 #ifndef ARCH_HAS_SPINLOCK_PREFETCH
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to