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

Function bus_generic_rl_alloc_resource

freebsd/kern/subr_bus.c:4511–4527  ·  view source on GitHub ↗

* @brief Helper function for implementing BUS_ALLOC_RESOURCE(). * * This implementation of BUS_ALLOC_RESOURCE() uses the * resource_list_alloc() function to do most of the work. It calls * BUS_GET_RESOURCE_LIST() to find a suitable resource list. */

Source from the content-addressed store, hash-verified

4509 * BUS_GET_RESOURCE_LIST() to find a suitable resource list.
4510 */
4511struct resource *
4512bus_generic_rl_alloc_resource(device_t dev, device_t child, int type,
4513 int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
4514{
4515 struct resource_list * rl = NULL;
4516
4517 if (device_get_parent(child) != dev)
4518 return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
4519 type, rid, start, end, count, flags));
4520
4521 rl = BUS_GET_RESOURCE_LIST(dev, child);
4522 if (!rl)
4523 return (NULL);
4524
4525 return (resource_list_alloc(rl, dev, child, type, rid,
4526 start, end, count, flags));
4527}
4528
4529/**
4530 * @brief Helper function for implementing BUS_CHILD_PRESENT().

Callers

nothing calls this directly

Calls 2

device_get_parentFunction · 0.85
resource_list_allocFunction · 0.85

Tested by

no test coverage detected