aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-09-25 21:33:23 -0600
committerBin Meng <bmeng.cn@gmail.com>2016-10-11 11:55:33 +0800
commit35233da98a53eb95a28d16d3fd836801b84015a9 (patch)
treef67e365c9db0568a988b77272c73e9041d06bfbf /arch
parentb11e2984401ff8a4f53d6d4c6363af4c9a4ec336 (diff)
downloadu-boot-35233da98a53eb95a28d16d3fd836801b84015a9.zip
u-boot-35233da98a53eb95a28d16d3fd836801b84015a9.tar.gz
u-boot-35233da98a53eb95a28d16d3fd836801b84015a9.tar.bz2
x86: Allow interrupts to be disabled in 64-bit mode
Update the code to support both 32-bit and 64-bit modes. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/cpu/interrupts.c5
1 files changed, 4 insertions, 1 deletions
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;
}