Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sparc64/pci/apb.c
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
apb_map_print(uint8_t map, rman_res_t scale) | apb_map_print(uint8_t map, rman_res_t scale) | ||||
{ | { | ||||
int i, first; | int i, first; | ||||
for (first = 1, i = 0; i < 8; i++) { | for (first = 1, i = 0; i < 8; i++) { | ||||
if ((map & (1 << i)) != 0) { | if ((map & (1 << i)) != 0) { | ||||
printf("%s0x%lx-0x%lx", first ? "" : ", ", | printf("%s0x%jx-0x%jx", first ? "" : ", ", | ||||
i * scale, (i + 1) * scale - 1); | i * scale, (i + 1) * scale - 1); | ||||
first = 0; | first = 0; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
apb_checkrange(uint8_t map, rman_res_t scale, rman_res_t start, rman_res_t end) | apb_checkrange(uint8_t map, rman_res_t scale, rman_res_t start, rman_res_t end) | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | apb_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
* Fail the allocation for this range if it's not supported. | * Fail the allocation for this range if it's not supported. | ||||
* XXX we should probably just fix up the bridge decode and | * XXX we should probably just fix up the bridge decode and | ||||
* soldier on. | * soldier on. | ||||
*/ | */ | ||||
switch (type) { | switch (type) { | ||||
case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
if (!apb_checkrange(sc->sc_iomap, APB_IO_SCALE, start, end)) { | if (!apb_checkrange(sc->sc_iomap, APB_IO_SCALE, start, end)) { | ||||
device_printf(dev, "device %s requested unsupported " | device_printf(dev, "device %s requested unsupported " | ||||
"I/O range 0x%lx-0x%lx\n", | "I/O range 0x%jx-0x%jx\n", | ||||
device_get_nameunit(child), start, end); | device_get_nameunit(child), start, end); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
if (bootverbose) | if (bootverbose) | ||||
device_printf(sc->sc_bsc.ops_pcib_sc.dev, "device " | device_printf(sc->sc_bsc.ops_pcib_sc.dev, "device " | ||||
"%s requested decoded I/O range 0x%lx-0x%lx\n", | "%s requested decoded I/O range 0x%jx-0x%jx\n", | ||||
device_get_nameunit(child), start, end); | device_get_nameunit(child), start, end); | ||||
break; | break; | ||||
case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, | if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, | ||||
end)) { | end)) { | ||||
device_printf(dev, "device %s requested unsupported " | device_printf(dev, "device %s requested unsupported " | ||||
"memory range 0x%lx-0x%lx\n", | "memory range 0x%jx-0x%jx\n", | ||||
device_get_nameunit(child), start, end); | device_get_nameunit(child), start, end); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
if (bootverbose) | if (bootverbose) | ||||
device_printf(sc->sc_bsc.ops_pcib_sc.dev, "device " | device_printf(sc->sc_bsc.ops_pcib_sc.dev, "device " | ||||
"%s requested decoded memory range 0x%lx-0x%lx\n", | "%s requested decoded memory range 0x%jx-0x%jx\n", | ||||
device_get_nameunit(child), start, end); | device_get_nameunit(child), start, end); | ||||
break; | break; | ||||
} | } | ||||
passup: | passup: | ||||
/* | /* | ||||
* Bridge is OK decoding this resource, so pass it up. | * Bridge is OK decoding this resource, so pass it up. | ||||
*/ | */ | ||||
Show All 23 Lines |