Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/rc/rc.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
for (i = 0; i < IOBASE_ADDRS; i++) | for (i = 0; i < IOBASE_ADDRS; i++) | ||||
if (bus_set_resource(dev, SYS_RES_IOPORT, i, | if (bus_set_resource(dev, SYS_RES_IOPORT, i, | ||||
port + iobase_addrs[i], 0x10) != 0) | port + iobase_addrs[i], 0x10) != 0) | ||||
return (ENXIO); | return (ENXIO); | ||||
error = ENOMEM; | error = ENOMEM; | ||||
for (i = 0; i < IOBASE_ADDRS; i++) { | for (i = 0; i < IOBASE_ADDRS; i++) { | ||||
x = i; | x = i; | ||||
sc->sc_port[i] = bus_alloc_resource(dev, SYS_RES_IOPORT, &x, | sc->sc_port[i] = bus_alloc_resource(dev, SYS_RES_IOPORT, &x, | ||||
0ul, ~0ul, 0x10, RF_ACTIVE); | 0, ~0, 0x10, RF_ACTIVE); | ||||
if (x != i) { | if (x != i) { | ||||
device_printf(dev, "ioport %d was rid %d\n", i, x); | device_printf(dev, "ioport %d was rid %d\n", i, x); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
if (sc->sc_port[i] == NULL) { | if (sc->sc_port[i] == NULL) { | ||||
device_printf(dev, "failed to alloc ioports %x-%x\n", | device_printf(dev, "failed to alloc ioports %x-%x\n", | ||||
port + iobase_addrs[i], | port + iobase_addrs[i], | ||||
port + iobase_addrs[i] + 0x10); | port + iobase_addrs[i] + 0x10); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |