aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-17 12:04:37 -0400
committerThomas Gleixner <tglx@inhelltoy.tec.linutronix.de>2007-10-17 14:16:12 -0400
commit6619a8fb594486363783cc4a8372e4d4ee4b913e (patch)
tree83130702b16dae3ccae5be54acd18993474ff757 /include/asm-x86
parent9689ba8ad0dc27c0a2ce40eb4c0f8fb66551119c (diff)
x86: Create clflush() inline, remove hardcoded wbinvd
Create an inline function for clflush(), with the proper arguments, and use it instead of hard-coding the instruction. This also removes one instance of hard-coded wbinvd, based on a patch by Bauder de Oliveira Costa. [ tglx: arch/x86 adaptation ] Cc: Andi Kleen <andi@firstfloor.org> Cc: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86')
-rw-r--r--include/asm-x86/system_32.h4
-rw-r--r--include/asm-x86/system_64.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h
index 1d6fb3afa533..db6283eb5e46 100644
--- a/include/asm-x86/system_32.h
+++ b/include/asm-x86/system_32.h
@@ -161,6 +161,10 @@ static inline void native_wbinvd(void)
161 asm volatile("wbinvd": : :"memory"); 161 asm volatile("wbinvd": : :"memory");
162} 162}
163 163
164static inline void clflush(volatile void *__p)
165{
166 asm volatile("clflush %0" : "+m" (*(char __force *)__p));
167}
164 168
165#ifdef CONFIG_PARAVIRT 169#ifdef CONFIG_PARAVIRT
166#include <asm/paravirt.h> 170#include <asm/paravirt.h>
diff --git a/include/asm-x86/system_64.h b/include/asm-x86/system_64.h
index fb4bcf99e665..ec4c29bcfcb0 100644
--- a/include/asm-x86/system_64.h
+++ b/include/asm-x86/system_64.h
@@ -137,6 +137,11 @@ static inline void write_cr8(unsigned long val)
137 137
138#endif /* __KERNEL__ */ 138#endif /* __KERNEL__ */
139 139
140static inline void clflush(volatile void *__p)
141{
142 asm volatile("clflush %0" : "+m" (*(char __force *)__p));
143}
144
140#define nop() __asm__ __volatile__ ("nop") 145#define nop() __asm__ __volatile__ ("nop")
141 146
142#ifdef CONFIG_SMP 147#ifdef CONFIG_SMP