diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2011-08-27 20:42:11 +0200 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@gmail.com> | 2011-08-27 20:42:11 +0200 |
| commit | 06e640532aa093902e81f09aa18de1b084fcc5ce (patch) | |
| tree | c9c375c37e5adecfb7e2dd7b53f2aa5e049aebf2 /Source/Core/Common/Src/CPUDetect.cpp | |
| parent | c0dd84cf7d0410d5f247f8641208f43fabe8c420 (diff) | |
Various changes which improve FreeBSD support.
Patches by martymac, all credits go to him ;)
Diffstat (limited to 'Source/Core/Common/Src/CPUDetect.cpp')
| -rw-r--r-- | Source/Core/Common/Src/CPUDetect.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/CPUDetect.cpp b/Source/Core/Common/Src/CPUDetect.cpp index 810c5d2a59..7c231b0a69 100644 --- a/Source/Core/Common/Src/CPUDetect.cpp +++ b/Source/Core/Common/Src/CPUDetect.cpp @@ -32,6 +32,10 @@ //#include <config/i386/cpuid.h> #include <xmmintrin.h> +#if defined __FreeBSD__ +#include <sys/types.h> +#include <machine/cpufunc.h> +#else static inline void do_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { @@ -65,15 +69,20 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx, ); #endif } +#endif /* defined __FreeBSD__ */ static void __cpuid(int info[4], int x) { +#if defined __FreeBSD__ + do_cpuid((unsigned int)x, (unsigned int*)info); +#else unsigned int eax = x, ebx = 0, ecx = 0, edx = 0; do_cpuid(&eax, &ebx, &ecx, &edx); info[0] = eax; info[1] = ebx; info[2] = ecx; info[3] = edx; +#endif } #endif |
