summaryrefslogtreecommitdiff
path: root/sys/arch/x86/include
diff options
context:
space:
mode:
authordsl <dsl@NetBSD.org>2014-02-23 12:56:40 +0000
committerdsl <dsl@NetBSD.org>2014-02-23 12:56:40 +0000
commit2dfd01904dd1c6ab754dc2e88be3a1fa3feaa2b2 (patch)
treedb753ff7863a0ca1eca8a57c63e5836d337605c0 /sys/arch/x86/include
parenta682083b2a7e09e019a1a3457914177a6b45cf91 (diff)
Determine whether the cpu supports xsave (and hence AVX).
The result is only written to sysctl nodes at the moment. I see: machdep.fpu_save = 3 (implies xsaveopt) machdep.xsave_size = 832 machdep.xsave_features = 7 Completely common up the i386 and amd64 machdep sysctl creation.
Diffstat (limited to 'sys/arch/x86/include')
-rw-r--r--sys/arch/x86/include/cpu.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/x86/include/cpu.h b/sys/arch/x86/include/cpu.h
index fadec2bf3fc..48a6b752fdc 100644
--- a/sys/arch/x86/include/cpu.h
+++ b/sys/arch/x86/include/cpu.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.64 2014/02/22 17:48:08 dsl Exp $ */
+/* $NetBSD: cpu.h,v 1.65 2014/02/23 12:56:40 dsl Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -382,6 +382,14 @@ extern int i386_has_sse2;
#define i386_has_sse2 1
#endif
+extern int x86_fpu_save;
+#define FPU_SAVE_FSAVE 0
+#define FPU_SAVE_FXSAVE 1
+#define FPU_SAVE_XSAVE 2
+#define FPU_SAVE_XSAVEOPT 3
+extern unsigned int x86_xsave_size;
+extern uint64_t x86_xsave_features;
+
extern void (*x86_cpu_idle)(void);
#define cpu_idle() (*x86_cpu_idle)()