diff options
author | Henric Jungheim <henric@cvs.openbsd.org> | 2003-06-24 21:54:40 +0000 |
---|---|---|
committer | Henric Jungheim <henric@cvs.openbsd.org> | 2003-06-24 21:54:40 +0000 |
commit | 355b8560084501d10eae7686c8385754bc6c7072 (patch) | |
tree | d3bc0a5b778c1c6b51beb7fedae743f3fc436c13 /sys/dev | |
parent | 02503c73b4a809f21312fef8bf66cfe5d0f1a50f (diff) |
Add a "where" argument to the sparc64 interrupt code. This lets us
associate a name with each interrupt handler. This is not visible
outside the kernel (yet).
ok jason@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sbus/apio.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/asio.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/be.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/cgsix.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/cs4231.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/dma_sbus.c | 12 | ||||
-rw-r--r-- | sys/dev/sbus/esp_sbus.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/if_hme_sbus.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/if_le.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/if_le_lebuffer.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/if_le_ledma.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/isp_sbus.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/magma.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/qe.c | 6 | ||||
-rw-r--r-- | sys/dev/sbus/qec.c | 22 | ||||
-rw-r--r-- | sys/dev/sbus/spif.c | 8 |
16 files changed, 52 insertions, 44 deletions
diff --git a/sys/dev/sbus/apio.c b/sys/dev/sbus/apio.c index b2e65a7d780..808fd3d62e0 100644 --- a/sys/dev/sbus/apio.c +++ b/sys/dev/sbus/apio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apio.c,v 1.4 2003/06/02 18:32:41 jason Exp $ */ +/* $OpenBSD: apio.c,v 1.5 2003/06/24 21:54:38 henric Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -228,7 +228,7 @@ lpt_apio_attach(parent, self, aux) sc->sc_lpt.sc_ioh = aaa->aaa_ioh; sc->sc_clk_h = aaa->aaa_clkh; sc->sc_ih = bus_intr_establish(aaa->aaa_iot, aaa->aaa_pri, - IPL_TTY, 0, lpt_apio_intr, sc); + IPL_TTY, 0, lpt_apio_intr, sc, self->dv_xname); if (sc->sc_ih == NULL) { printf(": cannot allocate intr\n"); return; diff --git a/sys/dev/sbus/asio.c b/sys/dev/sbus/asio.c index c2394929b6a..1c7b9eb29c1 100644 --- a/sys/dev/sbus/asio.c +++ b/sys/dev/sbus/asio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asio.c,v 1.7 2003/06/02 18:32:41 jason Exp $ */ +/* $OpenBSD: asio.c,v 1.8 2003/06/24 21:54:38 henric Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -232,7 +232,7 @@ com_asio_attach(parent, self, aux) sc->sc_frequency = BAUD_BASE; sc->sc_ih = bus_intr_establish(aaa->aaa_iot, aaa->aaa_pri, - IPL_TTY, 0, comintr, sc); + IPL_TTY, 0, comintr, sc, self->dv_xname); if (sc->sc_ih == NULL) { printf(": cannot allocate intr\n"); return; diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c index 8d120d24635..c4019da229f 100644 --- a/sys/dev/sbus/be.c +++ b/sys/dev/sbus/be.c @@ -1,4 +1,4 @@ -/* $OpenBSD: be.c,v 1.11 2003/06/02 18:32:41 jason Exp $ */ +/* $OpenBSD: be.c,v 1.12 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: be.c,v 1.26 2001/03/20 15:39:20 pk Exp $ */ /*- @@ -297,7 +297,7 @@ beattach(parent, self, aux) /* Establish interrupt handler */ if (sa->sa_nintr == 0 || bus_intr_establish(sa->sa_bustag, sa->sa_pri, - IPL_NET, 0, beintr, sc) == NULL) { + IPL_NET, 0, beintr, sc, self->dv_xname) == NULL) { printf(": no interrupt established\n"); return; } diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c index d737489d7c2..93d78cd4588 100644 --- a/sys/dev/sbus/cgsix.c +++ b/sys/dev/sbus/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.42 2003/06/18 17:35:30 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.43 2003/06/24 21:54:38 henric Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -195,7 +195,7 @@ cgsixattach(parent, self, aux) } if ((sc->sc_ih = bus_intr_establish(sa->sa_bustag, sa->sa_pri, - IPL_TTY, 0, cgsix_intr, sc)) == NULL) { + IPL_TTY, 0, cgsix_intr, sc, self->dv_xname)) == NULL) { printf(": couldn't establish interrupt, pri %d\n", sa->sa_pri); goto fail_intr; } diff --git a/sys/dev/sbus/cs4231.c b/sys/dev/sbus/cs4231.c index ff093244ad7..af2abf21fd2 100644 --- a/sys/dev/sbus/cs4231.c +++ b/sys/dev/sbus/cs4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4231.c,v 1.19 2003/06/02 18:32:41 jason Exp $ */ +/* $OpenBSD: cs4231.c,v 1.20 2003/06/24 21:54:38 henric Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -239,7 +239,7 @@ cs4231_attach(parent, self, aux) } if (bus_intr_establish(sa->sa_bustag, sa->sa_pri, IPL_AUDIO, 0, - cs4231_intr, sc) == NULL) { + cs4231_intr, sc, self->dv_xname) == NULL) { printf(": couldn't establish interrupt, pri %d\n", sa->sa_pri); return; } diff --git a/sys/dev/sbus/dma_sbus.c b/sys/dev/sbus/dma_sbus.c index c884d43a0f7..3d61c25ffca 100644 --- a/sys/dev/sbus/dma_sbus.c +++ b/sys/dev/sbus/dma_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma_sbus.c,v 1.9 2003/06/05 12:27:03 deraadt Exp $ */ +/* $OpenBSD: dma_sbus.c,v 1.10 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: dma_sbus.c,v 1.5 2000/07/09 20:57:42 pk Exp $ */ /*- @@ -101,7 +101,8 @@ void *dmabus_intr_establish( int, /*`device class' level*/ int, /*flags*/ int (*)(void *), /*handler*/ - void *); /*handler arg*/ + void *, /*handler arg*/ + const char *); /*what*/ static bus_space_tag_t dma_alloc_bustag(struct dma_softc *sc); @@ -254,7 +255,8 @@ dmabus_intr_establish( int level, int flags, int (*handler)(void *), - void *arg) + void *arg, + const char *what) { struct lsi64854_softc *sc = t->cookie; @@ -269,10 +271,12 @@ dmabus_intr_establish( for (t = t->parent; t; t = t->parent) { if (t->sparc_intr_establish != NULL) return ((*t->sparc_intr_establish) - (t, t0, pri, level, flags, handler, arg)); + (t, t0, pri, level, flags, handler, arg, what)); } + panic("dmabus_intr_establish: no handler found"); + return (NULL); } diff --git a/sys/dev/sbus/esp_sbus.c b/sys/dev/sbus/esp_sbus.c index 4ff890a7e6f..92df84fa857 100644 --- a/sys/dev/sbus/esp_sbus.c +++ b/sys/dev/sbus/esp_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esp_sbus.c,v 1.12 2003/03/27 16:43:28 jason Exp $ */ +/* $OpenBSD: esp_sbus.c,v 1.13 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: esp_sbus.c,v 1.14 2001/04/25 17:53:37 bouyer Exp $ */ /*- @@ -537,7 +537,7 @@ espattach(esc, gluep) /* Establish interrupt channel */ icookie = bus_intr_establish(esc->sc_bustag, esc->sc_pri, IPL_BIO, 0, - ncr53c9x_intr, sc); + ncr53c9x_intr, sc, sc->sc_dev.dv_xname); /* register interrupt stats */ evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); diff --git a/sys/dev/sbus/if_hme_sbus.c b/sys/dev/sbus/if_hme_sbus.c index 7d0cb7375d4..a262f0a2307 100644 --- a/sys/dev/sbus/if_hme_sbus.c +++ b/sys/dev/sbus/if_hme_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_hme_sbus.c,v 1.4 2003/02/17 01:29:20 henric Exp $ */ +/* $OpenBSD: if_hme_sbus.c,v 1.5 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: if_hme_sbus.c,v 1.6 2001/02/28 14:52:48 mrg Exp $ */ /*- @@ -207,5 +207,5 @@ hmeattach_sbus(parent, self, aux) /* Establish interrupt handler */ if (sa->sa_nintr != 0) (void)bus_intr_establish(sa->sa_bustag, sa->sa_pri, IPL_NET, 0, - hme_intr, sc); + hme_intr, sc, self->dv_xname); } diff --git a/sys/dev/sbus/if_le.c b/sys/dev/sbus/if_le.c index d1b863f5621..02699192cb7 100644 --- a/sys/dev/sbus/if_le.c +++ b/sys/dev/sbus/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.7 2002/05/13 19:45:51 jason Exp $ */ +/* $OpenBSD: if_le.c,v 1.8 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: if_le.c,v 1.17 2001/05/30 11:46:35 mrg Exp $ */ /*- @@ -263,5 +263,5 @@ leattach_sbus(parent, self, aux) /* Establish interrupt handler */ if (sa->sa_nintr != 0) (void)bus_intr_establish(lesc->sc_bustag, sa->sa_pri, - IPL_NET, 0, am7990_intr, sc); + IPL_NET, 0, am7990_intr, sc, self->dv_xname); } diff --git a/sys/dev/sbus/if_le_lebuffer.c b/sys/dev/sbus/if_le_lebuffer.c index d4fcadce659..11f04c30f9e 100644 --- a/sys/dev/sbus/if_le_lebuffer.c +++ b/sys/dev/sbus/if_le_lebuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_lebuffer.c,v 1.2 2002/05/13 18:16:38 jason Exp $ */ +/* $OpenBSD: if_le_lebuffer.c,v 1.3 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: if_le_lebuffer.c,v 1.10 2002/03/11 16:00:56 pk Exp $ */ /*- @@ -197,5 +197,5 @@ leattach_lebuffer(parent, self, aux) /* Establish interrupt handler */ if (sa->sa_nintr != 0) (void)bus_intr_establish(lesc->sc_bustag, sa->sa_pri, - IPL_NET, 0, am7990_intr, sc); + IPL_NET, 0, am7990_intr, sc, self->dv_xname); } diff --git a/sys/dev/sbus/if_le_ledma.c b/sys/dev/sbus/if_le_ledma.c index b0168411f2d..c376aa14bed 100644 --- a/sys/dev/sbus/if_le_ledma.c +++ b/sys/dev/sbus/if_le_ledma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_ledma.c,v 1.8 2003/05/14 23:35:31 miod Exp $ */ +/* $OpenBSD: if_le_ledma.c,v 1.9 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: if_le_ledma.c,v 1.14 2001/05/30 11:46:35 mrg Exp $ */ /*- @@ -434,7 +434,7 @@ leattach_ledma(parent, self, aux) /* Establish interrupt handler */ if (sa->sa_nintr != 0) (void)bus_intr_establish(sa->sa_bustag, sa->sa_pri, IPL_NET, 0, - am7990_intr, sc); + am7990_intr, sc, self->dv_xname); am7990_config(&lesc->sc_am7990); diff --git a/sys/dev/sbus/isp_sbus.c b/sys/dev/sbus/isp_sbus.c index d1183f8fa76..d996af57688 100644 --- a/sys/dev/sbus/isp_sbus.c +++ b/sys/dev/sbus/isp_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_sbus.c,v 1.5 2003/02/17 01:29:21 henric Exp $ */ +/* $OpenBSD: isp_sbus.c,v 1.6 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: isp_sbus.c,v 1.46 2001/09/26 20:53:14 eeh Exp $ */ /* @@ -252,7 +252,7 @@ isp_sbus_attach(struct device *parent, struct device *self, void *aux) /* Establish interrupt channel */ bus_intr_establish(sbc->sbus_bustag, sbc->sbus_pri, IPL_BIO, 0, - isp_sbus_intr, sbc); + isp_sbus_intr, sbc, self->dv_xname); sbus_establish(&sbc->sbus_sd, &sbc->sbus_isp.isp_osinfo._dev); /* diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c index 33b3ba90856..6ca73ea9deb 100644 --- a/sys/dev/sbus/magma.c +++ b/sys/dev/sbus/magma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magma.c,v 1.7 2003/03/27 17:39:05 jason Exp $ */ +/* $OpenBSD: magma.c,v 1.8 2003/06/24 21:54:38 henric Exp $ */ /* * magma.c * @@ -366,7 +366,7 @@ magma_attach(parent, dev, aux) return; } sc->sc_ih = bus_intr_establish(sa->sa_bustag, sa->sa_pri, IPL_TTY, 0, - magma_hard, sc); + magma_hard, sc, dev->dv_xname); if (sc->sc_ih == NULL) { printf(": failed to establish interrupt\n"); bus_space_unmap(sc->sc_bustag, sc->sc_iohandle, diff --git a/sys/dev/sbus/qe.c b/sys/dev/sbus/qe.c index f269db1417f..2dc9a75177e 100644 --- a/sys/dev/sbus/qe.c +++ b/sys/dev/sbus/qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qe.c,v 1.12 2003/06/02 18:32:41 jason Exp $ */ +/* $OpenBSD: qe.c,v 1.13 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: qe.c,v 1.16 2001/03/30 17:30:18 christos Exp $ */ /*- @@ -246,8 +246,8 @@ qeattach(parent, self, aux) qestop(sc); /* Note: no interrupt level passed */ - if (bus_intr_establish(sa->sa_bustag, 0, IPL_NET, 0, qeintr, sc) == - NULL) { + if (bus_intr_establish(sa->sa_bustag, 0, IPL_NET, 0, qeintr, sc, + self->dv_xname) == NULL) { printf(": no interrupt established\n"); return; } diff --git a/sys/dev/sbus/qec.c b/sys/dev/sbus/qec.c index 4a9d7213468..69da81a219b 100644 --- a/sys/dev/sbus/qec.c +++ b/sys/dev/sbus/qec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qec.c,v 1.6 2003/03/27 17:39:05 jason Exp $ */ +/* $OpenBSD: qec.c,v 1.7 2003/06/24 21:54:38 henric Exp $ */ /* $NetBSD: qec.c,v 1.12 2000/12/04 20:12:55 fvdl Exp $ */ /*- @@ -72,7 +72,8 @@ void * qec_intr_establish( int, /*`device class' interrupt level*/ int, /*flags*/ int (*)(void *), /*handler*/ - void *); /*arg*/ + void *, /*arg*/ + const char *); /*what*/ struct cfattach qec_ca = { sizeof(struct qec_softc), qecmatch, qecattach @@ -286,7 +287,7 @@ qec_bus_map(t, t0, addr, size, flags, hp) } void * -qec_intr_establish(t, t0, pri, level, flags, handler, arg) +qec_intr_establish(t, t0, pri, level, flags, handler, arg, what) bus_space_tag_t t; bus_space_tag_t t0; int pri; @@ -294,6 +295,7 @@ qec_intr_establish(t, t0, pri, level, flags, handler, arg) int flags; int (*handler)(void *); void *arg; + const char *what; { struct qec_softc *sc = t->cookie; @@ -310,15 +312,15 @@ qec_intr_establish(t, t0, pri, level, flags, handler, arg) pri = sc->sc_intr->sbi_pri; } - if (t->parent == 0 || t->parent->sparc_bus_mmap == 0) { - printf("\nebus_bus_mmap: invalid parent"); - return (NULL); - } + for (t = t->parent; t; t = t->parent) { + if (t->sparc_intr_establish != NULL) + return ((*t->sparc_intr_establish) + (t, t0, pri, level, flags, handler, arg, what)); + } - t = t->parent; + panic("qec_intr_extablish): no handler found"); - return ((*t->sparc_intr_establish)(t, t0, pri, level, flags, - handler, arg)); + return (NULL); } void diff --git a/sys/dev/sbus/spif.c b/sys/dev/sbus/spif.c index e88f1f2b823..b843270d029 100644 --- a/sys/dev/sbus/spif.c +++ b/sys/dev/sbus/spif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spif.c,v 1.7 2003/06/02 18:32:41 jason Exp $ */ +/* $OpenBSD: spif.c,v 1.8 2003/06/24 21:54:38 henric Exp $ */ /* * Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net) @@ -216,14 +216,16 @@ spifattach(parent, self, aux) } sc->sc_ppcih = bus_intr_establish(sa->sa_bustag, - sa->sa_intr[PARALLEL_INTR].sbi_pri, IPL_TTY, 0, spifppcintr, sc); + sa->sa_intr[PARALLEL_INTR].sbi_pri, IPL_TTY, 0, spifppcintr, sc, + self->dv_xname); if (sc->sc_ppcih == NULL) { printf(": failed to establish ppc interrupt\n"); goto fail_unmapregs; } sc->sc_stcih = bus_intr_establish(sa->sa_bustag, - sa->sa_intr[SERIAL_INTR].sbi_pri, IPL_TTY, 0, spifstcintr, sc); + sa->sa_intr[SERIAL_INTR].sbi_pri, IPL_TTY, 0, spifstcintr, sc, + self->dv_xname); if (sc->sc_stcih == NULL) { printf(": failed to establish stc interrupt\n"); goto fail_unmapregs; |