]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Add an mfence macro
authorSimon Glass <sjg@chromium.org>
Wed, 29 Apr 2015 02:25:14 +0000 (20:25 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:35:17 +0000 (22:35 +0200)
Provide access to this x86 instruction from C code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/include/asm/cpu.h

index c8392915f1dbe87ce741946970682334281d1c85..08284ee29530c46a3d33ed52956b4f661113de01 100644 (file)
@@ -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
  *