changeset 18517:31c96e2b64b4

fix build on macintel, patch by Zuxy Meng
author gpoirier
date Mon, 15 May 2006 15:10:23 +0000
parents 9f1055791225
children eee951c68e05
files TOOLS/cpuinfo.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/TOOLS/cpuinfo.c	Mon May 15 11:30:43 2006 +0000
+++ b/TOOLS/cpuinfo.c	Mon May 15 15:10:23 2006 +0000
@@ -43,8 +43,10 @@
 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;
 }