summaryrefslogtreecommitdiff
path: root/graphics/MesaLib/patches/patch-ao
blob: 56b5197ff5be6b63615b868e3fb6733fdcd6128a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-ao,v 1.2 2008/04/30 07:00:14 bjs Exp $

--- src/mesa/x86/common_x86.c.orig	2008-04-29 15:29:20.000000000 -0400
+++ src/mesa/x86/common_x86.c
@@ -38,7 +38,7 @@
 #if defined(USE_SSE_ASM) && defined(__linux__)
 #include <linux/version.h>
 #endif
-#if defined(USE_SSE_ASM) && (defined(__FreeBSD__) || defined(__DragonFly__))
+#if defined(USE_SSE_ASM) && defined(USE_SSE_SYSCTL_DETECTION)
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #endif
@@ -113,6 +113,14 @@ 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(WIN32)
    LPTOP_LEVEL_EXCEPTION_FILTER oldFilter;