MCPcopy Create free account
hub / github.com/coreboot/coreboot / allocate_resources

Function allocate_resources

src/device/resource_allocator_v4.c:549–575  ·  view source on GitHub ↗

* This function forms the guts of the resource allocator. It walks * through the entire device tree for each domain two times. * * Every domain has a fixed set of ranges. These ranges cannot be * relaxed based on the requirements of the downstream devices. They * represent the available windows from which resources can be allocated * to the different devices under the domain. * * In order

Source from the content-addressed store, hash-verified

547 * allocated to the bridge.
548 */
549void allocate_resources(const struct device *root)
550{
551 const struct device *child;
552
553 if ((root == NULL) || (root->downstream == NULL))
554 return;
555
556 for (child = root->downstream->children; child; child = child->sibling) {
557 if (child->path.type != DEVICE_PATH_DOMAIN)
558 continue;
559
560 post_log_path(child);
561
562 /* Pass 1 - Relative placement. */
563 printk(BIOS_INFO, "=== Resource allocator: %s - Pass 1 (relative placement) ===\n",
564 dev_path(child));
565 compute_domain_resources(child);
566
567 /* Pass 2 - Allocate resources as per gathered requirements. */
568 printk(BIOS_INFO, "=== Resource allocator: %s - Pass 2 (allocating resources) ===\n",
569 dev_path(child));
570 allocate_domain_resources(child);
571
572 printk(BIOS_INFO, "=== Resource allocator: %s - resource allocation complete ===\n",
573 dev_path(child));
574 }
575}

Callers 1

dev_configureFunction · 0.85

Calls 5

post_log_pathFunction · 0.85
dev_pathFunction · 0.85
compute_domain_resourcesFunction · 0.85
printkFunction · 0.50

Tested by

no test coverage detected