diff options
author | Ben Skeggs <[email protected]> | 2008-07-23 14:05:22 +1000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2008-07-23 14:05:22 +1000 |
commit | 704dca40c4e0e983c07d84c3a32f8f9dc78a5543 (patch) | |
tree | bdcc585315d88274ec795b7206a143d562f54a76 /src/mesa/x86/common_x86.c | |
parent | 0c25ac52425e6d6eb037b99ab90f41b47e3f4491 (diff) | |
parent | 7f3d6e74817e8880a0712c85f2b41fd88cf6a347 (diff) |
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/mesa/x86/common_x86.c')
-rw-r--r-- | src/mesa/x86/common_x86.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index 0b2af0a3706..0caa36a5a0c 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -42,6 +42,11 @@ #include <sys/types.h> #include <sys/sysctl.h> #endif +#if defined(USE_SSE_ASM) && defined(__OpenBSD__) +#include <sys/param.h> +#include <sys/sysctl.h> +#include <machine/cpu.h> +#endif #include "common_x86_asm.h" #include "imports.h" @@ -113,6 +118,27 @@ static void check_os_sse_support( void ) if (ret || !enabled) _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); } +#elif defined (__NetBSD__) + { + int ret, enabled; + size_t len = sizeof(enabled); + ret = sysctlbyname("machdep.sse", &enabled, &len, (void *)NULL, 0); + if (ret || !enabled) + _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); + } +#elif defined(__OpenBSD__) + { + int mib[2]; + int ret, enabled; + size_t len = sizeof(enabled); + + mib[0] = CTL_MACHDEP; + mib[1] = CPU_SSE; + + ret = sysctl(mib, 2, &enabled, &len, NULL, 0); + if (ret || !enabled) + _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); + } #elif defined(WIN32) LPTOP_LEVEL_EXCEPTION_FILTER oldFilter; |