diff options
author | Liav A <liavalb@gmail.com> | 2022-09-02 16:06:38 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-09-20 18:43:05 +0100 |
commit | e39086f2c6cbdd610806f51de0780c1068c932f7 (patch) | |
tree | ac0e65f1a06b1278fbf6a0245109f113446a185a /Kernel | |
parent | 5576151e6864bc0b3122c660d3234f30c83fc6bc (diff) | |
download | serenity-e39086f2c6cbdd610806f51de0780c1068c932f7.zip |
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.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Arch/x86/PCI/Initializer.cpp (renamed from Kernel/Bus/PCI/Initializer.cpp) | 4 | ||||
-rw-r--r-- | Kernel/CMakeLists.txt | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/Kernel/Bus/PCI/Initializer.cpp b/Kernel/Arch/x86/PCI/Initializer.cpp index 2ca868014c..0b7a796e41 100644 --- a/Kernel/Bus/PCI/Initializer.cpp +++ b/Kernel/Arch/x86/PCI/Initializer.cpp @@ -23,7 +23,6 @@ static bool test_pci_io(); UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type() { -#if ARCH(I386) || ARCH(X86_64) auto boot_determined = kernel_command_line().pci_access_level(); if (!ACPI::is_enabled() || !ACPI::Parser::the()->find_table("MCFG"sv).has_value()) return PCIAccessLevel::IOAddressing; @@ -33,7 +32,6 @@ UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type() if (!g_pci_access_io_probe_failed) return PCIAccessLevel::IOAddressing; -#endif PANIC("No PCI bus access method detected!"); } @@ -54,13 +52,11 @@ UNMAP_AFTER_INIT void initialize() VERIFY(success); break; } -#if ARCH(I386) || ARCH(X86_64) case PCIAccessLevel::IOAddressing: { auto success = Access::initialize_for_one_pci_domain(); VERIFY(success); break; } -#endif default: VERIFY_NOT_REACHED(); } diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index f4ddca6cff..82f24f32d2 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -25,7 +25,6 @@ set(KERNEL_SOURCES Bus/PCI/Access.cpp Bus/PCI/API.cpp Bus/PCI/Device.cpp - Bus/PCI/Initializer.cpp Bus/USB/UHCI/UHCIController.cpp Bus/USB/UHCI/UHCIRootHub.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/PCI/Controller/HostBridge.cpp + Arch/x86/PCI/Initializer.cpp ) set(KERNEL_SOURCES |