drivers/pci/host-bridge.c
Source file repositories/reference/linux-study-clean/drivers/pci/host-bridge.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/host-bridge.c- Extension
.c- Size
- 2509 bytes
- Lines
- 103
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/pci.hlinux/module.hpci.h
Detected Declarations
function pci_put_host_bridge_devicefunction pci_set_host_bridge_releasefunction pcibios_resource_to_busfunction resource_list_for_each_entryfunction region_containsfunction pcibios_bus_to_resourcefunction resource_list_for_each_entryexport pci_find_host_bridgeexport pci_get_host_bridge_deviceexport pci_set_host_bridge_releaseexport pcibios_resource_to_busexport pcibios_bus_to_resource
Annotated Snippet
if (resource_contains(window->res, res)) {
offset = window->offset;
break;
}
}
region->start = res->start - offset;
region->end = res->end - offset;
}
EXPORT_SYMBOL(pcibios_resource_to_bus);
static bool region_contains(struct pci_bus_region *region1,
struct pci_bus_region *region2)
{
return region1->start <= region2->start && region1->end >= region2->end;
}
void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
struct pci_bus_region *region)
{
struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
struct resource_entry *window;
resource_size_t offset = 0;
resource_list_for_each_entry(window, &bridge->windows) {
struct pci_bus_region bus_region;
if (resource_type(res) != resource_type(window->res))
continue;
bus_region.start = window->res->start - window->offset;
bus_region.end = window->res->end - window->offset;
if (region_contains(&bus_region, region)) {
offset = window->offset;
break;
}
}
res->start = region->start + offset;
res->end = region->end + offset;
}
EXPORT_SYMBOL(pcibios_bus_to_resource);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/pci.h`, `linux/module.h`, `pci.h`.
- Detected declarations: `function pci_put_host_bridge_device`, `function pci_set_host_bridge_release`, `function pcibios_resource_to_bus`, `function resource_list_for_each_entry`, `function region_contains`, `function pcibios_bus_to_resource`, `function resource_list_for_each_entry`, `export pci_find_host_bridge`, `export pci_get_host_bridge_device`, `export pci_set_host_bridge_release`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.