mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
Kernel: Move PCI initialization x86-specific code to the arch directory
It seems more correct to let each platform to define its own sequence of initialization of the PCI bus, so let's remove the #if flags and just put the entire Initializer.cpp file in the appropriate code directory.
This commit is contained in:
parent
5576151e68
commit
e39086f2c6
2 changed files with 1 additions and 5 deletions
|
@ -23,7 +23,6 @@ static bool test_pci_io();
|
||||||
|
|
||||||
UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type()
|
UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type()
|
||||||
{
|
{
|
||||||
#if ARCH(I386) || ARCH(X86_64)
|
|
||||||
auto boot_determined = kernel_command_line().pci_access_level();
|
auto boot_determined = kernel_command_line().pci_access_level();
|
||||||
if (!ACPI::is_enabled() || !ACPI::Parser::the()->find_table("MCFG"sv).has_value())
|
if (!ACPI::is_enabled() || !ACPI::Parser::the()->find_table("MCFG"sv).has_value())
|
||||||
return PCIAccessLevel::IOAddressing;
|
return PCIAccessLevel::IOAddressing;
|
||||||
|
@ -33,7 +32,6 @@ UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type()
|
||||||
|
|
||||||
if (!g_pci_access_io_probe_failed)
|
if (!g_pci_access_io_probe_failed)
|
||||||
return PCIAccessLevel::IOAddressing;
|
return PCIAccessLevel::IOAddressing;
|
||||||
#endif
|
|
||||||
|
|
||||||
PANIC("No PCI bus access method detected!");
|
PANIC("No PCI bus access method detected!");
|
||||||
}
|
}
|
||||||
|
@ -54,13 +52,11 @@ UNMAP_AFTER_INIT void initialize()
|
||||||
VERIFY(success);
|
VERIFY(success);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if ARCH(I386) || ARCH(X86_64)
|
|
||||||
case PCIAccessLevel::IOAddressing: {
|
case PCIAccessLevel::IOAddressing: {
|
||||||
auto success = Access::initialize_for_one_pci_domain();
|
auto success = Access::initialize_for_one_pci_domain();
|
||||||
VERIFY(success);
|
VERIFY(success);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
|
@ -25,7 +25,6 @@ set(KERNEL_SOURCES
|
||||||
Bus/PCI/Access.cpp
|
Bus/PCI/Access.cpp
|
||||||
Bus/PCI/API.cpp
|
Bus/PCI/API.cpp
|
||||||
Bus/PCI/Device.cpp
|
Bus/PCI/Device.cpp
|
||||||
Bus/PCI/Initializer.cpp
|
|
||||||
Bus/USB/UHCI/UHCIController.cpp
|
Bus/USB/UHCI/UHCIController.cpp
|
||||||
Bus/USB/UHCI/UHCIRootHub.cpp
|
Bus/USB/UHCI/UHCIRootHub.cpp
|
||||||
Bus/USB/USBConfiguration.cpp
|
Bus/USB/USBConfiguration.cpp
|
||||||
|
@ -341,6 +340,7 @@ if ("${SERENITY_ARCH}" STREQUAL "i686" OR "${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||||
Arch/x86/common/Shutdown.cpp
|
Arch/x86/common/Shutdown.cpp
|
||||||
|
|
||||||
Arch/x86/PCI/Controller/HostBridge.cpp
|
Arch/x86/PCI/Controller/HostBridge.cpp
|
||||||
|
Arch/x86/PCI/Initializer.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(KERNEL_SOURCES
|
set(KERNEL_SOURCES
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue