From 2457c453c5695d35ace78e99e1f8e77a961e46b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 1 Feb 2006 12:39:20 +0000 Subject: [PATCH] * Now calls get_current_cpuid() instead of get_cpuid() - that doesn't work on SMP machines since we're already in a call_all_cpus() function (that also needs to run synchronously). MTRR does now work on SMP machines again; ie. SMP machines should boot fine again now. * Fixed warning when compiled with tracing turned on. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16181 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/cpu/x86/generic_x86.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/cpu/x86/generic_x86.cpp b/src/add-ons/kernel/cpu/x86/generic_x86.cpp index 1df3426d89..9d575ed821 100644 --- a/src/add-ons/kernel/cpu/x86/generic_x86.cpp +++ b/src/add-ons/kernel/cpu/x86/generic_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005, Haiku, Inc. + * Copyright 2005-2006, Haiku, Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -12,6 +12,9 @@ #include "amd.h" #include "via.h" +#include +#include + //#define TRACE_MTRR #ifdef TRACE_MTRR @@ -44,12 +47,12 @@ uint32 generic_count_mtrrs(void) { cpuid_info cpuInfo; - if (get_cpuid(&cpuInfo, 1, 0) != B_OK + if (get_current_cpuid(&cpuInfo, 1) != B_OK || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0) return 0; mtrr_capabilities capabilities(x86_read_msr(IA32_MSR_MTRR_CAPABILITIES)); - TRACE(("cpu has %ld variable range MTRs.\n", capabilities.variable_ranges)); + TRACE(("CPU has %u variable range MTRs.\n", (uint8)capabilities.variable_ranges)); return capabilities.variable_ranges; } @@ -60,6 +63,7 @@ generic_init_mtrrs(uint32 count) // disable and clear all MTRRs // (we leave the fixed MTRRs as is) // TODO: check if the fixed MTRRs are set on all CPUs identically? + TRACE(("generic_init_mtrrs(count = %ld)\n", count)); x86_write_msr(IA32_MSR_MTRR_DEFAULT_TYPE, x86_read_msr(IA32_MSR_MTRR_DEFAULT_TYPE) & ~IA32_MTRR_ENABLE);