ports/multimedia/mplayer/files/patch-TOOLS-cpuinfo.c
Pav Lucistnik 2668ee90d7 - Fix CPU features detection for amd64 platform
Submitted by:	Michiel Boland <michiel@boland.org>
Approved by:	maintainer
2005-05-23 08:53:53 +00:00

19 lines
568 B
C

--- TOOLS/cpuinfo.c.orig Mon Oct 11 21:26:13 2004
+++ TOOLS/cpuinfo.c Sun May 22 20:57:11 2005
@@ -40,13 +40,9 @@
cpuid(int func) {
cpuid_regs_t regs;
#define CPUID ".byte 0x0f, 0xa2; "
- asm("push %%ebx; "
- "movl %4,%%eax; " CPUID
- "movl %%eax,%0; movl %%ebx,%1; movl %%ecx,%2; movl %%edx,%3; "
- "pop %%ebx"
- : "=m" (regs.eax), "=m" (regs.ebx), "=m" (regs.ecx), "=m" (regs.edx)
- : "g" (func)
- : "%eax", "%ecx", "%edx");
+ asm(CPUID
+ : "=a" (regs.eax), "=b" (regs.ebx), "=c" (regs.ecx), "=d" (regs.edx)
+ : "0" (func));
return regs;
}