From f65c10b6e2dfc62a5fc0f7808d25d262c09fd504 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Mon, 22 Jun 2009 18:42:34 +0800 Subject: [PATCH] MP table: Don't mix lapic/ioapic/imcr configuration information extraction --- sys/platform/pc32/i386/mp_machdep.c | 47 +++++++++++++++++------------ 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/sys/platform/pc32/i386/mp_machdep.c b/sys/platform/pc32/i386/mp_machdep.c index 24919fd41d..afdccd01a3 100644 --- a/sys/platform/pc32/i386/mp_machdep.c +++ b/sys/platform/pc32/i386/mp_machdep.c @@ -648,34 +648,21 @@ mp_enable(u_int boot_addr) u_int ux; #endif /* APIC_IO */ vm_paddr_t mpfps_paddr; + struct mptable_pos mpt; POSTCODE(MP_ENABLE_POST); - if (madt_probe_test) { + /* + * Enumerate Local APIC + */ + if (madt_probe_test) mpfps_paddr = 0; - } else { + else mpfps_paddr = mptable_probe(); - } - if (mpfps_paddr) { - struct mptable_pos mpt; - mptable_map(&mpt, mpfps_paddr); - mptable_lapic_enumerate(&mpt); - - mptable_imcr(&mpt); - - /* - * Examine the MP table for needed info - */ - mptable_pass1(&mpt); - mptable_pass2(&mpt); - mptable_unmap(&mpt); - - /* Post scan cleanup */ - mptable_fix(); } else { vm_paddr_t madt_paddr; vm_offset_t lapic_addr; @@ -696,8 +683,30 @@ mp_enable(u_int boot_addr) panic("mp_enable: madt_pass2 failed\n"); } + mpfps_paddr = mptable_probe(); + if (mpfps_paddr) { + mptable_map(&mpt, mpfps_paddr); + mptable_imcr(&mpt); + mptable_unmap(&mpt); + } #if defined(APIC_IO) + if (!mpfps_paddr) + panic("no MP table, disable APIC_IO!\n"); + + mptable_map(&mpt, mpfps_paddr); + + /* + * Examine the MP table for needed info + */ + mptable_pass1(&mpt); + mptable_pass2(&mpt); + + mptable_unmap(&mpt); + + /* Post scan cleanup */ + mptable_fix(); + setup_apic_irq_mapping(); /* fill the LOGICAL io_apic_versions table */ -- 2.41.0