diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c index 8969e31bb32d..541bd3f7afd5 100644 --- a/sys/amd64/amd64/bios.c +++ b/sys/amd64/amd64/bios.c @@ -32,6 +32,7 @@ */ #include "isa.h" +#include "opt_smp.h" #include #include @@ -565,6 +566,22 @@ pnpbios_identify(driver_t *driver, device_t parent) printf("pnpbios: bogus system node data, aborting scan\n"); break; } + + /* + * If we are in APIC_IO mode, we should ignore the ISA PIC if it + * shows up. Likewise, in !APIC_IO mode, we should ignore the + * APIC (less important). + * This is significant because the ISA PIC will claim IRQ 2 (which + * it uses for chaining), while in APIC mode this is a valid IRQ + * available for general use. + */ +#ifdef APIC_IO + if (pnp_eisaformat(pd->devid) == "PNP0000") /* ISA PIC */ + continue; +#else + if (pnp_eisaformat(pd->devid) == "PNP0003") /* APIC */ + continue; +#endif /* Add the device and parse its resources */ dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1); diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index 8969e31bb32d..541bd3f7afd5 100644 --- a/sys/i386/i386/bios.c +++ b/sys/i386/i386/bios.c @@ -32,6 +32,7 @@ */ #include "isa.h" +#include "opt_smp.h" #include #include @@ -565,6 +566,22 @@ pnpbios_identify(driver_t *driver, device_t parent) printf("pnpbios: bogus system node data, aborting scan\n"); break; } + + /* + * If we are in APIC_IO mode, we should ignore the ISA PIC if it + * shows up. Likewise, in !APIC_IO mode, we should ignore the + * APIC (less important). + * This is significant because the ISA PIC will claim IRQ 2 (which + * it uses for chaining), while in APIC mode this is a valid IRQ + * available for general use. + */ +#ifdef APIC_IO + if (pnp_eisaformat(pd->devid) == "PNP0000") /* ISA PIC */ + continue; +#else + if (pnp_eisaformat(pd->devid) == "PNP0003") /* APIC */ + continue; +#endif /* Add the device and parse its resources */ dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1);