From 1283fc6e4287e42fdc0e69e2af52f96017565dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 24 May 2006 10:18:49 +0000 Subject: [PATCH] No longer call init_mtrrs() if there are no MTRRs, also made generic_init_mtrrs() no longer try to access any MSRs when there are no MTRRs. Got it? :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17574 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/cpu/x86/generic_x86.cpp | 3 +++ src/system/kernel/arch/x86/arch_cpu.c | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/add-ons/kernel/cpu/x86/generic_x86.cpp b/src/add-ons/kernel/cpu/x86/generic_x86.cpp index 53d1355ee7..11bb1038fc 100644 --- a/src/add-ons/kernel/cpu/x86/generic_x86.cpp +++ b/src/add-ons/kernel/cpu/x86/generic_x86.cpp @@ -60,6 +60,9 @@ generic_count_mtrrs(void) void generic_init_mtrrs(uint32 count) { + if (count == 0) + return; + // disable and clear all MTRRs // (we leave the fixed MTRRs as is) // TODO: check if the fixed MTRRs are set on all CPUs identically? diff --git a/src/system/kernel/arch/x86/arch_cpu.c b/src/system/kernel/arch/x86/arch_cpu.c index b4aab754f5..1ea4a96e66 100644 --- a/src/system/kernel/arch/x86/arch_cpu.c +++ b/src/system/kernel/arch/x86/arch_cpu.c @@ -358,11 +358,9 @@ arch_cpu_init_post_modules(kernel_args *args) close_module_list(cookie); - if (sCpuModule == NULL) - return B_OK; - - // initialize MTRRs - call_all_cpus(&init_mtrrs, NULL); + // initialize MTRRs if available + if (x86_count_mtrrs > 0) + call_all_cpus(&init_mtrrs, NULL); return B_OK; }