From: Tomas Hruby Date: Thu, 21 Oct 2010 17:07:07 +0000 (+0000) Subject: Zero no more hardwired as BSP apic id X-Git-Tag: v3.2.0~769 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/mult.png?a=commitdiff_plain;h=98c93e76d7cb7106858454d4351ad08c69692425;p=minix.git Zero no more hardwired as BSP apic id - the BSP apic id is written in the io apic redirection entries to deliver the interrupts to BSP --- diff --git a/kernel/arch/i386/apic.c b/kernel/arch/i386/apic.c index 1655f1672..bc8b8a3fe 100644 --- a/kernel/arch/i386/apic.c +++ b/kernel/arch/i386/apic.c @@ -399,7 +399,7 @@ PUBLIC void ioapic_mask_irq(unsigned irq) PUBLIC unsigned int apicid(void) { - return lapic_read(LAPIC_ID); + return lapic_read(LAPIC_ID) >> 24; } PRIVATE int calib_clk_handler(irq_hook_t * UNUSED(hook)) @@ -1100,6 +1100,7 @@ PUBLIC int apic_single_cpu_init(void) } bsp_lapic_id = apicid(); + printf("Boot cpu apic id %d\n", bsp_lapic_id); acpi_init(); @@ -1186,7 +1187,7 @@ PUBLIC void ioapic_set_irq(unsigned irq) /* * route the interrupts to the bsp by default */ - hi_32 = 0; + hi_32 = bsp_lapic_id << 24; ioapic_redirt_entry_write((void *) io_apic[ioa].addr, io_apic_irq[irq].pin, hi_32, low_32); }