Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/mpc85xx/lbc.c
Show First 20 Lines • Show All 712 Lines • ▼ Show 20 Lines | lbc_alloc_resource(device_t bus, device_t child, int type, int *rid, | ||||
needactivate = flags & RF_ACTIVE; | needactivate = flags & RF_ACTIVE; | ||||
flags &= ~RF_ACTIVE; | flags &= ~RF_ACTIVE; | ||||
rm = &sc->sc_rman; | rm = &sc->sc_rman; | ||||
res = rman_reserve_resource(rm, start, end, count, flags, child); | res = rman_reserve_resource(rm, start, end, count, flags, child); | ||||
if (res == NULL) { | if (res == NULL) { | ||||
device_printf(bus, "failed to reserve resource %#lx - %#lx " | device_printf(bus, "failed to reserve resource %#jx - %#jx " | ||||
"(%#lx)\n", start, end, count); | "(%#jx)\n", start, end, count); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
rman_set_rid(res, *rid); | rman_set_rid(res, *rid); | ||||
rman_set_bustag(res, &bs_be_tag); | rman_set_bustag(res, &bs_be_tag); | ||||
rman_set_bushandle(res, rman_get_start(res)); | rman_set_bushandle(res, rman_get_start(res)); | ||||
if (needactivate) | if (needactivate) | ||||
Show All 13 Lines | lbc_print_child(device_t dev, device_t child) | ||||
struct resource_list *rl; | struct resource_list *rl; | ||||
int rv; | int rv; | ||||
di = device_get_ivars(child); | di = device_get_ivars(child); | ||||
rl = &di->di_res; | rl = &di->di_res; | ||||
rv = 0; | rv = 0; | ||||
rv += bus_print_child_header(dev, child); | rv += bus_print_child_header(dev, child); | ||||
rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); | rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); | ||||
rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); | rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); | ||||
rv += bus_print_child_footer(dev, child); | rv += bus_print_child_footer(dev, child); | ||||
return (rv); | return (rv); | ||||
} | } | ||||
static int | static int | ||||
lbc_release_resource(device_t dev, device_t child, int type, int rid, | lbc_release_resource(device_t dev, device_t child, int type, int rid, | ||||
struct resource *res) | struct resource *res) | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |