diff options
author | imp <imp@FreeBSD.org> | 2008-09-19 04:10:09 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2008-09-19 04:10:09 +0000 |
commit | c22b0261144c3f1fe3f256b8d8c4d71de50f7cc8 (patch) | |
tree | 8675373f0ed91b243d8b3cf917c1616cb528aea9 /sys/mips | |
parent | eb41113d9885aa3dd5af75cb9d336ae402b111a1 (diff) | |
download | FreeBSD-src-c22b0261144c3f1fe3f256b8d8c4d71de50f7cc8.zip FreeBSD-src-c22b0261144c3f1fe3f256b8d8c4d71de50f7cc8.tar.gz |
MFp4: Update the interrupt code from perforce.
Submitted by: gonzo@
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/adm5120/obio.c | 25 | ||||
-rw-r--r-- | sys/mips/idt/obio.c | 38 |
2 files changed, 11 insertions, 52 deletions
diff --git a/sys/mips/adm5120/obio.c b/sys/mips/adm5120/obio.c index 4123a23..03e098d 100644 --- a/sys/mips/adm5120/obio.c +++ b/sys/mips/adm5120/obio.c @@ -320,7 +320,7 @@ obio_setup_intr(device_t dev, device_t child, struct resource *ires, event = sc->sc_eventstab[irq]; if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, + error = intr_event_create(&event, (void *)irq, 0, irq, (mask_fn)mips_mask_irq, (mask_fn)mips_unmask_irq, NULL, NULL, "obio intr%d:", irq); @@ -379,9 +379,8 @@ obio_intr(void *arg) { struct obio_softc *sc = arg; struct intr_event *event; - struct intr_handler *ih; uint32_t irqstat; - int irq, thread = 0; + int irq; irqstat = REG_READ(ICU_FIQ_STATUS_REG); irqstat |= REG_READ(ICU_STATUS_REG); @@ -390,20 +389,12 @@ obio_intr(void *arg) while (irqstat != 0) { if ((irqstat & 1) == 1) { event = sc->sc_eventstab[irq]; - if (event && !TAILQ_EMPTY(&event->ie_handlers)) { - /* Execute fast handlers. */ - TAILQ_FOREACH(ih, &event->ie_handlers, - ih_next) { - if (ih->ih_filter == NULL) - thread = 1; - else - ih->ih_filter(ih->ih_argument); - } - } - - /* Schedule thread if needed. */ - if (thread) - intr_event_schedule_thread(event); + if (!event || TAILQ_EMPTY(&event->ie_handlers)) + continue; + + /* TODO: pass frame as an argument*/ + /* TODO: log stray interrupt */ + intr_event_handle(event, NULL); } irq++; diff --git a/sys/mips/idt/obio.c b/sys/mips/idt/obio.c index 1cf5efb..893e883 100644 --- a/sys/mips/idt/obio.c +++ b/sys/mips/idt/obio.c @@ -273,7 +273,7 @@ obio_setup_intr(device_t dev, device_t child, struct resource *ires, event = sc->sc_eventstab[irq]; if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, + error = intr_event_create(&event, (void *)irq, 0, irq, (mask_fn)obio_mask_irq, (mask_fn)obio_unmask_irq, NULL, NULL, "obio intr%d:", irq); @@ -328,9 +328,8 @@ obio_intr(void *arg) { struct obio_softc *sc = arg; struct intr_event *event; - struct intr_handler *ih; uint32_t irqstat, ipend, imask, xpend; - int irq, thread, group, i, ret; + int irq, thread, group, i; irqstat = 0; irq = 0; @@ -350,47 +349,16 @@ obio_intr(void *arg) irq = IP_IRQ(group, i - 1); event = sc->sc_eventstab[irq]; thread = 0; -#ifndef INTR_FILTER - obio_mask_irq(irq); -#endif if (!event || TAILQ_EMPTY(&event->ie_handlers)) { -#ifdef INTR_FILTER - obio_unmask_irq(irq); -#endif + /* TODO: Log stray IRQs */ continue; } -#ifdef INTR_FILTER /* TODO: frame instead of NULL? */ intr_event_handle(event, NULL); /* XXX: Log stray IRQs */ -#else - /* Execute fast handlers. */ - TAILQ_FOREACH(ih, &event->ie_handlers, - ih_next) { - if (ih->ih_filter == NULL) - thread = 1; - else - ret = ih->ih_filter(ih->ih_argument); - /* - * Wrapper handler special case: see - * intr_execute_handlers() in - * i386/intr_machdep.c - */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - /* Schedule thread if needed. */ - if (thread) - intr_event_schedule_thread(event); - else - obio_unmask_irq(irq); } } -#endif #if 0 ipend = ICU_REG_READ(ICU_IPEND2); printf("ipend2 = %08x!\n", ipend); |