svn commit: r230261 - in head/sys: amd64/include i386/include

Konstantin Belousov kib at FreeBSD.org
Tue Jan 17 07:23:44 UTC 2012


Author: kib
Date: Tue Jan 17 07:23:43 2012
New Revision: 230261
URL: http://svn.freebsd.org/changeset/base/230261

Log:
  Add definitions related to XCR0.
  
  MFC after:	1 week

Modified:
  head/sys/amd64/include/specialreg.h
  head/sys/i386/include/specialreg.h

Modified: head/sys/amd64/include/specialreg.h
==============================================================================
--- head/sys/amd64/include/specialreg.h	Tue Jan 17 07:21:23 2012	(r230260)
+++ head/sys/amd64/include/specialreg.h	Tue Jan 17 07:23:43 2012	(r230261)
@@ -66,6 +66,7 @@
 #define	CR4_PCE	0x00000100	/* Performance monitoring counter enable */
 #define	CR4_FXSR 0x00000200	/* Fast FPU save/restore used by OS */
 #define	CR4_XMM	0x00000400	/* enable SIMD/MMX2 to use except 16 */
+#define	CR4_XSAVE 0x00040000	/* XSETBV/XGETBV */
 
 /*
  * Bits in AMD64 special registers.  EFER is 64 bits wide.
@@ -76,6 +77,18 @@
 #define	EFER_NXE 0x000000800	/* PTE No-Execute bit enable (R/W) */
 
 /*
+ * Intel Extended Features registers
+ */
+#define	XCR0	0		/* XFEATURE_ENABLED_MASK register */
+
+#define	XFEATURE_ENABLED_X87	0x00000001
+#define	XFEATURE_ENABLED_SSE	0x00000002
+#define	XFEATURE_ENABLED_AVX	0x00000004
+
+#define	XFEATURE_AVX					\
+    (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX)
+
+/*
  * CPUID instruction features register
  */
 #define	CPUID_FPU	0x00000001

Modified: head/sys/i386/include/specialreg.h
==============================================================================
--- head/sys/i386/include/specialreg.h	Tue Jan 17 07:21:23 2012	(r230260)
+++ head/sys/i386/include/specialreg.h	Tue Jan 17 07:23:43 2012	(r230261)
@@ -66,6 +66,7 @@
 #define	CR4_PCE	0x00000100	/* Performance monitoring counter enable */
 #define	CR4_FXSR 0x00000200	/* Fast FPU save/restore used by OS */
 #define	CR4_XMM	0x00000400	/* enable SIMD/MMX2 to use except 16 */
+#define	CR4_XSAVE 0x00040000	/* XSETBV/XGETBV */
 
 /*
  * Bits in AMD64 special registers.  EFER is 64 bits wide.


More information about the svn-src-head mailing list