From 2943e43955dfa2b39e8765433bb93e7a771043d8 Mon Sep 17 00:00:00 2001 From: Binbin Wu Date: Wed, 11 Apr 2018 17:00:05 +0800 Subject: [PATCH] mmu: add cflush api Signed-off-by: Binbin Wu Reviewed-by: Jason Chen CJ Acked-by: Kevin Tian --- include/arch/x86/mmu.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/arch/x86/mmu.h b/include/arch/x86/mmu.h index 94be437b0..4b4a63e28 100644 --- a/include/arch/x86/mmu.h +++ b/include/arch/x86/mmu.h @@ -376,6 +376,11 @@ static inline void *mmu_pt_for_pde(uint32_t *pd, uint32_t vaddr) asm volatile (" wbinvd\n" : : : "memory"); \ } +static inline void clflush(volatile void *p) +{ + asm volatile ("clflush (%0)" :: "r"(p)); +} + /* External variable declarations */ extern uint8_t CPU_Boot_Page_Tables_Start_VM[];