Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/pccard/pccard.c
Show First 20 Lines • Show All 500 Lines • ▼ Show 20 Lines | if (entry != -1 && cfe->number != entry) | ||||
continue; | continue; | ||||
spaces = 0; | spaces = 0; | ||||
for (i = 0; i < cfe->num_iospace; i++) { | for (i = 0; i < cfe->num_iospace; i++) { | ||||
ios = cfe->iospace + i; | ios = cfe->iospace + i; | ||||
start = ios->start; | start = ios->start; | ||||
if (start) | if (start) | ||||
end = start + ios->length - 1; | end = start + ios->length - 1; | ||||
else | else | ||||
end = ~0UL; | end = ~0; | ||||
DEVPRINTF((bus, "I/O rid %d start %#lx end %#lx\n", | DEVPRINTF((bus, "I/O rid %d start %#lx end %#lx\n", | ||||
i, start, end)); | i, start, end)); | ||||
rid = i; | rid = i; | ||||
len = ios->length; | len = ios->length; | ||||
r = bus_alloc_resource(bus, SYS_RES_IOPORT, &rid, | r = bus_alloc_resource(bus, SYS_RES_IOPORT, &rid, | ||||
start, end, len, rman_make_alignment_flags(len)); | start, end, len, rman_make_alignment_flags(len)); | ||||
if (r == NULL) { | if (r == NULL) { | ||||
DEVPRINTF((bus, "I/O rid %d failed\n", i)); | DEVPRINTF((bus, "I/O rid %d failed\n", i)); | ||||
goto not_this_one; | goto not_this_one; | ||||
} | } | ||||
rle = resource_list_add(rl, SYS_RES_IOPORT, | rle = resource_list_add(rl, SYS_RES_IOPORT, | ||||
rid, rman_get_start(r), rman_get_end(r), len); | rid, rman_get_start(r), rman_get_end(r), len); | ||||
if (rle == NULL) | if (rle == NULL) | ||||
panic("Cannot add resource rid %d IOPORT", rid); | panic("Cannot add resource rid %d IOPORT", rid); | ||||
rle->res = r; | rle->res = r; | ||||
spaces++; | spaces++; | ||||
} | } | ||||
for (i = 0; i < cfe->num_memspace; i++) { | for (i = 0; i < cfe->num_memspace; i++) { | ||||
mems = cfe->memspace + i; | mems = cfe->memspace + i; | ||||
start = mems->cardaddr + mems->hostaddr; | start = mems->cardaddr + mems->hostaddr; | ||||
if (start) | if (start) | ||||
end = start + mems->length - 1; | end = start + mems->length - 1; | ||||
else | else | ||||
end = ~0UL; | end = ~0; | ||||
DEVPRINTF((bus, "Memory rid %d start %#lx end %#lx\ncardaddr %#lx hostaddr %#lx length %#lx\n", | DEVPRINTF((bus, "Memory rid %d start %#lx end %#lx\ncardaddr %#lx hostaddr %#lx length %#lx\n", | ||||
i, start, end, mems->cardaddr, mems->hostaddr, | i, start, end, mems->cardaddr, mems->hostaddr, | ||||
mems->length)); | mems->length)); | ||||
rid = i; | rid = i; | ||||
len = mems->length; | len = mems->length; | ||||
r = bus_alloc_resource(bus, SYS_RES_MEMORY, &rid, | r = bus_alloc_resource(bus, SYS_RES_MEMORY, &rid, | ||||
start, end, len, rman_make_alignment_flags(len)); | start, end, len, rman_make_alignment_flags(len)); | ||||
if (r == NULL) { | if (r == NULL) { | ||||
▲ Show 20 Lines • Show All 952 Lines • Show Last 20 Lines |