Hi,
yesterday I reported a bug in the resource allocator
for PnP ISA devices:
The align-field is ignored for IO port resources, e.g.
device A wants io range 0x100-0x3ff, size=0x1, align=0x1
device B wants io range 0x100-0x3f7, size=0x8, align=0x8
device A gets assigned first and will receive
at port 0x100 on isa0
device B will then receive
at port 0x101-0x108
I have somewhat debug the code and found out that the
loop in isa_find_port() [/sys/isa/isa_common.c] is
totally useless. The first call to
bus_alloc_resource() there will succeed, because the
major work of resource allocation (including searching
for an alternate region) will be done in
rman_reserve_resource() [/sys/kern/subr_rman.c], which
doesn\'t know of any alignment constraints.
I haven\'t tested it, but shouldn\'t the code in
isa_find_port() be something like below? I will test
it tonight, though.
Daniel
--- isa_common.c.orig Thu Dec 16 18:27:23 1999
+++ isa_common.cThu Dec 16 18:27:25 1999
@@ -205,7 +205,8 @@
start, size);
res[i] = bus_alloc_resource(child,
SYS_RES_IOPORT, &i,
- 0, ~0, 1, RF_ACTIVE);
+ start, start + size - 1,
+ 1, RF_ACTIVE);
if (res[i]) {
result->ic_port[i].ir_start = start;
result->ic_port[i].ir_end = start + size - 1;