pci: Move PCI IO port resource requirement to X86PCIController

Those IO ports are an x86 thing anyway, and having the PCI root driver
acquire the resource would cause device_node::AcquireResources
to fail when you have multiple PCI root ports

Change-Id: I9937302954ea71020a6c860937566a576a6a6964
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11260
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Sam Roberts
2026-07-15 08:07:09 +00:00
committed by Adrien Destugues
parent 05fd080554
commit 942f4ddcbb
2 changed files with 9 additions and 11 deletions
@@ -28,22 +28,13 @@
static status_t
pci_root_register_device(device_node* parent)
{
// XXX how do we handle this for PPC?
// I/O port for PCI config space address
#define PCI_CONFIG_ADDRESS 0xcf8
io_resource resources[2] = {
{B_IO_PORT, PCI_CONFIG_ADDRESS, 8},
{}
};
device_attr attrs[] = {
{B_DEVICE_PRETTY_NAME, B_STRING_TYPE, {.string = "PCI"}},
{B_DEVICE_FLAGS, B_UINT32_TYPE, {.ui32 = B_KEEP_DRIVER_LOADED}},
{}
};
return gDeviceManager->register_node(parent, PCI_ROOT_MODULE_NAME, attrs,
resources, NULL);
return gDeviceManager->register_node(parent, PCI_ROOT_MODULE_NAME, attrs, NULL, NULL);
}
@@ -46,13 +46,20 @@ X86PCIController::SupportsDevice(device_node* parent)
status_t
X86PCIController::RegisterDevice(device_node* parent)
{
// I/O port for PCI config space address
#define PCI_CONFIG_ADDRESS 0xcf8
io_resource resources[2] = {
{B_IO_PORT, PCI_CONFIG_ADDRESS, 8},
{}
};
device_attr attrs[] = {
{ B_DEVICE_PRETTY_NAME, B_STRING_TYPE, {.string = "X86 PCI Host Controller"} },
{ B_DEVICE_FIXED_CHILD, B_STRING_TYPE, {.string = "bus_managers/pci/root/driver_v1"} },
{}
};
return gDeviceManager->register_node(parent, PCI_X86_DRIVER_MODULE_NAME, attrs, NULL, NULL);
return gDeviceManager->register_node(parent, PCI_X86_DRIVER_MODULE_NAME, attrs, resources, NULL);
}