summaryrefslogtreecommitdiff
path: root/src/mesa/x86
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2008-07-25 18:31:44 -0700
committerIan Romanick <ian.d.romanick@intel.com>2008-07-25 18:31:44 -0700
commit1e645b365900cf1c71ca5594bd6b549a1f203040 (patch)
treed114e55df428550c9829acf929b9fb7bcb89c429 /src/mesa/x86
parente5022c3fdf9888857f22f9a1690035ff3f90d36b (diff)
parent9bc9e0ecb0fb2069b2c123e665eb2118e358098f (diff)
Merge branch 'master' into drm-gem
Conflicts: src/mesa/drivers/dri/common/dri_bufmgr.c src/mesa/drivers/dri/i965/brw_wm_surface_state.c
Diffstat (limited to 'src/mesa/x86')
-rw-r--r--src/mesa/x86/assyntax.h3
-rw-r--r--src/mesa/x86/common_x86.c26
2 files changed, 28 insertions, 1 deletions
diff --git a/src/mesa/x86/assyntax.h b/src/mesa/x86/assyntax.h
index 8eb47e41a1..524944f73a 100644
--- a/src/mesa/x86/assyntax.h
+++ b/src/mesa/x86/assyntax.h
@@ -985,7 +985,8 @@ SECTION _DATA public align=16 class=DATA use32 flat
#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \
|| (defined(__linux__) || defined(__OS2ELF__)) && defined(__ELF__) \
- || defined(__FreeBSD__) && __FreeBSD__ >= 3
+ || (defined(__FreeBSD__) && __FreeBSD__ >= 3) \
+ || (defined(__NetBSD__) && defined(__ELF__))
#define GLNAME(a) a
#else
#define GLNAME(a) CONCAT(_, a)
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c
index 0b2af0a370..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"
@@ -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;