summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TOOLS/cpuinfo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/TOOLS/cpuinfo.c b/TOOLS/cpuinfo.c
index 7936a5518d..56ebe2087e 100644
--- a/TOOLS/cpuinfo.c
+++ b/TOOLS/cpuinfo.c
@@ -43,8 +43,10 @@ static cpuid_regs_t
cpuid(int func) {
cpuid_regs_t regs;
#define CPUID ".byte 0x0f, 0xa2; "
- asm( CPUID
- : "=a" (regs.eax), "=b" (regs.ebx), "=c" (regs.ecx), "=d" (regs.edx)
+ asm("mov %%ebx, %%esi\n\t"
+ CPUID"\n\t"
+ "xchg %%esi, %%ebx"
+ : "=a" (regs.eax), "=S" (regs.ebx), "=c" (regs.ecx), "=d" (regs.edx)
: "0" (func));
return regs;
}