Преглед на файлове

Kernel/Storage: Move all ATA related code to a new subdirectory

Like what happened with the PCI and USB code, this feels like the right
thing to do because we can improve on the ATA capabilities and keep it
distinguished from the rest of the subsystem.
Liav A преди 3 години
родител
ревизия
4dc3617f3c

+ 9 - 9
Kernel/CMakeLists.txt

@@ -82,6 +82,15 @@ set(KERNEL_SOURCES
     Graphics/VGACompatibleAdapter.cpp
     Graphics/VGACompatibleAdapter.cpp
     Graphics/GenericFramebufferDevice.cpp
     Graphics/GenericFramebufferDevice.cpp
     SanCov.cpp
     SanCov.cpp
+    Storage/ATA/AHCIController.cpp
+    Storage/ATA/AHCIPort.cpp
+    Storage/ATA/AHCIPortHandler.cpp
+    Storage/ATA/ATADevice.cpp
+    Storage/ATA/ATADiskDevice.cpp
+    Storage/ATA/ATAPIDiscDevice.cpp
+    Storage/ATA/BMIDEChannel.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
@@ -89,15 +98,6 @@ set(KERNEL_SOURCES
     Storage/Partition/MBRPartitionTable.cpp
     Storage/Partition/MBRPartitionTable.cpp
     Storage/Partition/PartitionTable.cpp
     Storage/Partition/PartitionTable.cpp
     Storage/StorageDevice.cpp
     Storage/StorageDevice.cpp
-    Storage/AHCIController.cpp
-    Storage/AHCIPort.cpp
-    Storage/AHCIPortHandler.cpp
-    Storage/ATADevice.cpp
-    Storage/ATADiskDevice.cpp
-    Storage/ATAPIDiscDevice.cpp
-    Storage/BMIDEChannel.cpp
-    Storage/IDEController.cpp
-    Storage/IDEChannel.cpp
     Storage/RamdiskController.cpp
     Storage/RamdiskController.cpp
     Storage/RamdiskDevice.cpp
     Storage/RamdiskDevice.cpp
     Storage/StorageManagement.cpp
     Storage/StorageManagement.cpp

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


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

@@ -10,8 +10,8 @@
 #include <AK/Types.h>
 #include <AK/Types.h>
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Memory/MemoryManager.h>
-#include <Kernel/Storage/AHCIController.h>
-#include <Kernel/Storage/AHCIPortHandler.h>
+#include <Kernel/Storage/ATA/AHCIController.h>
+#include <Kernel/Storage/ATA/AHCIPortHandler.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 2 - 2
Kernel/Storage/AHCIController.h → Kernel/Storage/ATA/AHCIController.h

@@ -10,8 +10,8 @@
 #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/AHCI.h>
-#include <Kernel/Storage/ATAController.h>
+#include <Kernel/Storage/ATA/AHCI.h>
+#include <Kernel/Storage/ATA/ATAController.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 3 - 3
Kernel/Storage/AHCIPort.cpp → Kernel/Storage/ATA/AHCIPort.cpp

@@ -12,9 +12,9 @@
 #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/AHCIPort.h>
-#include <Kernel/Storage/ATA.h>
-#include <Kernel/Storage/ATADiskDevice.h>
+#include <Kernel/Storage/ATA/AHCIPort.h>
+#include <Kernel/Storage/ATA/ATA.h>
+#include <Kernel/Storage/ATA/ATADiskDevice.h>
 #include <Kernel/Storage/StorageManagement.h>
 #include <Kernel/Storage/StorageManagement.h>
 #include <Kernel/WorkQueue.h>
 #include <Kernel/WorkQueue.h>
 
 

+ 3 - 3
Kernel/Storage/AHCIPort.h → Kernel/Storage/ATA/AHCIPort.h

@@ -20,9 +20,9 @@
 #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/AHCI.h>
-#include <Kernel/Storage/AHCIPortHandler.h>
-#include <Kernel/Storage/ATADevice.h>
+#include <Kernel/Storage/ATA/AHCI.h>
+#include <Kernel/Storage/ATA/AHCIPortHandler.h>
+#include <Kernel/Storage/ATA/ATADevice.h>
 #include <Kernel/WaitQueue.h>
 #include <Kernel/WaitQueue.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 1 - 1
Kernel/Storage/AHCIPortHandler.cpp → Kernel/Storage/ATA/AHCIPortHandler.cpp

@@ -5,7 +5,7 @@
  */
  */
 
 
 #include <Kernel/CommandLine.h>
 #include <Kernel/CommandLine.h>
-#include <Kernel/Storage/AHCIPortHandler.h>
+#include <Kernel/Storage/ATA/AHCIPortHandler.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 2 - 2
Kernel/Storage/AHCIPortHandler.h → Kernel/Storage/ATA/AHCIPortHandler.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/AHCIController.h>
-#include <Kernel/Storage/AHCIPort.h>
+#include <Kernel/Storage/ATA/AHCIController.h>
+#include <Kernel/Storage/ATA/AHCIPort.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/WaitQueue.h>
 #include <Kernel/WaitQueue.h>
 
 

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


+ 0 - 0
Kernel/Storage/ATAController.h → Kernel/Storage/ATA/ATAController.h


+ 3 - 3
Kernel/Storage/ATADevice.cpp → Kernel/Storage/ATA/ATADevice.cpp

@@ -6,9 +6,9 @@
 
 
 #include <AK/StringView.h>
 #include <AK/StringView.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATADevice.h>
-#include <Kernel/Storage/IDEChannel.h>
-#include <Kernel/Storage/IDEController.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 {

+ 1 - 1
Kernel/Storage/ATADevice.h → Kernel/Storage/ATA/ATADevice.h

@@ -8,7 +8,7 @@
 
 
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Locking/Mutex.h>
 #include <Kernel/Locking/Mutex.h>
-#include <Kernel/Storage/ATAController.h>
+#include <Kernel/Storage/ATA/ATAController.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 3 - 3
Kernel/Storage/ATADiskDevice.cpp → Kernel/Storage/ATA/ATADiskDevice.cpp

@@ -7,9 +7,9 @@
 #include <AK/StringView.h>
 #include <AK/StringView.h>
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATADiskDevice.h>
-#include <Kernel/Storage/IDEChannel.h>
-#include <Kernel/Storage/IDEController.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 {

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

@@ -8,7 +8,7 @@
 
 
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Locking/Mutex.h>
 #include <Kernel/Locking/Mutex.h>
-#include <Kernel/Storage/ATADevice.h>
+#include <Kernel/Storage/ATA/ATADevice.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 3 - 3
Kernel/Storage/ATAPIDiscDevice.cpp → Kernel/Storage/ATA/ATAPIDiscDevice.cpp

@@ -7,9 +7,9 @@
 #include <AK/StringView.h>
 #include <AK/StringView.h>
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATAPIDiscDevice.h>
-#include <Kernel/Storage/IDEChannel.h>
-#include <Kernel/Storage/IDEController.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 {

+ 1 - 1
Kernel/Storage/ATAPIDiscDevice.h → Kernel/Storage/ATA/ATAPIDiscDevice.h

@@ -8,7 +8,7 @@
 
 
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Locking/Mutex.h>
 #include <Kernel/Locking/Mutex.h>
-#include <Kernel/Storage/ATADevice.h>
+#include <Kernel/Storage/ATA/ATADevice.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 3 - 3
Kernel/Storage/BMIDEChannel.cpp → Kernel/Storage/ATA/BMIDEChannel.cpp

@@ -6,9 +6,9 @@
 
 
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATA.h>
-#include <Kernel/Storage/BMIDEChannel.h>
-#include <Kernel/Storage/IDEController.h>
+#include <Kernel/Storage/ATA/ATA.h>
+#include <Kernel/Storage/ATA/BMIDEChannel.h>
+#include <Kernel/Storage/ATA/IDEController.h>
 #include <Kernel/WorkQueue.h>
 #include <Kernel/WorkQueue.h>
 
 
 namespace Kernel {
 namespace Kernel {

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

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

+ 4 - 4
Kernel/Storage/IDEChannel.cpp → Kernel/Storage/ATA/IDEChannel.cpp

@@ -11,10 +11,10 @@
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Process.h>
 #include <Kernel/Process.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATA.h>
-#include <Kernel/Storage/ATADiskDevice.h>
-#include <Kernel/Storage/IDEChannel.h>
-#include <Kernel/Storage/IDEController.h>
+#include <Kernel/Storage/ATA/ATA.h>
+#include <Kernel/Storage/ATA/ATADiskDevice.h>
+#include <Kernel/Storage/ATA/IDEChannel.h>
+#include <Kernel/Storage/ATA/IDEController.h>
 #include <Kernel/WorkQueue.h>
 #include <Kernel/WorkQueue.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 1 - 1
Kernel/Storage/IDEChannel.h → Kernel/Storage/ATA/IDEChannel.h

@@ -25,7 +25,7 @@
 #include <Kernel/Memory/PhysicalPage.h>
 #include <Kernel/Memory/PhysicalPage.h>
 #include <Kernel/PhysicalAddress.h>
 #include <Kernel/PhysicalAddress.h>
 #include <Kernel/Random.h>
 #include <Kernel/Random.h>
-#include <Kernel/Storage/ATADevice.h>
+#include <Kernel/Storage/ATA/ATADevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/WaitQueue.h>
 #include <Kernel/WaitQueue.h>
 
 

+ 3 - 3
Kernel/Storage/IDEController.cpp → Kernel/Storage/ATA/IDEController.cpp

@@ -10,9 +10,9 @@
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/Bus/PCI/API.h>
 #include <Kernel/FileSystem/ProcFS.h>
 #include <Kernel/FileSystem/ProcFS.h>
 #include <Kernel/Sections.h>
 #include <Kernel/Sections.h>
-#include <Kernel/Storage/ATADiskDevice.h>
-#include <Kernel/Storage/BMIDEChannel.h>
-#include <Kernel/Storage/IDEController.h>
+#include <Kernel/Storage/ATA/ATADiskDevice.h>
+#include <Kernel/Storage/ATA/BMIDEChannel.h>
+#include <Kernel/Storage/ATA/IDEController.h>
 
 
 namespace Kernel {
 namespace Kernel {
 
 

+ 2 - 2
Kernel/Storage/IDEController.h → Kernel/Storage/ATA/IDEController.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/ATAController.h>
-#include <Kernel/Storage/IDEChannel.h>
+#include <Kernel/Storage/ATA/ATAController.h>
+#include <Kernel/Storage/ATA/IDEChannel.h>
 #include <Kernel/Storage/StorageDevice.h>
 #include <Kernel/Storage/StorageDevice.h>
 
 
 namespace Kernel {
 namespace Kernel {

+ 2 - 2
Kernel/Storage/StorageManagement.cpp

@@ -13,8 +13,8 @@
 #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/AHCIController.h>
-#include <Kernel/Storage/IDEController.h>
+#include <Kernel/Storage/ATA/AHCIController.h>
+#include <Kernel/Storage/ATA/IDEController.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>
 #include <Kernel/Storage/Partition/MBRPartitionTable.h>
 #include <Kernel/Storage/Partition/MBRPartitionTable.h>