summaryrefslogtreecommitdiff
path: root/src/cpu/x86
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/x86')
-rw-r--r--src/cpu/x86/mtrr/earlymtrr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cpu/x86/mtrr/earlymtrr.c b/src/cpu/x86/mtrr/earlymtrr.c
index 105f7c49df..aea8e258d4 100644
--- a/src/cpu/x86/mtrr/earlymtrr.c
+++ b/src/cpu/x86/mtrr/earlymtrr.c
@@ -117,4 +117,17 @@ static void early_mtrr_init(void)
enable_cache();
}
+static int early_mtrr_init_detected(void)
+{
+ msr_t msr;
+ /* See if MTRR's are enabled.
+ * a #RESET disables them while an #INIT
+ * preserves their state. This works
+ * on both Intel and AMD cpus, at least
+ * according to the documentation.
+ */
+ msr = rdmsr(MTRRdefType_MSR);
+ return msr.lo & 0x00000800;
+}
+
#endif /* EARLYMTRR_C */