- CPUID
restored inline assembly code git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7099 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
b1a63e3e8e
commit
a4754956cb
|
@ -35,7 +35,16 @@
|
||||||
static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
|
static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
|
||||||
unsigned int *ecx, unsigned int *edx)
|
unsigned int *ecx, unsigned int *edx)
|
||||||
{
|
{
|
||||||
// Note: EBX is reserved on Mac OS X and in PIC on Linux, so it has to be
|
#ifdef _LP64
|
||||||
|
__asm__("cpuid"
|
||||||
|
: "=a" (*eax),
|
||||||
|
"=b" (*ebx),
|
||||||
|
"=c" (*ecx),
|
||||||
|
"=d" (*edx)
|
||||||
|
: "a" (*eax)
|
||||||
|
);
|
||||||
|
#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.
|
// restored at the end of the asm block.
|
||||||
__asm__(
|
__asm__(
|
||||||
"pushl %%ebx;"
|
"pushl %%ebx;"
|
||||||
|
@ -48,6 +57,7 @@ __asm__(
|
||||||
"=d" (*edx)
|
"=d" (*edx)
|
||||||
: "a" (*eax)
|
: "a" (*eax)
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __cpuid(int info[4], int x)
|
static void __cpuid(int info[4], int x)
|
||||||
|
|
Loading…
Reference in New Issue