Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/mips/nexus.c
Show First 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, | ||||
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct nexus_device *ndev = DEVTONX(child); | struct nexus_device *ndev = DEVTONX(child); | ||||
struct resource *rv; | struct resource *rv; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
struct rman *rm; | struct rman *rm; | ||||
int isdefault, needactivate, passthrough; | int isdefault, needactivate, passthrough; | ||||
dprintf("%s: entry (%p, %p, %d, %p, %p, %p, %ld, %d)\n", | dprintf("%s: entry (%p, %p, %d, %p, %p, %p, %jd, %d)\n", | ||||
__func__, bus, child, type, rid, (void *)(intptr_t)start, | __func__, bus, child, type, rid, (void *)(intptr_t)start, | ||||
(void *)(intptr_t)end, count, flags); | (void *)(intptr_t)end, count, flags); | ||||
dprintf("%s: requested rid is %d\n", __func__, *rid); | dprintf("%s: requested rid is %d\n", __func__, *rid); | ||||
isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); | isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); | ||||
needactivate = flags & RF_ACTIVE; | needactivate = flags & RF_ACTIVE; | ||||
passthrough = (device_get_parent(child) != bus); | passthrough = (device_get_parent(child) != bus); | ||||
rle = NULL; | rle = NULL; | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
nexus_set_resource(device_t dev, device_t child, int type, int rid, | nexus_set_resource(device_t dev, device_t child, int type, int rid, | ||||
rman_res_t start, rman_res_t count) | rman_res_t start, rman_res_t count) | ||||
{ | { | ||||
struct nexus_device *ndev = DEVTONX(child); | struct nexus_device *ndev = DEVTONX(child); | ||||
struct resource_list *rl = &ndev->nx_resources; | struct resource_list *rl = &ndev->nx_resources; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
dprintf("%s: entry (%p, %p, %d, %d, %p, %ld)\n", | dprintf("%s: entry (%p, %p, %d, %d, %p, %jd)\n", | ||||
__func__, dev, child, type, rid, (void *)(intptr_t)start, count); | __func__, dev, child, type, rid, (void *)(intptr_t)start, count); | ||||
rle = resource_list_add(rl, type, rid, start, start + count - 1, | rle = resource_list_add(rl, type, rid, start, start + count - 1, | ||||
count); | count); | ||||
if (rle == NULL) | if (rle == NULL) | ||||
return (ENXIO); | return (ENXIO); | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 226 Lines • Show Last 20 Lines |