From: Simon Glass Date: Tue, 28 Apr 2015 20:25:14 -0600 Subject: [U-Boot] [PATCH v2 12/20] x86: Add an mfence macro In-Reply-To: <1430274322-14383-1-git-send-email-sjg@chromium.org> References: <1430274322-14383-1-git-send-email-sjg@chromium.org> Message-ID: <1430274322-14383-13-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Provide access to this x86 instruction from C code. Signed-off-by: Simon Glass --- Changes in v2: - Remove unnecessary \t\n after mfence assembler instruction arch/x86/include/asm/cpu.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h index c839291..08284ee 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 * -- 2.2.0.rc0.207.ga3a616c