x86_64 only saves ebx, not rbx. Fix some potential compilation problem on amd64.

Patch by Zuxy Meng


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18535 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
gpoirier 2006-05-17 20:15:02 +00:00
parent 9614f96612
commit fb1abd6b3b
1 changed files with 9 additions and 1 deletions

View File

@ -43,9 +43,17 @@ static cpuid_regs_t
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;