*/
/* XXX these includes should probably go into imports.h or glheader.h */
-#if defined(USE_SSE_ASM) && defined(__linux__)
-#include <linux/version.h>
-#endif
#if defined(USE_SSE_ASM) && defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
-#if defined(USE_SSE_ASM) && defined(__OpenBSD__)
+#if defined(USE_SSE_ASM) && (defined(__OpenBSD__) || defined(__NetBSD__))
#include <sys/param.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
#endif
#endif
-#include "main/imports.h"
+#include <stdlib.h>
+
+#include "main/errors.h"
+
#include "common_x86_asm.h"
/* No reason for this to be public.
*/
-extern GLuint _ASMAPI _mesa_x86_has_cpuid(void);
-extern void _ASMAPI _mesa_x86_cpuid(GLuint op, GLuint *reg_eax, GLuint *reg_ebx, GLuint *reg_ecx, GLuint *reg_edx);
-extern GLuint _ASMAPI _mesa_x86_cpuid_eax(GLuint op);
-extern GLuint _ASMAPI _mesa_x86_cpuid_ebx(GLuint op);
-extern GLuint _ASMAPI _mesa_x86_cpuid_ecx(GLuint op);
-extern GLuint _ASMAPI _mesa_x86_cpuid_edx(GLuint op);
+extern GLuint _mesa_x86_has_cpuid(void);
+extern void _mesa_x86_cpuid(GLuint op, GLuint *reg_eax, GLuint *reg_ebx, GLuint *reg_ecx, GLuint *reg_edx);
+extern GLuint _mesa_x86_cpuid_eax(GLuint op);
+extern GLuint _mesa_x86_cpuid_ebx(GLuint op);
+extern GLuint _mesa_x86_cpuid_ecx(GLuint op);
+extern GLuint _mesa_x86_cpuid_edx(GLuint op);
#if defined(USE_SSE_ASM)
}
#elif defined(_WIN32)
LPTOP_LEVEL_EXCEPTION_FILTER oldFilter;
-
+
/* Install our ExceptionFilter */
oldFilter = SetUnhandledExceptionFilter( ExceptionFilter );
-
+
if ( cpu_has_xmm ) {
_mesa_debug(NULL, "Testing OS support for SSE...\n");
#elif defined(USE_X86_64_ASM)
{
- unsigned int uninitialized_var(eax), uninitialized_var(ebx),
- uninitialized_var(ecx), uninitialized_var(edx);
+ unsigned int eax, ebx, ecx, edx;
/* Always available on x86-64. */
_mesa_x86_cpu_features |= X86_FEATURE_XMM | X86_FEATURE_XMM2;
- __get_cpuid(1, &eax, &ebx, &ecx, &edx);
+ if (!__get_cpuid(1, &eax, &ebx, &ecx, &edx))
+ return;
if (ecx & bit_SSE4_1)
_mesa_x86_cpu_features |= X86_FEATURE_SSE4_1;