summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2001-06-17 13:33:59 +0000
committernyan <nyan@FreeBSD.org>2001-06-17 13:33:59 +0000
commit8e35240c43f78457f1e56ef36509b71eba711625 (patch)
treebba111950997e3003019c1d4c30558240f6ea256 /sys/amd64
parent258cf0e7e257bdb262f71181e9b666092a9531a9 (diff)
downloadFreeBSD-src-8e35240c43f78457f1e56ef36509b71eba711625.zip
FreeBSD-src-8e35240c43f78457f1e56ef36509b71eba711625.tar.gz
Don't assume that resource type is ioport and rid equal 0.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/isa/isa.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c
index 3c7ecb9..1fd0c3c 100644
--- a/sys/amd64/isa/isa.c
+++ b/sys/amd64/isa/isa.c
@@ -141,12 +141,12 @@ isa_alloc_resourcev(device_t child, int type, int *rid,
struct resource_list *rl = &idev->id_resources;
device_t bus = device_get_parent(child);
- bus_addr_t ioport;
+ bus_addr_t start;
struct resource *re;
struct resource **bsre;
int i, j, k, linear_cnt, ressz, bsrid;
- ioport = bus_get_resource_start(child, SYS_RES_IOPORT, 0);
+ start = bus_get_resource_start(child, type, *rid);
linear_cnt = count;
ressz = 1;
@@ -158,8 +158,9 @@ isa_alloc_resourcev(device_t child, int type, int *rid,
}
}
- re = isa_alloc_resource(bus, child, type, rid, ioport + res[0],
- ioport + res[linear_cnt - 1], linear_cnt, flags);
+ re = isa_alloc_resource(bus, child, type, rid,
+ start + res[0], start + res[linear_cnt - 1],
+ linear_cnt, flags);
if (re == NULL)
return NULL;
@@ -177,7 +178,7 @@ isa_alloc_resourcev(device_t child, int type, int *rid,
}
bsrid = *rid + k;
bsre[k] = isa_alloc_resource(bus, child, type, &bsrid,
- ioport + res[i], ioport + res[j - 1], j - i, flags);
+ start + res[i], start + res[j - 1], j - i, flags);
if (bsre[k] == NULL) {
for (k--; k >= 0; k--)
resource_list_release(rl, bus, child, type,
OpenPOWER on IntegriCloud