aboutsummaryrefslogtreecommitdiff
path: root/include/asm-x86/irqflags.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/irqflags.h')
-rw-r--r--include/asm-x86/irqflags.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-x86/irqflags.h b/include/asm-x86/irqflags.h
index 424acb48cd6..f57f2fb6c9e 100644
--- a/include/asm-x86/irqflags.h
+++ b/include/asm-x86/irqflags.h
@@ -12,9 +12,15 @@ static inline unsigned long native_save_fl(void)
{
unsigned long flags;
+ /*
+ * Note: this needs to be "=r" not "=rm", because we have the
+ * stack offset from what gcc expects at the time the "pop" is
+ * executed, and so a memory reference with respect to the stack
+ * would end up using the wrong address.
+ */
asm volatile("# __raw_save_flags\n\t"
"pushf ; pop %0"
- : "=g" (flags)
+ : "=r" (flags)
: /* no input */
: "memory");