[U-Boot] [PATCH 20/82] x86: Allow interrupts to be disabled in 64-bit mode

Simon Glass sjg at chromium.org
Mon Sep 26 05:33:23 CEST 2016


Update the code to support both 32-bit and 64-bit modes.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/x86/cpu/interrupts.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index dd2819a..46babe0 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -238,8 +238,11 @@ int disable_interrupts(void)
 {
 	long flags;
 
+#ifdef CONFIG_X86_64
+	asm volatile ("pushfq ; popq %0 ; cli\n" : "=g" (flags) : );
+#else
 	asm volatile ("pushfl ; popl %0 ; cli\n" : "=g" (flags) : );
-
+#endif
 	return flags & X86_EFLAGS_IF;
 }
 
-- 
2.8.0.rc3.226.g39d4020



More information about the U-Boot mailing list