diff options
author | 2001-07-20 14:26:28 +0000 | |
---|---|---|
committer | 2001-07-20 14:26:28 +0000 | |
commit | 6d16bbe3a468045f776736e61e67b8e1723c5e89 (patch) | |
tree | 872c53e25a3caffc31645c16c978eb97761392a0 | |
parent | Since the aborts seem recoverable (thus far), don't printf() about them, (diff) | |
download | wireguard-openbsd-6d16bbe3a468045f776736e61e67b8e1723c5e89.tar.xz wireguard-openbsd-6d16bbe3a468045f776736e61e67b8e1723c5e89.zip |
Not mapping registers you know are there (even if they don't work) is a
bad idea on ISA when you think about PCMCIA; pointed out by costa and mickey.
-rw-r--r-- | sys/dev/isa/addcom_isa.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sys/dev/isa/addcom_isa.c b/sys/dev/isa/addcom_isa.c index 251b2508573..7c33233568f 100644 --- a/sys/dev/isa/addcom_isa.c +++ b/sys/dev/isa/addcom_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: addcom_isa.c,v 1.2 2001/07/17 18:27:52 jason Exp $ */ +/* $OpenBSD: addcom_isa.c,v 1.3 2001/07/20 14:26:28 jason Exp $ */ /* $NetBSD: addcom_isa.c,v 1.2 2000/04/21 20:13:41 explorer Exp $ */ /* @@ -91,6 +91,7 @@ struct addcom_softc { int sc_alive; /* mask of slave units attached */ void *sc_slaves[NSLAVES]; /* com device unit numbers */ bus_space_handle_t sc_slaveioh[NSLAVES]; + bus_space_handle_t sc_statusioh; }; #define SLAVE_IOBASE_OFFSET 0x108 @@ -202,6 +203,12 @@ addcomattach(parent, self, aux) sc->sc_iot = ia->ia_iot; sc->sc_iobase = ia->ia_iobase; + if (bus_space_map(iot, STATUS_IOADDR, STATUS_SIZE, + 0, &sc->sc_statusioh)) { + printf("%s: can't map status space\n", sc->sc_dev.dv_xname); + return; + } + for (i = 0; i < NSLAVES; i++) { iobase = sc->sc_iobase + slave_iobases[i] @@ -240,11 +247,20 @@ addcomintr(arg) void *arg; { struct addcom_softc *sc = arg; - int i, r = 0; - - for (i = 0; i < NSLAVES; i++) - if (sc->sc_alive & (1 << i)) - r |= comintr(sc->sc_slaves[i]); + int i, r = 0, n = 1, t; + + while (n) { + n = 0; + for (i = 0; i < NSLAVES; i++) { + if (sc->sc_alive & (1 << i)) { + t = comintr(sc->sc_slaves[i]); + if (t) { + n++; + r |= t; + } + } + } + } return (r); } |