From 8336fbc35c990f6bce0ee997acae8652cd44fd97 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Thu, 17 Jul 2008 08:16:19 -0600 Subject: [PATCH] mesa: added checks for OpenBSD --- src/mesa/x86/common_x86.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index d93241a977a..0caa36a5a0c 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -42,6 +42,11 @@ #include #include #endif +#if defined(USE_SSE_ASM) && defined(__OpenBSD__) +#include +#include +#include +#endif #include "common_x86_asm.h" #include "imports.h" @@ -121,6 +126,19 @@ static void check_os_sse_support( void ) 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; -- 2.30.2