Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/mv/mv_localbus.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Prototypes. | * Prototypes. | ||||
*/ | */ | ||||
static int localbus_probe(device_t); | static int localbus_probe(device_t); | ||||
static int localbus_attach(device_t); | static int localbus_attach(device_t); | ||||
static int localbus_print_child(device_t, device_t); | static int localbus_print_child(device_t, device_t); | ||||
static struct resource *localbus_alloc_resource(device_t, device_t, int, | static struct resource *localbus_alloc_resource(device_t, device_t, int, | ||||
int *, u_long, u_long, u_long, u_int); | int *, rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static struct resource_list *localbus_get_resource_list(device_t, device_t); | static struct resource_list *localbus_get_resource_list(device_t, device_t); | ||||
static ofw_bus_get_devinfo_t localbus_get_devinfo; | static ofw_bus_get_devinfo_t localbus_get_devinfo; | ||||
/* | /* | ||||
* Bus interface definition. | * Bus interface definition. | ||||
*/ | */ | ||||
static device_method_t localbus_methods[] = { | static device_method_t localbus_methods[] = { | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); | rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); | ||||
rv += bus_print_child_footer(dev, child); | rv += bus_print_child_footer(dev, child); | ||||
return (rv); | return (rv); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
localbus_alloc_resource(device_t bus, device_t child, int type, int *rid, | localbus_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 localbus_devinfo *di; | struct localbus_devinfo *di; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
/* | /* | ||||
* Request for the default allocation with a given rid: use resource | * Request for the default allocation with a given rid: use resource | ||||
* list stored in the local device info. | * list stored in the local device info. | ||||
*/ | */ | ||||
if ((start == 0UL) && (end == ~0UL)) { | if ((start == 0) && (end == ~0)) { | ||||
if ((di = device_get_ivars(child)) == NULL) | if ((di = device_get_ivars(child)) == NULL) | ||||
return (NULL); | return (NULL); | ||||
if (type == SYS_RES_IOPORT) | if (type == SYS_RES_IOPORT) | ||||
type = SYS_RES_MEMORY; | type = SYS_RES_MEMORY; | ||||
rid = &di->di_bank; | rid = &di->di_bank; | ||||
rle = resource_list_find(&di->di_res, type, *rid); | rle = resource_list_find(&di->di_res, type, *rid); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |