[MPlayer-dev-eng] Re: [PATCH] Various improvement in TOOLS/cpuinfo.c

Zuxy Meng zuxy.meng at gmail.com
Mon May 15 15:30:35 CEST 2006


2006/5/15, Mohammad A. Haque <mhaque at haque.net>:
> [mhaque at batmobile main]$ gcc --version
> i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build
> 5250)
>

Hmm, how about this patch?
-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6
-------------- next part --------------
--- main/TOOLS/cpuinfo.c	2006-05-15 15:53:14.000000000 +0800
+++ main.new/TOOLS/cpuinfo.c	2006-05-15 21:26:50.000000000 +0800
@@ -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;
 }



More information about the MPlayer-dev-eng mailing list