- CPUID asm changes for x64 systems.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7100 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
a4754956cb
commit
d373258517
|
@ -36,16 +36,20 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
|
||||||
unsigned int *ecx, unsigned int *edx)
|
unsigned int *ecx, unsigned int *edx)
|
||||||
{
|
{
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
__asm__("cpuid"
|
// Note: EBX is reserved on Mac OS X and in PIC on Linux, so it has to
|
||||||
|
// restored at the end of the asm block.
|
||||||
|
__asm__(
|
||||||
|
"pushl %%rbx;"
|
||||||
|
"cpuid;"
|
||||||
|
"movl %%rbx,%1;"
|
||||||
|
"popl %%rbx;"
|
||||||
: "=a" (*eax),
|
: "=a" (*eax),
|
||||||
"=b" (*ebx),
|
"=r" (*ebx),
|
||||||
"=c" (*ecx),
|
"=c" (*ecx),
|
||||||
"=d" (*edx)
|
"=d" (*edx)
|
||||||
: "a" (*eax)
|
: "a" (*eax)
|
||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
// Note: EBX is reserved on Mac OS X and in PIC on Linux, so it has to
|
|
||||||
// restored at the end of the asm block.
|
|
||||||
__asm__(
|
__asm__(
|
||||||
"pushl %%ebx;"
|
"pushl %%ebx;"
|
||||||
"cpuid;"
|
"cpuid;"
|
||||||
|
|
Loading…
Reference in New Issue