Changeset View
Changeset View
Standalone View
Standalone View
sys/sparc64/pci/apb.c
Context not available. | |||||
} | } | ||||
static void | static void | ||||
apb_map_print(uint8_t map, u_long 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; | ||||
} | } | ||||
Context not available. | |||||
} | } | ||||
static int | static int | ||||
apb_checkrange(uint8_t map, u_long scale, u_long start, u_long end) | apb_checkrange(uint8_t map, rman_res_t scale, rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
int i, ei; | int i, ei; | ||||
Context not available. | |||||
*/ | */ | ||||
static struct resource * | static struct resource * | ||||
apb_alloc_resource(device_t dev, device_t child, int type, int *rid, | apb_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct apb_softc *sc; | struct apb_softc *sc; | ||||
Context not available. | |||||
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: | ||||
Context not available. | |||||
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; | ||||
} | } | ||||
Context not available. | |||||
static int | static int | ||||
apb_adjust_resource(device_t dev, device_t child, int type, | apb_adjust_resource(device_t dev, device_t child, int type, | ||||
struct resource *r, u_long start, u_long end) | struct resource *r, rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
struct apb_softc *sc; | struct apb_softc *sc; | ||||
Context not available. |