* 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
| 547 | * allocated to the bridge. |
| 548 | */ |
| 549 | void 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 | } |
no test coverage detected