Browse Source

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>
Simon Glass 8 years ago
parent
commit
35233da98a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      arch/x86/cpu/interrupts.c

+ 4 - 1
arch/x86/cpu/interrupts.c

@@ -238,8 +238,11 @@ int disable_interrupts(void)
 {
 {
 	long flags;
 	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) : );
 	asm volatile ("pushfl ; popl %0 ; cli\n" : "=g" (flags) : );
-
+#endif
 	return flags & X86_EFLAGS_IF;
 	return flags & X86_EFLAGS_IF;
 }
 }