summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/specialreg.h
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2008-10-22 00:01:53 +0000
committerjkim <jkim@FreeBSD.org>2008-10-22 00:01:53 +0000
commitd0d7e3dcb3b0125c2346eaf5119af0811c1f8ff8 (patch)
treeb30add38ed594f926fbd84ed2fb7f1f455d6c459 /sys/amd64/include/specialreg.h
parentbd659883761ce8d4c859d2311add4ec776cb04fe (diff)
downloadFreeBSD-src-d0d7e3dcb3b0125c2346eaf5119af0811c1f8ff8.zip
FreeBSD-src-d0d7e3dcb3b0125c2346eaf5119af0811c1f8ff8.tar.gz
Set kern.timecounter.invariant_tsc to 1 for AMD CPU family 10h and higher
even if BIOS does not advertise it.
Diffstat (limited to 'sys/amd64/include/specialreg.h')
-rw-r--r--sys/amd64/include/specialreg.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/amd64/include/specialreg.h b/sys/amd64/include/specialreg.h
index d5b7c55..46058d8 100644
--- a/sys/amd64/include/specialreg.h
+++ b/sys/amd64/include/specialreg.h
@@ -153,6 +153,23 @@
#define AMDID2_PREFETCH 0x00000100
/*
+ * CPUID instruction 1 eax info
+ */
+#define CPUID_STEPPING 0x0000000f
+#define CPUID_MODEL 0x000000f0
+#define CPUID_FAMILY 0x00000f00
+#define CPUID_EXT_MODEL 0x000f0000
+#define CPUID_EXT_FAMILY 0x0ff00000
+#define AMD64_CPU_MODEL(id) \
+ ((((id) & CPUID_MODEL) >> 4) | \
+ ((((id) & CPUID_FAMILY) >= 0x600) ? \
+ (((id) & CPUID_EXT_MODEL) >> 12) : 0))
+#define AMD64_CPU_FAMILY(id) \
+ ((((id) & CPUID_FAMILY) >> 8) + \
+ ((((id) & CPUID_FAMILY) == 0xf00) ? \
+ (((id) & CPUID_EXT_FAMILY) >> 20) : 0))
+
+/*
* CPUID instruction 1 ebx info
*/
#define CPUID_BRAND_INDEX 0x000000ff
OpenPOWER on IntegriCloud