From ac7326e338a71c88360c743ccd76e69ada7e768b Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 5 Dec 2005 22:11:44 +0000 Subject: [PATCH] Don't panic if IRQ 13 doesn't exist. On some machines (see previous commit to atpic.c) there may not be an IRQ 13. Instead, just keep going. If the INT16 interface doesn't work then we will eventually panic anyway. FWIW: We could probably just axe the support for IRQ 13 altogether at this point. The only thing we'd lose support for are 486sx systems with external 487 FPUs. MFC after: 1 week --- sys/i386/isa/npx.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index ae2ca9b5bfcf..49309f39b4d1 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -263,11 +263,11 @@ npx_probe(dev) irq_rid = 0; irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num, irq_num, 1, RF_ACTIVE); - if (irq_res == NULL) - panic("npx: can't get IRQ"); - if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC | INTR_FAST, npx_intr, - NULL, &irq_cookie) != 0) - panic("npx: can't create intr"); + if (irq_res != NULL) { + if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC | INTR_FAST, + npx_intr, NULL, &irq_cookie) != 0) + panic("npx: can't create intr"); + } /* * Partially reset the coprocessor, if any. Some BIOS's don't reset @@ -384,8 +384,10 @@ npx_probe(dev) /* FALLTHROUGH */ no_irq13: idt[IDT_MF] = save_idt_npxtrap; - bus_teardown_intr(dev, irq_res, irq_cookie); - bus_release_resource(dev, SYS_RES_IRQ, irq_rid, irq_res); + if (irq_res != NULL) { + bus_teardown_intr(dev, irq_res, irq_cookie); + bus_release_resource(dev, SYS_RES_IRQ, irq_rid, irq_res); + } bus_release_resource(dev, SYS_RES_IOPORT, ioport_rid, ioport_res); return (0); }