From 43ecce5fda625e057724d10e087180b02d027ca0 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 26 Feb 2008 23:39:53 -0500 Subject: X86: Put in initial implementation of the local APIC. --HG-- extra : convert_revision : 1708a93d96b819e64ed456c75dbb5325ac8114a8 --- src/arch/x86/utility.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/arch/x86/utility.cc') diff --git a/src/arch/x86/utility.cc b/src/arch/x86/utility.cc index f5e87b860..5fe5bf8c3 100644 --- a/src/arch/x86/utility.cc +++ b/src/arch/x86/utility.cc @@ -248,6 +248,16 @@ void initCPU(ThreadContext *tc, int cpuId) // TODO Turn on the APIC. This should be handled elsewhere but it isn't // currently being handled at all. + LocalApicBase lApicBase = 0; + lApicBase.base = 0xFEE00000 >> 12; + lApicBase.enable = 1; + lApicBase.bsp = (cpuId == 0); + tc->setMiscReg(MISCREG_APIC_BASE, lApicBase); + + tc->setMiscRegNoEffect(MISCREG_APIC_ID, cpuId << 24); + + tc->setMiscRegNoEffect(MISCREG_APIC_VERSION, (5 << 16) | 0x14); + // TODO Set the SMRAM base address (SMBASE) to 0x00030000 tc->setMiscReg(MISCREG_VM_CR, 0); -- cgit v1.2.3