summaryrefslogtreecommitdiff
path: root/src/mesa/x86
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2008-07-17 08:16:19 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-07-17 10:04:56 -0600
commit8336fbc35c990f6bce0ee997acae8652cd44fd97 (patch)
tree3743687d3185814d78d02435d75549c770313672 /src/mesa/x86
parentf610deed37dc09922eaef1c55e3d4afe8aaa7327 (diff)
mesa: added checks for OpenBSD
Diffstat (limited to 'src/mesa/x86')
-rw-r--r--src/mesa/x86/common_x86.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c
index d93241a977..0caa36a5a0 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"
@@ -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;