Index: oldkernel/linux/arch/i386/kernel/io_apic.c diff -u linux/arch/i386/kernel/io_apic.c:1.1.1.1 linux/arch/i386/kernel/io_apic.c:1.2 --- linux/arch/i386/kernel/io_apic.c:1.1.1.1 Wed May 31 12:33:53 2000 +++ linux/arch/i386/kernel/io_apic.c Thu Jun 1 15:07:01 2000 @@ -1277,6 +1277,37 @@ } } +/* Patch to set the IO-APIC physical IDs based on the values stored in the MPC table */ +/* by Matt Domsch Tue Dec 21 12:25:05 CST 1999 */ + +static void __init setup_ioapic_ids_from_mpc(void) +{ + struct IO_APIC_reg_00 reg_00; + /* + * Set the IOAPIC ID to the value stored in the MPC table. + */ + int apic; + for (apic = 0; apic < mp_apic_entries; apic++) { + /* Read the register 0 value */ + *(int *)®_00 = io_apic_read(apic, 0); + + if(reg_00.ID != mp_apics[apic].mpc_apicid) { + /* Change the value */ + printk("...changing IO-APIC physical APIC ID to %d\n", mp_apics[apic].mpc_apicid); + reg_00.ID = mp_apics[apic].mpc_apicid; + io_apic_write(apic, 0, *(int *)®_00); + + /* + * Sanity check + */ + *(int *)®_00 = io_apic_read(apic, 0); + if (reg_00.ID != mp_apics[apic].mpc_apicid) + panic("could not set ID"); + } + } +} + + /* * * IRQ's that are handled by the old PIC in all cases: @@ -1336,9 +1367,11 @@ * Set up the IO-APIC IRQ routing table by parsing the MP-BIOS * mptable: */ + setup_ioapic_ids_from_mpc(); setup_IO_APIC_irqs(); init_IO_APIC_traps(); check_timer(); print_IO_APIC(); } +