x86: Add an mfence macro
authorSimon Glass <sjg@chromium.org>
Wed, 29 Apr 2015 02:25:14 +0000 (20:25 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 30 Apr 2015 03:02:34 +0000 (21:02 -0600)
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
  *