Browse Source

Kernel/Storage: Move AHCI and IDE code into new subdirectories

We do that to increase clarity of the major and secondary components in
the subsystem. To ensure it's even more understandable, we rename the
files to better represent the class within them and to remove redundancy
in the name.

Also, some includes are removed from the general components of the ATA
components' classes.
Liav A 3 years ago
parent
commit
c001e3f567

+ 8 - 8
Kernel/CMakeLists.txt

@@ -92,17 +92,17 @@ set(KERNEL_SOURCES
     Graphics/VirtIOGPU/GPU3DDevice.cpp
     Graphics/VirtIOGPU/GPU3DDevice.cpp
     Graphics/VirtIOGPU/GraphicsAdapter.cpp
     Graphics/VirtIOGPU/GraphicsAdapter.cpp
     SanCov.cpp
     SanCov.cpp
-    Storage/ATA/AHCIController.cpp
-    Storage/ATA/AHCIInterruptHandler.cpp
-    Storage/ATA/AHCIPort.cpp
+    Storage/ATA/AHCI/Controller.cpp
+    Storage/ATA/AHCI/Port.cpp
+    Storage/ATA/AHCI/InterruptHandler.cpp
+    Storage/ATA/GenericIDE/BusMasterChannel.cpp
+    Storage/ATA/GenericIDE/Controller.cpp
+    Storage/ATA/GenericIDE/Channel.cpp
+    Storage/ATA/GenericIDE/ISAController.cpp
+    Storage/ATA/GenericIDE/PCIController.cpp
     Storage/ATA/ATADevice.cpp
     Storage/ATA/ATADevice.cpp
     Storage/ATA/ATADiskDevice.cpp
     Storage/ATA/ATADiskDevice.cpp
     Storage/ATA/ATAPIDiscDevice.cpp
     Storage/ATA/ATAPIDiscDevice.cpp
-    Storage/ATA/BMIDEChannel.cpp
-    Storage/ATA/ISAIDEController.cpp
-    Storage/ATA/PCIIDEController.cpp
-    Storage/ATA/IDEController.cpp
-    Storage/ATA/IDEChannel.cpp
     Storage/Partition/DiskPartition.cpp
     Storage/Partition/DiskPartition.cpp
     Storage/Partition/DiskPartitionMetadata.cpp
     Storage/Partition/DiskPartitionMetadata.cpp
     Storage/Partition/EBRPartitionTable.cpp
     Storage/Partition/EBRPartitionTable.cpp

+ 2 - 2
Kernel/Storage/ATA/AHCIController.cpp → Kernel/Storage/ATA/AHCI/Controller.cpp

@@ -12,8 +12,8 @@
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/CommandLine.h>
 #include <Kernel/CommandLine.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Memory/MemoryManager.h>
-#include <Kernel/Storage/ATA/AHCIController.h>
-#include <Kernel/Storage/ATA/AHCIInterruptHandler.h>
+#include <Kernel/Storage/ATA/AHCI/Controller.h>
+#include <Kernel/Storage/ATA/AHCI/InterruptHandler.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 1 - 1
Kernel/Storage/ATA/AHCIController.h → Kernel/Storage/ATA/AHCI/Controller.h

@@ -10,7 +10,7 @@
 #include <AK/RefPtr.h>
 #include <AK/RefPtr.h>
 #include <AK/Types.h>
 #include <AK/Types.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATA/AHCI.h>
+#include <Kernel/Storage/ATA/AHCI/Definitions.h>
 #include <Kernel/Storage/ATA/ATAController.h>
 #include <Kernel/Storage/ATA/ATAController.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 
 

+ 0 - 0
Kernel/Storage/ATA/AHCI.h → Kernel/Storage/ATA/AHCI/Definitions.h


+ 1 - 1
Kernel/Storage/ATA/AHCIInterruptHandler.cpp → Kernel/Storage/ATA/AHCI/InterruptHandler.cpp

@@ -4,7 +4,7 @@
  * SPDX-License-Identifier: BSD-2-Clause
  * SPDX-License-Identifier: BSD-2-Clause
  */
  */
 
 
-#include <Kernel/Storage/ATA/AHCIInterruptHandler.h>
+#include <Kernel/Storage/ATA/AHCI/InterruptHandler.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 2 - 2
Kernel/Storage/ATA/AHCIInterruptHandler.h → Kernel/Storage/ATA/AHCI/InterruptHandler.h

@@ -15,8 +15,8 @@
 #include <Kernel/PhysicalAddress.h>
 #include <Kernel/PhysicalAddress.h>
 #include <Kernel/Random.h>
 #include <Kernel/Random.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATA/AHCIController.h>
-#include <Kernel/Storage/ATA/AHCIPort.h>
+#include <Kernel/Storage/ATA/AHCI/Controller.h>
+#include <Kernel/Storage/ATA/AHCI/Port.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/WaitQueue.h>
 #include <Kernel/WaitQueue.h>
 
 

+ 1 - 1
Kernel/Storage/ATA/AHCIPort.cpp → Kernel/Storage/ATA/AHCI/Port.cpp

@@ -12,7 +12,7 @@
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Memory/ScatterGatherList.h>
 #include <Kernel/Memory/ScatterGatherList.h>
 #include <Kernel/Memory/TypedMapping.h>
 #include <Kernel/Memory/TypedMapping.h>
-#include <Kernel/Storage/ATA/AHCIPort.h>
+#include <Kernel/Storage/ATA/AHCI/Port.h>
 #include <Kernel/Storage/ATA/ATA.h>
 #include <Kernel/Storage/ATA/ATA.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
 #include <Kernel/Storage/StorageManagement.h>
 #include <Kernel/Storage/StorageManagement.h>

+ 2 - 2
Kernel/Storage/ATA/AHCIPort.h → Kernel/Storage/ATA/AHCI/Port.h

@@ -20,8 +20,8 @@
 #include <Kernel/PhysicalAddress.h>
 #include <Kernel/PhysicalAddress.h>
 #include <Kernel/Random.h>
 #include <Kernel/Random.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATA/AHCI.h>
-#include <Kernel/Storage/ATA/AHCIInterruptHandler.h>
+#include <Kernel/Storage/ATA/AHCI/Definitions.h>
+#include <Kernel/Storage/ATA/AHCI/InterruptHandler.h>
 #include <Kernel/Storage/ATA/ATADevice.h>
 #include <Kernel/Storage/ATA/ATADevice.h>
 #include <Kernel/WaitQueue.h>
 #include <Kernel/WaitQueue.h>
 
 

+ 0 - 2
Kernel/Storage/ATA/ATADevice.cpp

@@ -7,8 +7,6 @@
 #include <AK/StringView.h>
 #include <AK/StringView.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Storage/ATA/ATADevice.h>
 #include <Kernel/Storage/ATA/ATADevice.h>
-#include <Kernel/Storage/ATA/IDEChannel.h>
-#include <Kernel/Storage/ATA/IDEController.h>
 #include <Kernel/Storage/StorageManagement.h>
 #include <Kernel/Storage/StorageManagement.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 0 - 2
Kernel/Storage/ATA/ATADiskDevice.cpp

@@ -8,8 +8,6 @@
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
-#include <Kernel/Storage/ATA/IDEChannel.h>
-#include <Kernel/Storage/ATA/IDEController.h>
 #include <Kernel/Storage/StorageManagement.h>
 #include <Kernel/Storage/StorageManagement.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 0 - 1
Kernel/Storage/ATA/ATADiskDevice.h

@@ -13,7 +13,6 @@
 namespace Kernel {
 namespace Kernel {
 
 
 class IDEController;
 class IDEController;
-class IDEChannel;
 class ATADiskDevice final : public ATADevice {
 class ATADiskDevice final : public ATADevice {
     friend class IDEController;
     friend class IDEController;
     friend class DeviceManagement;
     friend class DeviceManagement;

+ 0 - 2
Kernel/Storage/ATA/ATAPIDiscDevice.cpp

@@ -8,8 +8,6 @@
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Storage/ATA/ATAPIDiscDevice.h>
 #include <Kernel/Storage/ATA/ATAPIDiscDevice.h>
-#include <Kernel/Storage/ATA/IDEChannel.h>
-#include <Kernel/Storage/ATA/IDEController.h>
 #include <Kernel/Storage/StorageManagement.h>
 #include <Kernel/Storage/StorageManagement.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 2 - 2
Kernel/Storage/ATA/BMIDEChannel.cpp → Kernel/Storage/ATA/GenericIDE/BusMasterChannel.cpp

@@ -7,8 +7,8 @@
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Storage/ATA/ATA.h>
 #include <Kernel/Storage/ATA/ATA.h>
-#include <Kernel/Storage/ATA/BMIDEChannel.h>
-#include <Kernel/Storage/ATA/IDEController.h>
+#include <Kernel/Storage/ATA/GenericIDE/BusMasterChannel.h>
+#include <Kernel/Storage/ATA/GenericIDE/Controller.h>
 #include <Kernel/WorkQueue.h>
 #include <Kernel/WorkQueue.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 1 - 1
Kernel/Storage/ATA/BMIDEChannel.h → Kernel/Storage/ATA/GenericIDE/BusMasterChannel.h

@@ -7,7 +7,7 @@
 #pragma once
 #pragma once
 
 
 #include <AK/OwnPtr.h>
 #include <AK/OwnPtr.h>
-#include <Kernel/Storage/ATA/IDEChannel.h>
+#include <Kernel/Storage/ATA/GenericIDE/Channel.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 2 - 2
Kernel/Storage/ATA/IDEChannel.cpp → Kernel/Storage/ATA/GenericIDE/Channel.cpp

@@ -13,8 +13,8 @@
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Storage/ATA/ATA.h>
 #include <Kernel/Storage/ATA/ATA.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
-#include <Kernel/Storage/ATA/IDEChannel.h>
-#include <Kernel/Storage/ATA/IDEController.h>
+#include <Kernel/Storage/ATA/GenericIDE/Channel.h>
+#include <Kernel/Storage/ATA/GenericIDE/Controller.h>
 #include <Kernel/WorkQueue.h>
 #include <Kernel/WorkQueue.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 0 - 0
Kernel/Storage/ATA/IDEChannel.h → Kernel/Storage/ATA/GenericIDE/Channel.h


+ 2 - 2
Kernel/Storage/ATA/IDEController.cpp → Kernel/Storage/ATA/GenericIDE/Controller.cpp

@@ -11,8 +11,8 @@
 #include <Kernel/FileSystem/ProcFS.h>
 #include <Kernel/FileSystem/ProcFS.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
-#include <Kernel/Storage/ATA/BMIDEChannel.h>
-#include <Kernel/Storage/ATA/IDEController.h>
+#include <Kernel/Storage/ATA/GenericIDE/BusMasterChannel.h>
+#include <Kernel/Storage/ATA/GenericIDE/Controller.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 1 - 1
Kernel/Storage/ATA/IDEController.h → Kernel/Storage/ATA/GenericIDE/Controller.h

@@ -10,7 +10,7 @@
 #include <AK/RefPtr.h>
 #include <AK/RefPtr.h>
 #include <AK/Types.h>
 #include <AK/Types.h>
 #include <Kernel/Storage/ATA/ATAController.h>
 #include <Kernel/Storage/ATA/ATAController.h>
-#include <Kernel/Storage/ATA/IDEChannel.h>
+#include <Kernel/Storage/ATA/GenericIDE/Channel.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 2 - 2
Kernel/Storage/ATA/ISAIDEController.cpp → Kernel/Storage/ATA/GenericIDE/ISAController.cpp

@@ -11,8 +11,8 @@
 #include <Kernel/FileSystem/ProcFS.h>
 #include <Kernel/FileSystem/ProcFS.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
-#include <Kernel/Storage/ATA/BMIDEChannel.h>
-#include <Kernel/Storage/ATA/ISAIDEController.h>
+#include <Kernel/Storage/ATA/GenericIDE/BusMasterChannel.h>
+#include <Kernel/Storage/ATA/GenericIDE/ISAController.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 2 - 2
Kernel/Storage/ATA/ISAIDEController.h → Kernel/Storage/ATA/GenericIDE/ISAController.h

@@ -9,8 +9,8 @@
 #include <AK/OwnPtr.h>
 #include <AK/OwnPtr.h>
 #include <AK/RefPtr.h>
 #include <AK/RefPtr.h>
 #include <AK/Types.h>
 #include <AK/Types.h>
-#include <Kernel/Storage/ATA/IDEChannel.h>
-#include <Kernel/Storage/ATA/IDEController.h>
+#include <Kernel/Storage/ATA/GenericIDE/Channel.h>
+#include <Kernel/Storage/ATA/GenericIDE/Controller.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 2 - 2
Kernel/Storage/ATA/PCIIDEController.cpp → Kernel/Storage/ATA/GenericIDE/PCIController.cpp

@@ -11,8 +11,8 @@
 #include <Kernel/FileSystem/ProcFS.h>
 #include <Kernel/FileSystem/ProcFS.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
 #include <Kernel/Storage/ATA/ATADiskDevice.h>
-#include <Kernel/Storage/ATA/BMIDEChannel.h>
-#include <Kernel/Storage/ATA/PCIIDEController.h>
+#include <Kernel/Storage/ATA/GenericIDE/BusMasterChannel.h>
+#include <Kernel/Storage/ATA/GenericIDE/PCIController.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 2 - 2
Kernel/Storage/ATA/PCIIDEController.h → Kernel/Storage/ATA/GenericIDE/PCIController.h

@@ -9,8 +9,8 @@
 #include <AK/OwnPtr.h>
 #include <AK/OwnPtr.h>
 #include <AK/RefPtr.h>
 #include <AK/RefPtr.h>
 #include <AK/Types.h>
 #include <AK/Types.h>
-#include <Kernel/Storage/ATA/IDEChannel.h>
-#include <Kernel/Storage/ATA/IDEController.h>
+#include <Kernel/Storage/ATA/GenericIDE/Channel.h>
+#include <Kernel/Storage/ATA/GenericIDE/Controller.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 4 - 3
Kernel/Storage/StorageManagement.cpp

@@ -16,9 +16,10 @@
 #include <Kernel/Devices/BlockDevice.h>
 #include <Kernel/Devices/BlockDevice.h>
 #include <Kernel/FileSystem/Ext2FileSystem.h>
 #include <Kernel/FileSystem/Ext2FileSystem.h>
 #include <Kernel/Panic.h>
 #include <Kernel/Panic.h>
-#include <Kernel/Storage/ATA/AHCIController.h>
-#include <Kernel/Storage/ATA/ISAIDEController.h>
-#include <Kernel/Storage/ATA/PCIIDEController.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/NVMe/NVMeController.h>
 #include <Kernel/Storage/Partition/EBRPartitionTable.h>
 #include <Kernel/Storage/Partition/EBRPartitionTable.h>
 #include <Kernel/Storage/Partition/GUIDPartitionTable.h>
 #include <Kernel/Storage/Partition/GUIDPartitionTable.h>