Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powerpc/openpic.c
Context not available. | |||||
break; | break; | ||||
sc->sc_intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, | sc->sc_intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, | ||||
&sc->sc_irq, RF_ACTIVE); | &sc->sc_irq, 0 /* Activate later */); | ||||
/* XXX Cascaded PICs pass NULL trapframes! */ | /* | ||||
bus_setup_intr(dev, sc->sc_intr, INTR_TYPE_MISC | INTR_MPSAFE, | * If this is attaching late (which will probably fail), | ||||
openpic_intr, NULL, dev, &sc->sc_icookie); | * immediately set up the parent interrupt. | ||||
*/ | |||||
if (bus_current_pass > BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST) | |||||
openpic_new_pass(dev); | |||||
} while (0); | } while (0); | ||||
/* Reset the PIC */ | /* Reset the PIC */ | ||||
Context not available. | |||||
return (0); | return (0); | ||||
} | } | ||||
void | |||||
openpic_new_pass(device_t dev) | |||||
{ | |||||
struct openpic_softc *sc; | |||||
if (bus_current_pass <= BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST) | |||||
return; | |||||
sc = device_get_softc(dev); | |||||
if (sc->sc_intr == NULL || (rman_get_flags(sc->sc_intr) & RF_ACTIVE)) | |||||
return; | |||||
bus_activate_resource(dev, SYS_RES_IRQ, sc->sc_irq, sc->sc_intr); | |||||
/* XXX Cascaded PICs pass NULL trapframes! */ | |||||
bus_setup_intr(dev, sc->sc_intr, INTR_TYPE_MISC | INTR_MPSAFE, | |||||
openpic_intr, NULL, dev, &sc->sc_icookie); | |||||
} | |||||
/* | /* | ||||
* PIC I/F methods | * PIC I/F methods | ||||
*/ | */ | ||||
Context not available. |