diff options
Diffstat (limited to 'Source/Core/Common/Src/CPUDetect.cpp')
| -rw-r--r-- | Source/Core/Common/Src/CPUDetect.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/Core/Common/Src/CPUDetect.cpp b/Source/Core/Common/Src/CPUDetect.cpp index bbcee7c9eb..f15b1adba7 100644 --- a/Source/Core/Common/Src/CPUDetect.cpp +++ b/Source/Core/Common/Src/CPUDetect.cpp @@ -23,24 +23,23 @@ //#include <config/i386/cpuid.h>
#include <xmmintrin.h>
-// if you are on linux and this doesn't build, plz fix :)
static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
- #ifdef __linux__
+ #ifdef _LP64
__asm__("cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx));
- #else - // Note: EBX is reserved on Mac OS X, so it has to be restored at the end - // of the asm block.
+ #else
+ // Note: EBX is reserved on Mac OS X and in PIC on Linux, so it has to be
+ // restored at the end of the asm block.
__asm__(
- "pushl %%ebx;" - "cpuid;" - "movl %%ebx,%1;" - "popl %%ebx;" + "pushl %%ebx;"
+ "cpuid;"
+ "movl %%ebx,%1;"
+ "popl %%ebx;"
: "=a" (*eax),
"=r" (*ebx),
"=c" (*ecx),
|
