diff options
author | marius <marius@FreeBSD.org> | 2004-08-11 21:19:31 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2004-08-11 21:19:31 +0000 |
commit | 4ae1646ed50046da7ff680f91145c7f0a4233c89 (patch) | |
tree | 39cfc105dfce653b68422ed250b593311bcfe71d /sys/dev/pcf | |
parent | 12f47e5a96e5c45ab2226b047ff6cda4c6c88ed7 (diff) | |
download | FreeBSD-src-4ae1646ed50046da7ff680f91145c7f0a4233c89.zip FreeBSD-src-4ae1646ed50046da7ff680f91145c7f0a4233c89.tar.gz |
Unbreak after struct resource was hidden. Tested with EBus front-end on
Sun AXe board.
Diffstat (limited to 'sys/dev/pcf')
-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 b0fb96d..74d87c7 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 e88519a..13b8110 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 6add1ef..a4a2a50 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 258cfb7..ed4d9d8 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); |