diff options
author | piso <piso@FreeBSD.org> | 2007-02-23 12:19:07 +0000 |
---|---|---|
committer | piso <piso@FreeBSD.org> | 2007-02-23 12:19:07 +0000 |
commit | 6a2ffa86e5b748ba71e36d37462a936eb9101be7 (patch) | |
tree | 10833d4edb6c0d0a5efcf7762d842a4c378404b0 /sys/dev/scc | |
parent | 7b48c9d78377cdb9fc6e8bcc5406e28819aef6e3 (diff) | |
download | FreeBSD-src-6a2ffa86e5b748ba71e36d37462a936eb9101be7.zip FreeBSD-src-6a2ffa86e5b748ba71e36d37462a936eb9101be7.tar.gz |
o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()
o add an int return code to all fast handlers
o retire INTR_FAST/IH_FAST
For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current
Reviewed by: many
Approved by: re@
Diffstat (limited to 'sys/dev/scc')
-rw-r--r-- | sys/dev/scc/scc_bfe.h | 4 | ||||
-rw-r--r-- | sys/dev/scc/scc_core.c | 24 |
2 files changed, 15 insertions, 13 deletions
diff --git a/sys/dev/scc/scc_bfe.h b/sys/dev/scc/scc_bfe.h index 0107eae..5e7cc83 100644 --- a/sys/dev/scc/scc_bfe.h +++ b/sys/dev/scc/scc_bfe.h @@ -76,7 +76,7 @@ struct scc_mode { int m_probed:1; int m_sysdev:1; - driver_intr_t *ih; + driver_filter_t *ih; serdev_intr_t *ih_src[SCC_ISRCCNT]; void *ih_arg; }; @@ -146,7 +146,7 @@ int scc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *); int scc_bus_read_ivar(device_t, device_t, int, uintptr_t *); int scc_bus_release_resource(device_t, device_t, int, int, struct resource *); int scc_bus_setup_intr(device_t, device_t, struct resource *, int, - void (*)(void *), void *, void **); + driver_filter_t *, void (*)(void *), void *, void **); int scc_bus_teardown_intr(device_t, device_t, struct resource *, void *); #endif /* _DEV_SCC_BFE_H_ */ diff --git a/sys/dev/scc/scc_core.c b/sys/dev/scc/scc_core.c index 17be686..1aa7549 100644 --- a/sys/dev/scc/scc_core.c +++ b/sys/dev/scc/scc_core.c @@ -50,7 +50,7 @@ char scc_driver_name[] = "scc"; MALLOC_DEFINE(M_SCC, "SCC", "SCC driver"); -static void +static int scc_bfe_intr(void *arg) { struct scc_softc *sc = arg; @@ -88,7 +88,9 @@ scc_bfe_intr(void *arg) else SCC_ICLEAR(sc, ch); } + return (FILTER_HANDLED); } + return (FILTER_STRAY); } int @@ -217,12 +219,12 @@ scc_bfe_attach(device_t dev) if (ch->ch_ires == NULL) continue; error = bus_setup_intr(dev, ch->ch_ires, - INTR_TYPE_TTY | INTR_FAST, scc_bfe_intr, sc, + INTR_TYPE_TTY, scc_bfe_intr, NULL, sc, &ch->ch_icookie); if (error) { error = bus_setup_intr(dev, ch->ch_ires, - INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc, - &ch->ch_icookie); + INTR_TYPE_TTY | INTR_MPSAFE, NULL, + (driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie); } else sc->sc_fastintr = 1; @@ -495,7 +497,7 @@ scc_bus_release_resource(device_t dev, device_t child, int type, int rid, int scc_bus_setup_intr(device_t dev, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep) { struct scc_chan *ch; struct scc_mode *m; @@ -506,14 +508,14 @@ scc_bus_setup_intr(device_t dev, device_t child, struct resource *r, int flags, return (EINVAL); /* Interrupt handlers must be FAST or MPSAFE. */ - if ((flags & (INTR_FAST|INTR_MPSAFE)) == 0) + if (filt == NULL && !(flags & INTR_MPSAFE)) return (EINVAL); sc = device_get_softc(dev); if (sc->sc_polled) return (ENXIO); - if (sc->sc_fastintr && !(flags & INTR_FAST)) { + if (sc->sc_fastintr && filt == NULL) { sc->sc_fastintr = 0; for (c = 0; c < sc->sc_class->cl_channels; c++) { ch = &sc->sc_chan[c]; @@ -521,15 +523,15 @@ scc_bus_setup_intr(device_t dev, device_t child, struct resource *r, int flags, continue; bus_teardown_intr(dev, ch->ch_ires, ch->ch_icookie); bus_setup_intr(dev, ch->ch_ires, - INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc, - &ch->ch_icookie); + INTR_TYPE_TTY | INTR_MPSAFE, NULL, + (driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie); } } m = device_get_ivars(child); m->m_hasintr = 1; - m->m_fastintr = (flags & INTR_FAST) ? 1 : 0; - m->ih = ihand; + m->m_fastintr = (filt != NULL) ? 1 : 0; + m->ih = (filt != NULL) ? filt : (driver_filter_t *)ihand; m->ih_arg = arg; i = 0, isrc = SER_INT_OVERRUN; |