mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Cc: Glauber de Oliveira Costa <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]> Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
This commit is contained in:
parent
9689ba8ad0
commit
6619a8fb59
6 changed files with 20 additions and 10 deletions
|
|
@ -161,6 +161,10 @@ static inline void native_wbinvd(void)
|
|||
asm volatile("wbinvd": : :"memory");
|
||||
}
|
||||
|
||||
static inline void clflush(volatile void *__p)
|
||||
{
|
||||
asm volatile("clflush %0" : "+m" (*(char __force *)__p));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PARAVIRT
|
||||
#include <asm/paravirt.h>
|
||||
|
|
|
|||
|
|
@ -137,6 +137,11 @@ static inline void write_cr8(unsigned long val)
|
|||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
static inline void clflush(volatile void *__p)
|
||||
{
|
||||
asm volatile("clflush %0" : "+m" (*(char __force *)__p));
|
||||
}
|
||||
|
||||
#define nop() __asm__ __volatile__ ("nop")
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
|
|
|||
Loading…
Reference in a new issue