Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/atheros/ar531x/apb.c
Show First 20 Lines • Show All 402 Lines • ▼ Show 20 Lines | #ifdef INTRNG | ||||
const char *name; | const char *name; | ||||
if ((rman_get_flags(ires) & RF_SHAREABLE) == 0) | if ((rman_get_flags(ires) & RF_SHAREABLE) == 0) | ||||
flags |= INTR_EXCL; | flags |= INTR_EXCL; | ||||
irq = rman_get_start(ires); | irq = rman_get_start(ires); | ||||
isrc = PIC_INTR_ISRC(sc, irq); | isrc = PIC_INTR_ISRC(sc, irq); | ||||
if(isrc->isrc_event == 0) { | if(isrc->isrc_event == 0) { | ||||
error = intr_event_create(&isrc->isrc_event, (void *)irq, | error = intr_event_create(&isrc->isrc_event, (void *)irq, 0, | ||||
0, irq, apb_mask_irq, apb_unmask_irq, | apb_mask_irq, apb_unmask_irq, NULL, NULL, | ||||
NULL, NULL, "apb intr%d:", irq); | "apb intr%d:", irq); | ||||
if(error != 0) | if(error != 0) | ||||
return(error); | return(error); | ||||
} | } | ||||
name = device_get_nameunit(child); | name = device_get_nameunit(child); | ||||
error = intr_event_add_handler(isrc->isrc_event, name, filt, handler, | error = intr_event_add_handler(isrc->isrc_event, name, filt, handler, | ||||
arg, intr_priority(flags), flags, cookiep); | arg, intr_priority(flags), flags, cookiep); | ||||
return(error); | return(error); | ||||
#else | #else | ||||
irq = rman_get_start(ires); | irq = rman_get_start(ires); | ||||
if (irq > APB_IRQ_END) | if (irq > APB_IRQ_END) | ||||
panic("%s: bad irq %d", __func__, irq); | panic("%s: bad irq %d", __func__, irq); | ||||
event = sc->sc_eventstab[irq]; | event = sc->sc_eventstab[irq]; | ||||
if (event == NULL) { | if (event == NULL) { | ||||
error = intr_event_create(&event, (void *)irq, 0, irq, | error = intr_event_create(&event, (void *)irq, 0, apb_mask_irq, | ||||
apb_mask_irq, apb_unmask_irq, | apb_unmask_irq, NULL, NULL, "apb intr%d:", irq); | ||||
NULL, NULL, | |||||
"apb intr%d:", irq); | |||||
if (error == 0) { | if (error == 0) { | ||||
sc->sc_eventstab[irq] = event; | sc->sc_eventstab[irq] = event; | ||||
sc->sc_intr_counter[irq] = | sc->sc_intr_counter[irq] = | ||||
mips_intrcnt_create(event->ie_name); | mips_intrcnt_create(event->ie_name); | ||||
} | } | ||||
else | else | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |