aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-02-20 19:33:08 -0800
committerH. Peter Anvin <hpa@zytor.com>2019-02-20 19:33:08 -0800
commit090ba3a2aa9bc3f6b5491b09f51b76836c014fee (patch)
tree026c35abf4a31b90ba7a2ae0e18f4fd974539593
parent87a6dff094a32ff477404bfea42d9e8b02ad8176 (diff)
downloadsyslinux-090ba3a2aa9bc3f6b5491b09f51b76836c014fee.tar.gz
syslinux-090ba3a2aa9bc3f6b5491b09f51b76836c014fee.tar.xz
syslinux-090ba3a2aa9bc3f6b5491b09f51b76836c014fee.zip
cpu_has_eflag(): mark output registers as earlyclobbers
We assign values to the output registers before the input operand is used, so we have to use =&r to make sure the input operand isn't clobbered. Note: "ri" is correct; it cannot safely be a memory operand, because the stack pointer isn't where the compiler would expect it to be. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/include/x86/cpu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/include/x86/cpu.h b/com32/include/x86/cpu.h
index 5537da66..4bbcc802 100644
--- a/com32/include/x86/cpu.h
+++ b/com32/include/x86/cpu.h
@@ -25,7 +25,7 @@ static inline __constfunc bool cpu_has_eflag(unsigned long flag)
"pushf ; "
"pop %1 ; "
"popf"
- : "=r" (f1), "=r" (f2) : "ri" (flag));
+ : "=&r" (f1), "=&r" (f2) : "ri" (flag));
return !!((f1 ^ f2) & flag);
}