summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-07-03 20:11:49 +0000
committerimp <imp@FreeBSD.org>2004-07-03 20:11:49 +0000
commite1b4f764481e523a6e42927992ccd8901a5a6660 (patch)
treea69621a0594c216d2877b2198d0276b094a0342c /sys/i386/isa
parent7af2451eed7225fa8230e8a09a32a889d0ed560e (diff)
downloadFreeBSD-src-e1b4f764481e523a6e42927992ccd8901a5a6660.zip
FreeBSD-src-e1b4f764481e523a6e42927992ccd8901a5a6660.tar.gz
Don't define __RMAN_RESOURCE_VISISBLE. They aren't needed here after
I've converted the direct accessing of struct resource members to the preferred interface.
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/isa.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index 9ad1492..f09428f 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -147,6 +147,7 @@ isa_alloc_resourcev(device_t child, int type, int *rid,
device_t bus = device_get_parent(child);
bus_addr_t start;
+ bus_space_handle_t bh;
struct resource *re;
struct resource **bsre;
int i, j, k, linear_cnt, ressz, bsrid;
@@ -193,8 +194,9 @@ isa_alloc_resourcev(device_t child, int type, int *rid,
}
}
- re->r_bushandle->bsh_res = bsre;
- re->r_bushandle->bsh_ressz = ressz;
+ bh = rman_get_bushandle(re);
+ bh->bsh_res = bsre;
+ bh->bsh_ressz = ressz;
return re;
}
@@ -203,23 +205,25 @@ int
isa_load_resourcev(struct resource *re, bus_addr_t *res, bus_size_t count)
{
bus_addr_t start;
+ bus_space_handle_t bh;
int i;
- if (count > re->r_bushandle->bsh_maxiatsz) {
+ bh = rman_get_bushandle(re);
+ if (count > bh->bsh_maxiatsz) {
printf("isa_load_resourcev: map size too large\n");
return EINVAL;
}
start = rman_get_start(re);
- for (i = 0; i < re->r_bushandle->bsh_maxiatsz; i++) {
+ for (i = 0; i < bh->bsh_maxiatsz; i++) {
if (i < count)
- re->r_bushandle->bsh_iat[i] = start + res[i];
+ bh->bsh_iat[i] = start + res[i];
else
- re->r_bushandle->bsh_iat[i] = start;
+ bh->bsh_iat[i] = start;
}
- re->r_bushandle->bsh_iatsz = count;
- re->r_bushandle->bsh_bam = re->r_bustag->bs_ra; /* relocate access */
+ bh->bsh_iatsz = count;
+ bh->bsh_bam = rman_get_bustag(re)->bs_ra; /* relocate access */
return 0;
}
@@ -237,13 +241,15 @@ isa_release_resource(device_t bus, device_t child, int type, int rid,
* defined in sys/i386/include/bus_pc98.h.
*/
int i;
+ bus_space_handle_t bh;
if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
- for (i = 1; i < r->r_bushandle->bsh_ressz; i++)
+ bh = rman_get_bushandle(r);
+ for (i = 1; i < bh->bsh_ressz; i++)
resource_list_release(rl, bus, child, type, rid + i,
- r->r_bushandle->bsh_res[i]);
- if (r->r_bushandle->bsh_res != NULL)
- free(r->r_bushandle->bsh_res, M_DEVBUF);
+ bh->bsh_res[i]);
+ if (bh->bsh_res != NULL)
+ free(bh->bsh_res, M_DEVBUF);
}
#endif
return resource_list_release(rl, bus, child, type, rid, r);
OpenPOWER on IntegriCloud