diff --git a/Kernel/Bus/PCI/Initializer.cpp b/Kernel/Bus/PCI/Initializer.cpp index a6a9162368..2ca868014c 100644 --- a/Kernel/Bus/PCI/Initializer.cpp +++ b/Kernel/Bus/PCI/Initializer.cpp @@ -23,6 +23,7 @@ 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; @@ -32,6 +33,7 @@ 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!"); } @@ -44,17 +46,21 @@ UNMAP_AFTER_INIT void initialize() return; switch (detect_optimal_access_type()) { case PCIAccessLevel::MemoryAddressing: { + // FIXME: There are other arch-specific methods to find the memory range + // for accessing the PCI configuration space. auto mcfg = ACPI::Parser::the()->find_table("MCFG"sv); VERIFY(mcfg.has_value()); auto success = Access::initialize_for_multiple_pci_domains(mcfg.value()); 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/CommandLine.cpp b/Kernel/CommandLine.cpp index b50f776a7e..ad9349f68d 100644 --- a/Kernel/CommandLine.cpp +++ b/Kernel/CommandLine.cpp @@ -149,8 +149,10 @@ UNMAP_AFTER_INIT PCIAccessLevel CommandLine::pci_access_level() const auto value = lookup("pci"sv).value_or("ecam"sv); if (value == "ecam"sv) return PCIAccessLevel::MemoryAddressing; +#if ARCH(I386) || ARCH(X86_64) if (value == "io"sv) return PCIAccessLevel::IOAddressing; +#endif if (value == "none"sv) return PCIAccessLevel::None; PANIC("Unknown PCI ECAM setting: {}", value); diff --git a/Kernel/CommandLine.h b/Kernel/CommandLine.h index 618f031088..28a48ac6e0 100644 --- a/Kernel/CommandLine.h +++ b/Kernel/CommandLine.h @@ -32,7 +32,9 @@ enum class AcpiFeatureLevel { enum class PCIAccessLevel { None, +#if ARCH(I386) || ARCH(X86_64) IOAddressing, +#endif MemoryAddressing, };