MCPcopy Create free account
hub / github.com/F-Stack/f-stack / localbus_alloc_resource

Function localbus_alloc_resource

freebsd/arm/mv/mv_localbus.c:331–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331static struct resource *
332localbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
333 rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
334{
335 struct localbus_devinfo *di;
336 struct resource_list_entry *rle;
337
338 /*
339 * Request for the default allocation with a given rid: use resource
340 * list stored in the local device info.
341 */
342 if (RMAN_IS_DEFAULT_RANGE(start, end)) {
343 if ((di = device_get_ivars(child)) == NULL)
344 return (NULL);
345
346 if (type == SYS_RES_IOPORT)
347 type = SYS_RES_MEMORY;
348
349 rid = &di->di_bank;
350 rle = resource_list_find(&di->di_res, type, *rid);
351 if (rle == NULL) {
352 device_printf(bus, "no default resources for "
353 "rid = %d, type = %d\n", *rid, type);
354 return (NULL);
355 }
356 start = rle->start;
357 end = rle->end;
358 count = rle->count;
359 }
360
361 return (bus_generic_alloc_resource(bus, child, type, rid, start, end,
362 count, flags));
363}
364
365static struct resource_list *
366localbus_get_resource_list(device_t bus, device_t child)

Callers

nothing calls this directly

Calls 4

device_get_ivarsFunction · 0.85
resource_list_findFunction · 0.85
device_printfFunction · 0.85

Tested by

no test coverage detected