diff options
author | Kenji Aoyama <aoyama@cvs.openbsd.org> | 2017-06-04 13:48:14 +0000 |
---|---|---|
committer | Kenji Aoyama <aoyama@cvs.openbsd.org> | 2017-06-04 13:48:14 +0000 |
commit | 30b0aab1cf6baf82b733ebb25e6ee8a8397b7ecb (patch) | |
tree | f96f7603583e720b0701dcc087c34ab9c06faaa5 | |
parent | f930d5098ed8464c78de1a334482f2ce7794ae98 (diff) |
Sync with current NetBSD/luna68k code.
-rw-r--r-- | sys/arch/luna88k/dev/lunaws.c | 18 | ||||
-rw-r--r-- | sys/arch/luna88k/dev/sio.c | 19 | ||||
-rw-r--r-- | sys/arch/luna88k/dev/siotty.c | 21 | ||||
-rw-r--r-- | sys/arch/luna88k/dev/siovar.h | 17 |
4 files changed, 43 insertions, 32 deletions
diff --git a/sys/arch/luna88k/dev/lunaws.c b/sys/arch/luna88k/dev/lunaws.c index f2f87ba364d..12a05350d51 100644 --- a/sys/arch/luna88k/dev/lunaws.c +++ b/sys/arch/luna88k/dev/lunaws.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lunaws.c,v 1.12 2016/06/05 20:02:36 bru Exp $ */ +/* $OpenBSD: lunaws.c,v 1.13 2017/06/04 13:48:13 aoyama Exp $ */ /* $NetBSD: lunaws.c,v 1.6 2002/03/17 19:40:42 atatat Exp $ */ /*- @@ -118,7 +118,7 @@ const struct wsmouse_accessops omms_accessops = { }; #endif -void wsintr(int); +void wsintr(void *); int wsmatch(struct device *, void *, void *); void wsattach(struct device *, struct device *, void *); @@ -152,13 +152,15 @@ void wsattach(struct device *parent, struct device *self, void *aux) { struct ws_softc *sc = (struct ws_softc *)self; - struct sio_softc *scp = (struct sio_softc *)parent; + struct sio_softc *siosc = (struct sio_softc *)parent; struct sio_attach_args *args = aux; + int channel = args->channel; struct wskbddev_attach_args a; - sc->sc_ctl = (struct sioreg *)scp->scp_ctl + 1; - bcopy(ch1_regs, sc->sc_wr, sizeof(ch1_regs)); - scp->scp_intr[1] = wsintr; + sc->sc_ctl = &siosc->sc_ctl[channel]; + memcpy(sc->sc_wr, ch1_regs, sizeof(ch1_regs)); + siosc->sc_intrhand[channel].ih_func = wsintr; + siosc->sc_intrhand[channel].ih_arg = sc; setsioreg(sc->sc_ctl, WR0, sc->sc_wr[WR0]); setsioreg(sc->sc_ctl, WR4, sc->sc_wr[WR4]); @@ -216,9 +218,9 @@ ws_submatch_mouse(struct device *parent, void *match, void *aux) /*ARGSUSED*/ void -wsintr(int chan) +wsintr(void *arg) { - struct ws_softc *sc = ws_cd.cd_devs[0]; + struct ws_softc *sc = arg; struct sioreg *sio = sc->sc_ctl; u_int code; int rr; diff --git a/sys/arch/luna88k/dev/sio.c b/sys/arch/luna88k/dev/sio.c index 61f920b1e16..3a5d92ed0f4 100644 --- a/sys/arch/luna88k/dev/sio.c +++ b/sys/arch/luna88k/dev/sio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sio.c,v 1.5 2014/06/07 11:55:35 aoyama Exp $ */ +/* $OpenBSD: sio.c,v 1.6 2017/06/04 13:48:13 aoyama Exp $ */ /* $NetBSD: sio.c,v 1.1 2000/01/05 08:48:55 nisimura Exp $ */ /*- @@ -54,7 +54,7 @@ struct cfdriver sio_cd = { NULL, "sio", DV_DULL, 0 }; -void nullintr(int); +void nullintr(void *); int xsiointr(void *); int @@ -80,9 +80,9 @@ sio_attach(struct device *parent, struct device *self, void *aux) printf(": 7201a\n"); - sc->scp_ctl = (caddr_t)ma->ma_addr; - sc->scp_intr[0] = sc->scp_intr[1] = nullintr; + sc->sc_ctl = (void *)ma->ma_addr; for (channel = 0; channel < 2; channel++) { + sc->sc_intrhand[channel].ih_func = nullintr; sio_args.channel = channel; sio_args.hwflags = (channel == sysconsole); config_found(self, (void *)&sio_args, sio_print); @@ -111,11 +111,16 @@ xsiointr(void *arg) { struct sio_softc *sc = arg; - (*sc->scp_intr[0])(0); /* 0: ttya system serial port */ - (*sc->scp_intr[1])(1); /* 1: keyboard and mouse */ + /* channel 0: ttya system serial port */ + (*sc->sc_intrhand[0].ih_func)(sc->sc_intrhand[0].ih_arg); + + /* channel 1: keyboard and mouse */ + (*sc->sc_intrhand[1].ih_func)(sc->sc_intrhand[1].ih_arg); + return 1; } -void nullintr(int v) +void +nullintr(void *arg) { } diff --git a/sys/arch/luna88k/dev/siotty.c b/sys/arch/luna88k/dev/siotty.c index 3fc73b84b7b..2f36280c4e6 100644 --- a/sys/arch/luna88k/dev/siotty.c +++ b/sys/arch/luna88k/dev/siotty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siotty.c,v 1.18 2017/04/30 16:45:45 mpi Exp $ */ +/* $OpenBSD: siotty.c,v 1.19 2017/06/04 13:48:13 aoyama Exp $ */ /* $NetBSD: siotty.c,v 1.9 2002/03/17 19:40:43 atatat Exp $ */ /*- @@ -76,7 +76,7 @@ struct siotty_softc { cdev_decl(sio); void siostart(struct tty *); int sioparam(struct tty *, struct termios *); -void siottyintr(int); +void siottyintr(void *); int siomctl(struct siotty_softc *, int, int); int siotty_match(struct device *, void *, void *); @@ -103,13 +103,16 @@ siotty_match(struct device *parent, void *cf, void *aux) void siotty_attach(struct device *parent, struct device *self, void *aux) { - struct sio_softc *scp = (void *)parent; + struct sio_softc *siosc = (void *)parent; struct siotty_softc *sc = (void *)self; struct sio_attach_args *args = aux; + int channel; - sc->sc_ctl = (struct sioreg *)scp->scp_ctl + args->channel; - bcopy(ch0_regs, sc->sc_wr, sizeof(ch0_regs)); - scp->scp_intr[args->channel] = siottyintr; + channel = args->channel; + sc->sc_ctl = &siosc->sc_ctl[channel]; + memcpy(sc->sc_wr, ch0_regs, sizeof(ch0_regs)); + siosc->sc_intrhand[channel].ih_func = siottyintr; + siosc->sc_intrhand[channel].ih_arg = sc; if (args->hwflags == 1) { printf(" (console)"); @@ -133,7 +136,7 @@ siotty_attach(struct device *parent, struct device *self, void *aux) /*-------------------- low level routine --------------------*/ void -siottyintr(int chan) +siottyintr(void *arg) { struct siotty_softc *sc; struct sioreg *sio; @@ -141,9 +144,7 @@ siottyintr(int chan) unsigned int code; int rr; - if (chan >= siotty_cd.cd_ndevs) - return; - sc = siotty_cd.cd_devs[chan]; + sc = (struct siotty_softc *)arg; tp = sc->sc_tty; sio = sc->sc_ctl; rr = getsiocsr(sio); diff --git a/sys/arch/luna88k/dev/siovar.h b/sys/arch/luna88k/dev/siovar.h index 79a38b62ffc..ca28fbdfcbb 100644 --- a/sys/arch/luna88k/dev/siovar.h +++ b/sys/arch/luna88k/dev/siovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siovar.h,v 1.2 2008/06/26 05:42:11 ray Exp $ */ +/* $OpenBSD: siovar.h,v 1.3 2017/06/04 13:48:13 aoyama Exp $ */ /* $NetBSD: siovar.h,v 1.1 2000/01/05 08:48:55 nisimura Exp $ */ /*- @@ -30,12 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -struct sio_softc { - struct device scp_dev; - caddr_t scp_ctl; - void (*scp_intr[2])(int); -}; - struct sio_attach_args { int channel; int hwflags; @@ -49,5 +43,14 @@ struct sioreg { #define sio_stat sio_cmd }; +struct sio_softc { + struct device sc_dev; + struct sioreg *sc_ctl; + struct { + void (*ih_func)(void *); + void *ih_arg; + } sc_intrhand[2]; +}; + int getsiocsr(struct sioreg *); void setsioreg(struct sioreg *, int, int); |