diff options
author | Marius Strobl <marius@FreeBSD.org> | 2004-08-11 21:19:31 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2004-08-11 21:19:31 +0000 |
commit | 490a46bf68d240953b091232c755ed5526e931b9 (patch) | |
tree | 39cfc105dfce653b68422ed250b593311bcfe71d | |
parent | a4954466bdeed39eb97b96a9b4dc6761b06e9f5a (diff) |
Notes
-rw-r--r-- | sys/dev/pcf/envctrl.c | 2 | ||||
-rw-r--r-- | sys/dev/pcf/pcf_ebus.c | 2 | ||||
-rw-r--r-- | sys/dev/pcf/pcf_isa.c | 2 | ||||
-rw-r--r-- | sys/dev/pcf/pcfvar.h | 28 |
4 files changed, 19 insertions, 15 deletions
diff --git a/sys/dev/pcf/envctrl.c b/sys/dev/pcf/envctrl.c index b0fb96daeb51..74d87c7ac69e 100644 --- a/sys/dev/pcf/envctrl.c +++ b/sys/dev/pcf/envctrl.c @@ -118,6 +118,8 @@ envctrl_attach(device_t dev) device_printf(dev, "cannot reserve I/O port range\n"); goto error; } + sc->bt_ioport = rman_get_bustag(sc->res_ioport); + sc->bh_ioport = rman_get_bushandle(sc->res_ioport); sc->pcf_flags = device_get_flags(dev); diff --git a/sys/dev/pcf/pcf_ebus.c b/sys/dev/pcf/pcf_ebus.c index e88519af81b0..13b81102095f 100644 --- a/sys/dev/pcf/pcf_ebus.c +++ b/sys/dev/pcf/pcf_ebus.c @@ -158,6 +158,8 @@ pcf_ebus_attach(device_t dev) device_printf(dev, "cannot reserve I/O port range\n"); goto error; } + sc->bt_ioport = rman_get_bustag(sc->res_ioport); + sc->bh_ioport = rman_get_bushandle(sc->res_ioport); sc->pcf_flags = device_get_flags(dev); diff --git a/sys/dev/pcf/pcf_isa.c b/sys/dev/pcf/pcf_isa.c index 6add1efc069d..a4a2a5099f53 100644 --- a/sys/dev/pcf/pcf_isa.c +++ b/sys/dev/pcf/pcf_isa.c @@ -132,6 +132,8 @@ pcf_isa_attach(device_t dev) device_printf(dev, "cannot reserve I/O port range\n"); goto error; } + sc->bt_ioport = rman_get_bustag(sc->res_ioport); + sc->bh_ioport = rman_get_bushandle(sc->res_ioport); sc->pcf_flags = device_get_flags(dev); diff --git a/sys/dev/pcf/pcfvar.h b/sys/dev/pcf/pcfvar.h index 258cfb76eda1..ed4d9d8cb9a9 100644 --- a/sys/dev/pcf/pcfvar.h +++ b/sys/dev/pcf/pcfvar.h @@ -66,11 +66,13 @@ struct pcf_softc { device_t iicbus; /* the corresponding iicbus */ /* Resource handling stuff. */ - void *intr_cookie; - int rid_ioport; - int rid_irq; - struct resource *res_ioport; - struct resource *res_irq; + struct resource *res_ioport; + int rid_ioport; + bus_space_tag_t bt_ioport; + bus_space_handle_t bh_ioport; + struct resource *res_irq; + int rid_irq; + void *intr_cookie; }; #define DEVTOSOFTC(dev) ((struct pcf_softc *)device_get_softc(dev)) @@ -89,18 +91,16 @@ struct pcf_softc { static __inline void pcf_set_S0(struct pcf_softc *sc, int data) { - bus_space_write_1(sc->res_ioport->r_bustag, - sc->res_ioport->r_bushandle, - 0, data); + + bus_space_write_1(sc->bt_ioport, sc->bh_ioport, 0, data); pcf_nops(); } static __inline void pcf_set_S1(struct pcf_softc *sc, int data) { - bus_space_write_1(sc->res_ioport->r_bustag, - sc->res_ioport->r_bushandle, - 1, data); + + bus_space_write_1(sc->bt_ioport, sc->bh_ioport, 1, data); pcf_nops(); } @@ -109,8 +109,7 @@ pcf_get_S0(struct pcf_softc *sc) { char data; - data = bus_space_read_1(sc->res_ioport->r_bustag, - sc->res_ioport->r_bushandle, 0); + data = bus_space_read_1(sc->bt_ioport, sc->bh_ioport, 0); pcf_nops(); return (data); @@ -121,8 +120,7 @@ pcf_get_S1(struct pcf_softc *sc) { char data; - data = bus_space_read_1(sc->res_ioport->r_bustag, - sc->res_ioport->r_bushandle, 1); + data = bus_space_read_1(sc->bt_ioport, sc->bh_ioport, 1); pcf_nops(); return (data); |