summaryrefslogtreecommitdiff
path: root/Kernel/Storage/StorageManagement.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-09-03 08:15:32 +0300
committerLinus Groh <mail@linusgroh.de>2022-09-20 18:43:05 +0100
commit948be9674a057658badceb469df14a5e92d818ea (patch)
treeb534c264fbca02b478b17e73829ca989094787da /Kernel/Storage/StorageManagement.cpp
parentbb6f61ee5d032877ea832611e1516db3489f44ad (diff)
downloadserenity-948be9674a057658badceb469df14a5e92d818ea.zip
Kernel: Don't compile ISA IDE controller code in non-x86 builds
The ISA IDE controller code makes sense to be compiled in a x86 build as it relies on access to the x86 IO space. For other architectures, we can just omit the code as there's no way we can use that code again. To ensure we can omit the code easily, we move it to the Arch/x86 directory.
Diffstat (limited to 'Kernel/Storage/StorageManagement.cpp')
-rw-r--r--Kernel/Storage/StorageManagement.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp
index d1648a8b81..e36bf0ade4 100644
--- a/Kernel/Storage/StorageManagement.cpp
+++ b/Kernel/Storage/StorageManagement.cpp
@@ -6,9 +6,13 @@
*/
#include <AK/IterationDecision.h>
+#include <AK/Platform.h>
#include <AK/Singleton.h>
#include <AK/StringView.h>
#include <AK/UUID.h>
+#if ARCH(I386) || ARCH(X86_64)
+# include <Kernel/Arch/x86/ISABus/IDEController.h>
+#endif
#include <Kernel/Bus/PCI/API.h>
#include <Kernel/Bus/PCI/Access.h>
#include <Kernel/Bus/PCI/Controller/VolumeManagementDevice.h>
@@ -19,7 +23,6 @@
#include <Kernel/Panic.h>
#include <Kernel/Storage/ATA/AHCI/Controller.h>
#include <Kernel/Storage/ATA/GenericIDE/Controller.h>
-#include <Kernel/Storage/ATA/GenericIDE/ISAController.h>
#include <Kernel/Storage/ATA/GenericIDE/PCIController.h>
#include <Kernel/Storage/NVMe/NVMeController.h>
#include <Kernel/Storage/Ramdisk/Controller.h>
@@ -429,9 +432,11 @@ UNMAP_AFTER_INIT void StorageManagement::initialize(StringView root_device, bool
VERIFY(s_storage_device_minor_number == 0);
m_boot_argument = root_device;
if (PCI::Access::is_disabled()) {
+#if ARCH(I386) || ARCH(X86_64)
// Note: If PCI is disabled, we assume that at least we have an ISA IDE controller
// to probe and use
m_controllers.append(ISAIDEController::initialize());
+#endif
} else {
enumerate_pci_controllers(force_pio, poll);
}