diff options
author | jhb <jhb@FreeBSD.org> | 2008-06-06 18:29:56 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-06-06 18:29:56 +0000 |
commit | 8d2a500ba59f81e6597a356c696219e4b5cffa44 (patch) | |
tree | 6f9d08409ea9bce0041bfb7f00f5f9aca04893e7 /sys/pci | |
parent | b78502eaeea24f85d4c6e7f828b238179d636a21 (diff) | |
download | FreeBSD-src-8d2a500ba59f81e6597a356c696219e4b5cffa44.zip FreeBSD-src-8d2a500ba59f81e6597a356c696219e4b5cffa44.tar.gz |
- Use bus_foo() rather than bus_space_foo() and remove bus space tag/handle
from softc.
- Mark interrupt handlers MPSAFE as these drivers have been locked for a
while.
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/amdpm.c | 12 | ||||
-rw-r--r-- | sys/pci/amdsmb.c | 8 | ||||
-rw-r--r-- | sys/pci/intpm.c | 4 | ||||
-rw-r--r-- | sys/pci/nfsmb.c | 10 | ||||
-rw-r--r-- | sys/pci/viapm.c | 12 |
5 files changed, 13 insertions, 33 deletions
diff --git a/sys/pci/amdpm.c b/sys/pci/amdpm.c index f8ec9c5..63b8fe1 100644 --- a/sys/pci/amdpm.c +++ b/sys/pci/amdpm.c @@ -123,8 +123,6 @@ struct amdpm_softc { int base; int rid; struct resource *res; - bus_space_tag_t smbst; - bus_space_handle_t smbsh; device_t smbus; struct mtx lock; }; @@ -134,13 +132,13 @@ struct amdpm_softc { #define AMDPM_LOCK_ASSERT(amdpm) mtx_assert(&(amdpm)->lock, MA_OWNED) #define AMDPM_SMBINB(amdpm,register) \ - (bus_space_read_1(amdpm->smbst, amdpm->smbsh, register)) + (bus_read_1(amdpm->res, register)) #define AMDPM_SMBOUTB(amdpm,register,value) \ - (bus_space_write_1(amdpm->smbst, amdpm->smbsh, register, value)) + (bus_write_1(amdpm->res, register, value)) #define AMDPM_SMBINW(amdpm,register) \ - (bus_space_read_2(amdpm->smbst, amdpm->smbsh, register)) + (bus_read_2(amdpm->res, register)) #define AMDPM_SMBOUTW(amdpm,register,value) \ - (bus_space_write_2(amdpm->smbst, amdpm->smbsh, register, value)) + (bus_write_2(amdpm->res, register, value)) static int amdpm_detach(device_t dev); @@ -213,8 +211,6 @@ amdpm_attach(device_t dev) return (ENXIO); } - amdpm_sc->smbst = rman_get_bustag(amdpm_sc->res); - amdpm_sc->smbsh = rman_get_bushandle(amdpm_sc->res); mtx_init(&amdpm_sc->lock, device_get_nameunit(dev), "amdpm", MTX_DEF); /* Allocate a new smbus device */ diff --git a/sys/pci/amdsmb.c b/sys/pci/amdsmb.c index ecf4fcc..264b11a 100644 --- a/sys/pci/amdsmb.c +++ b/sys/pci/amdsmb.c @@ -110,8 +110,6 @@ static int amdsmb_debug = 0; struct amdsmb_softc { int rid; struct resource *res; - bus_space_tag_t smbst; - bus_space_handle_t smbsh; device_t smbus; struct mtx lock; }; @@ -121,9 +119,9 @@ struct amdsmb_softc { #define AMDSMB_LOCK_ASSERT(amdsmb) mtx_assert(&(amdsmb)->lock, MA_OWNED) #define AMDSMB_ECINB(amdsmb, register) \ - (bus_space_read_1(amdsmb->smbst, amdsmb->smbsh, register)) + (bus_read_1(amdsmb->res, register)) #define AMDSMB_ECOUTB(amdsmb, register, value) \ - (bus_space_write_1(amdsmb->smbst, amdsmb->smbsh, register, value)) + (bus_write_1(amdsmb->res, register, value)) static int amdsmb_detach(device_t dev); @@ -163,8 +161,6 @@ amdsmb_attach(device_t dev) return (ENXIO); } - amdsmb_sc->smbst = rman_get_bustag(amdsmb_sc->res); - amdsmb_sc->smbsh = rman_get_bushandle(amdsmb_sc->res); mtx_init(&amdsmb_sc->lock, device_get_nameunit(dev), "amdsmb", MTX_DEF); /* Allocate a new smbus device */ diff --git a/sys/pci/intpm.c b/sys/pci/intpm.c index 3cae6cc..6b71183 100644 --- a/sys/pci/intpm.c +++ b/sys/pci/intpm.c @@ -160,8 +160,8 @@ intsmb_attach(device_t dev) goto fail; } - error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, NULL, - intsmb_rawintr, sc, &sc->irq_hand); + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, intsmb_rawintr, sc, &sc->irq_hand); if (error) { device_printf(dev, "Failed to map intr\n"); goto fail; diff --git a/sys/pci/nfsmb.c b/sys/pci/nfsmb.c index 4545818..570cd50 100644 --- a/sys/pci/nfsmb.c +++ b/sys/pci/nfsmb.c @@ -111,8 +111,6 @@ static int nfsmb_debug = 0; struct nfsmb_softc { int rid; struct resource *res; - bus_space_tag_t smbst; - bus_space_handle_t smbsh; device_t smbus; device_t subdev; struct mtx lock; @@ -123,9 +121,9 @@ struct nfsmb_softc { #define NFSMB_LOCK_ASSERT(nfsmb) mtx_assert(&(nfsmb)->lock, MA_OWNED) #define NFSMB_SMBINB(nfsmb, register) \ - (bus_space_read_1(nfsmb->smbst, nfsmb->smbsh, register)) + (bus_read_1(nfsmb->res, register)) #define NFSMB_SMBOUTB(nfsmb, register, value) \ - (bus_space_write_1(nfsmb->smbst, nfsmb->smbsh, register, value)) + (bus_write_1(nfsmb->res, register, value)) static int nfsmb_detach(device_t dev); static int nfsmbsub_detach(device_t dev); @@ -188,8 +186,6 @@ nfsmbsub_attach(device_t dev) return (ENXIO); } } - nfsmbsub_sc->smbst = rman_get_bustag(nfsmbsub_sc->res); - nfsmbsub_sc->smbsh = rman_get_bushandle(nfsmbsub_sc->res); mtx_init(&nfsmbsub_sc->lock, device_get_nameunit(dev), "nfsmb", MTX_DEF); @@ -226,8 +222,6 @@ nfsmb_attach(device_t dev) } } - nfsmb_sc->smbst = rman_get_bustag(nfsmb_sc->res); - nfsmb_sc->smbsh = rman_get_bushandle(nfsmb_sc->res); mtx_init(&nfsmb_sc->lock, device_get_nameunit(dev), "nfsmb", MTX_DEF); /* Allocate a new smbus device */ diff --git a/sys/pci/viapm.c b/sys/pci/viapm.c index d9305e2..4e04593 100644 --- a/sys/pci/viapm.c +++ b/sys/pci/viapm.c @@ -73,9 +73,9 @@ static int viapm_debug = 0; #define VIA_CX700_PMU_ID 0x83241106 #define VIAPM_INB(port) \ - ((u_char)bus_space_read_1(viapm->st, viapm->sh, port)) + ((u_char)bus_read_1(viapm->iores, port)) #define VIAPM_OUTB(port,val) \ - (bus_space_write_1(viapm->st, viapm->sh, port, (u_char)(val))) + (bus_write_1(viapm->iores, port, (u_char)(val))) #define VIAPM_TYP_UNKNOWN 0 #define VIAPM_TYP_586B_3040E 1 @@ -91,8 +91,6 @@ static int viapm_debug = 0; struct viapm_softc { int type; u_int32_t base; - bus_space_tag_t st; - bus_space_handle_t sh; int iorid; int irqrid; struct resource *iores; @@ -347,8 +345,6 @@ viapm_pro_attach(device_t dev) device_printf(dev, "could not allocate bus space\n"); goto error; } - viapm->st = rman_get_bustag(viapm->iores); - viapm->sh = rman_get_bushandle(viapm->iores); #ifdef notyet /* force irq 9 */ @@ -363,7 +359,7 @@ viapm_pro_attach(device_t dev) goto error; } - if (bus_setup_intr(dev, viapm->irqres, INTR_TYPE_MISC, + if (bus_setup_intr(dev, viapm->irqres, INTR_TYPE_MISC | INTR_MPSAFE, (driver_intr_t *) viasmb_intr, viapm, &viapm->irqih)) { device_printf(dev, "could not setup irq\n"); goto error; @@ -423,8 +419,6 @@ viapm_586b_attach(device_t dev) device_printf(dev, "could not allocate bus resource\n"); goto error; } - viapm->st = rman_get_bustag(viapm->iores); - viapm->sh = rman_get_bushandle(viapm->iores); VIAPM_OUTB(GPIO_DIR, VIAPM_INB(GPIO_DIR) | VIAPM_SCL | VIAPM_SDA); |