Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/mpc85xx/lbc.c
Context not available. | |||||
static int lbc_attach(device_t); | static int lbc_attach(device_t); | ||||
static int lbc_shutdown(device_t); | static int lbc_shutdown(device_t); | ||||
static struct resource *lbc_alloc_resource(device_t, device_t, int, int *, | static struct resource *lbc_alloc_resource(device_t, device_t, int, int *, | ||||
u_long, u_long, u_long, u_int); | rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static int lbc_print_child(device_t, device_t); | static int lbc_print_child(device_t, device_t); | ||||
static int lbc_release_resource(device_t, device_t, int, int, | static int lbc_release_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
Context not available. | |||||
{ | { | ||||
int n = 15; | int n = 15; | ||||
if (size == ~0UL) | if (size == ~0) | ||||
return (0); | return (0); | ||||
while (n < 32) { | while (n < 32) { | ||||
Context not available. | |||||
rm = &sc->sc_rman; | rm = &sc->sc_rman; | ||||
rm->rm_type = RMAN_ARRAY; | rm->rm_type = RMAN_ARRAY; | ||||
rm->rm_descr = "Local Bus Space"; | rm->rm_descr = "Local Bus Space"; | ||||
rm->rm_start = 0UL; | rm->rm_start = 0; | ||||
rm->rm_end = ~0UL; | rm->rm_end = ~0; | ||||
error = rman_init(rm); | error = rman_init(rm); | ||||
if (error) | if (error) | ||||
goto fail; | goto fail; | ||||
Context not available. | |||||
static struct resource * | static struct resource * | ||||
lbc_alloc_resource(device_t bus, device_t child, int type, int *rid, | lbc_alloc_resource(device_t bus, 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 lbc_softc *sc; | struct lbc_softc *sc; | ||||
struct lbc_devinfo *di; | struct lbc_devinfo *di; | ||||
Context not available. | |||||
int needactivate; | int needactivate; | ||||
/* We only support default allocations. */ | /* We only support default allocations. */ | ||||
if (start != 0ul || end != ~0ul) | if (start != 0 || end != ~0) | ||||
return (NULL); | return (NULL); | ||||
sc = device_get_softc(bus); | sc = device_get_softc(bus); | ||||
Context not available. | |||||
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); | ||||
} | } | ||||
Context not available. | |||||
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); | ||||
Context not available. |