From: Simon Glass Date: Wed, 29 Apr 2015 02:25:14 +0000 (-0600) Subject: x86: Add an mfence macro X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=837a136fc7cfb712858502a03c8d0ae91bea6e0d;p=u-boot.git x86: Add an mfence macro Provide access to this x86 instruction from C code. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h index c8392915f1..08284ee295 100644 --- a/arch/x86/include/asm/cpu.h +++ b/arch/x86/include/asm/cpu.h @@ -151,6 +151,11 @@ static inline int flag_is_changeable_p(uint32_t flag) return ((f1^f2) & flag) != 0; } +static inline void mfence(void) +{ + __asm__ __volatile__("mfence" : : : "memory"); +} + /** * cpu_enable_paging_pae() - Enable PAE-paging *