Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ofw/ofwbus.c
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | if (ofw_bus_gen_setup_devinfo(&obd, node) != 0) | ||||
continue; | continue; | ||||
simplebus_add_device(dev, node, 0, NULL, -1, NULL); | simplebus_add_device(dev, node, 0, NULL, -1, NULL); | ||||
} | } | ||||
return (bus_generic_attach(dev)); | return (bus_generic_attach(dev)); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid, | ofwbus_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 ofwbus_softc *sc; | struct ofwbus_softc *sc; | ||||
struct rman *rm; | struct rman *rm; | ||||
struct resource *rv; | struct resource *rv; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
int isdefault, passthrough; | int isdefault, passthrough; | ||||
isdefault = (start == 0UL && end == ~0UL); | isdefault = (start == 0UL && end == ~0UL); | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (!passthrough && rle != NULL) { | ||||
rle->count = rle->end - rle->start + 1; | rle->count = rle->end - rle->start + 1; | ||||
} | } | ||||
return (rv); | return (rv); | ||||
} | } | ||||
static int | static int | ||||
ofwbus_adjust_resource(device_t bus, device_t child __unused, int type, | ofwbus_adjust_resource(device_t bus, device_t child __unused, int type, | ||||
struct resource *r, u_long start, u_long end) | struct resource *r, rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
struct ofwbus_softc *sc; | struct ofwbus_softc *sc; | ||||
struct rman *rm; | struct rman *rm; | ||||
device_t ofwbus; | device_t ofwbus; | ||||
ofwbus = bus; | ofwbus = bus; | ||||
while (strcmp(device_get_name(device_get_parent(ofwbus)), "root") != 0) | while (strcmp(device_get_name(device_get_parent(ofwbus)), "root") != 0) | ||||
ofwbus = device_get_parent(ofwbus); | ofwbus = device_get_parent(ofwbus); | ||||
Show All 37 Lines |