[MPlayer-cvslog] CVS: main/TOOLS cpuinfo.c,1.10,1.11

Guillaume Poirier CVS syncmail at mplayerhq.hu
Wed May 17 22:15:05 CEST 2006


CVS change done by Guillaume Poirier CVS

Update of /cvsroot/mplayer/main/TOOLS
In directory mail:/var2/tmp/cvs-serv1260

Modified Files:
	cpuinfo.c 
Log Message:
x86_64 only saves ebx, not rbx. Fix some potential compilation problem on amd64.
Patch by Zuxy Meng


Index: cpuinfo.c
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/cpuinfo.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- cpuinfo.c	15 May 2006 15:10:23 -0000	1.10
+++ cpuinfo.c	17 May 2006 20:15:02 -0000	1.11
@@ -43,9 +43,17 @@
 cpuid(int func) {
   cpuid_regs_t regs;
 #define CPUID   ".byte 0x0f, 0xa2; "
+#ifdef __x86_64__
+  asm("mov %%rbx, %%rsi\n\t"
+#else
   asm("mov %%ebx, %%esi\n\t" 
+#endif
       CPUID"\n\t"
-      "xchg %%esi, %%ebx"
+#ifdef __x86_64__
+      "xchg %%rsi, %%rbx\n\t"
+#else
+      "xchg %%esi, %%ebx\n\t"
+#endif
       : "=a" (regs.eax), "=S" (regs.ebx), "=c" (regs.ecx), "=d" (regs.edx)
       : "0" (func));
   return regs;




More information about the MPlayer-cvslog mailing list