From 1731a33e322e3760de2ffb5349923a592ebe97ac Mon Sep 17 00:00:00 2001 From: Marshall Dawson Date: Wed, 13 Dec 2017 12:04:14 -0700 Subject: include/cpu/x86: Add clflush inline function Change-Id: I74c5cc22f02302314ba010bc599051c1495a13cb Signed-off-by: Marshall Dawson Reviewed-on: https://review.coreboot.org/22848 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/include/cpu/x86/cache.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/include/cpu/x86/cache.h b/src/include/cpu/x86/cache.h index 2c8c44b531..e0a335971b 100644 --- a/src/include/cpu/x86/cache.h +++ b/src/include/cpu/x86/cache.h @@ -50,6 +50,11 @@ static inline void invd(void) asm volatile("invd" ::: "memory"); } +static inline void clflush(void *addr) +{ + asm volatile ("clflush (%0)"::"r" (addr)); +} + /* The following functions require the always_inline due to AMD * function STOP_CAR_AND_CPU that disables cache as * RAM, the cache as RAM stack can no longer be used. Called -- cgit v1.2.3