summaryrefslogtreecommitdiffstats
path: root/sys/x86/include/specialreg.h
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2013-07-28 17:54:42 +0000
committeravg <avg@FreeBSD.org>2013-07-28 17:54:42 +0000
commit425573ccba3b555a3407c9958714a764b5e7b609 (patch)
tree4420aa26daa238558c6bb6511af95c82d7427921 /sys/x86/include/specialreg.h
parent0b4cdd16b015a683fe1fd725702e6f20e9a87dda (diff)
downloadFreeBSD-src-425573ccba3b555a3407c9958714a764b5e7b609.zip
FreeBSD-src-425573ccba3b555a3407c9958714a764b5e7b609.tar.gz
x86: detect mwait capabilities and extensions, when present
Reviewed by: kib (earlier amd64-only version) MFC after: 2 weeks
Diffstat (limited to 'sys/x86/include/specialreg.h')
-rw-r--r--sys/x86/include/specialreg.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h
index bf1333f..4247ee2 100644
--- a/sys/x86/include/specialreg.h
+++ b/sys/x86/include/specialreg.h
@@ -240,6 +240,29 @@
#define CPUID_LOCAL_APIC_ID 0xff000000
/*
+ * CPUID instruction 5 info
+ */
+#define CPUID5_MON_MIN_SIZE 0x0000ffff /* eax */
+#define CPUID5_MON_MAX_SIZE 0x0000ffff /* ebx */
+#define CPUID5_MON_MWAIT_EXT 0x00000001 /* ecx */
+#define CPUID5_MWAIT_INTRBREAK 0x00000002 /* ecx */
+
+/*
+ * MWAIT cpu power states. Lower 4 bits are sub-states.
+ */
+#define MWAIT_C0 0xf0
+#define MWAIT_C1 0x00
+#define MWAIT_C2 0x10
+#define MWAIT_C3 0x20
+#define MWAIT_C4 0x30
+
+/*
+ * MWAIT extensions.
+ */
+/* Interrupt breaks MWAIT even when masked. */
+#define MWAIT_INTRBREAK 0x00000001
+
+/*
* CPUID instruction 6 ecx info
*/
#define CPUID_PERF_STAT 0x00000001
OpenPOWER on IntegriCloud