summaryrefslogtreecommitdiff
path: root/src/cpu/x86/mtrr
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/x86/mtrr')
-rw-r--r--src/cpu/x86/mtrr/mtrr.c6
-rw-r--r--src/cpu/x86/mtrr/xip_cache.c3
2 files changed, 2 insertions, 7 deletions
diff --git a/src/cpu/x86/mtrr/mtrr.c b/src/cpu/x86/mtrr/mtrr.c
index 185014e716..84d844a066 100644
--- a/src/cpu/x86/mtrr/mtrr.c
+++ b/src/cpu/x86/mtrr/mtrr.c
@@ -41,11 +41,7 @@ static int total_mtrrs;
static void detect_var_mtrrs(void)
{
- msr_t msr;
-
- msr = rdmsr(MTRR_CAP_MSR);
-
- total_mtrrs = msr.lo & 0xff;
+ total_mtrrs = get_var_mtrr_count();
if (total_mtrrs > NUM_MTRR_STATIC_STORAGE) {
printk(BIOS_WARNING,
diff --git a/src/cpu/x86/mtrr/xip_cache.c b/src/cpu/x86/mtrr/xip_cache.c
index cd82e4fc71..6ed96af95f 100644
--- a/src/cpu/x86/mtrr/xip_cache.c
+++ b/src/cpu/x86/mtrr/xip_cache.c
@@ -14,8 +14,7 @@
the MTRR, no matter the caching type, are filled and not overlapping. */
static uint32_t max_cache_used(void)
{
- msr_t msr = rdmsr(MTRR_CAP_MSR);
- int i, total_mtrrs = msr.lo & MTRR_CAP_VCNT;
+ int i, total_mtrrs = get_var_mtrr_count();
uint32_t total_cache = 0;
for (i = 0; i < total_mtrrs; i++) {