From c001e3f567bb9ceae8b49476ee72a7e5a4b9f37a Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 19 Nov 2021 11:52:07 +0200 Subject: [PATCH] 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. --- Kernel/CMakeLists.txt | 16 ++++++++-------- .../{AHCIController.cpp => AHCI/Controller.cpp} | 4 ++-- .../ATA/{AHCIController.h => AHCI/Controller.h} | 2 +- .../Storage/ATA/{AHCI.h => AHCI/Definitions.h} | 0 .../InterruptHandler.cpp} | 2 +- .../InterruptHandler.h} | 4 ++-- .../Storage/ATA/{AHCIPort.cpp => AHCI/Port.cpp} | 2 +- Kernel/Storage/ATA/{AHCIPort.h => AHCI/Port.h} | 4 ++-- Kernel/Storage/ATA/ATADevice.cpp | 2 -- Kernel/Storage/ATA/ATADiskDevice.cpp | 2 -- Kernel/Storage/ATA/ATADiskDevice.h | 1 - Kernel/Storage/ATA/ATAPIDiscDevice.cpp | 2 -- .../BusMasterChannel.cpp} | 4 ++-- .../BusMasterChannel.h} | 2 +- .../{IDEChannel.cpp => GenericIDE/Channel.cpp} | 4 ++-- .../ATA/{IDEChannel.h => GenericIDE/Channel.h} | 0 .../Controller.cpp} | 4 ++-- .../{IDEController.h => GenericIDE/Controller.h} | 2 +- .../ISAController.cpp} | 4 ++-- .../ISAController.h} | 4 ++-- .../PCIController.cpp} | 4 ++-- .../PCIController.h} | 4 ++-- Kernel/Storage/StorageManagement.cpp | 7 ++++--- 23 files changed, 37 insertions(+), 43 deletions(-) rename Kernel/Storage/ATA/{AHCIController.cpp => AHCI/Controller.cpp} (98%) rename Kernel/Storage/ATA/{AHCIController.h => AHCI/Controller.h} (97%) rename Kernel/Storage/ATA/{AHCI.h => AHCI/Definitions.h} (100%) rename Kernel/Storage/ATA/{AHCIInterruptHandler.cpp => AHCI/InterruptHandler.cpp} (97%) rename Kernel/Storage/ATA/{AHCIInterruptHandler.h => AHCI/InterruptHandler.h} (94%) rename Kernel/Storage/ATA/{AHCIPort.cpp => AHCI/Port.cpp} (99%) rename Kernel/Storage/ATA/{AHCIPort.h => AHCI/Port.h} (97%) rename Kernel/Storage/ATA/{BMIDEChannel.cpp => GenericIDE/BusMasterChannel.cpp} (98%) rename Kernel/Storage/ATA/{BMIDEChannel.h => GenericIDE/BusMasterChannel.h} (97%) rename Kernel/Storage/ATA/{IDEChannel.cpp => GenericIDE/Channel.cpp} (99%) rename Kernel/Storage/ATA/{IDEChannel.h => GenericIDE/Channel.h} (100%) rename Kernel/Storage/ATA/{IDEController.cpp => GenericIDE/Controller.cpp} (95%) rename Kernel/Storage/ATA/{IDEController.h => GenericIDE/Controller.h} (95%) rename Kernel/Storage/ATA/{ISAIDEController.cpp => GenericIDE/ISAController.cpp} (91%) rename Kernel/Storage/ATA/{ISAIDEController.h => GenericIDE/ISAController.h} (83%) rename Kernel/Storage/ATA/{PCIIDEController.cpp => GenericIDE/PCIController.cpp} (97%) rename Kernel/Storage/ATA/{PCIIDEController.h => GenericIDE/PCIController.h} (90%) diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index f5e99b47010..5da08e4179f 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -92,17 +92,17 @@ set(KERNEL_SOURCES Graphics/VirtIOGPU/GPU3DDevice.cpp Graphics/VirtIOGPU/GraphicsAdapter.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/ATADiskDevice.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/DiskPartitionMetadata.cpp Storage/Partition/EBRPartitionTable.cpp diff --git a/Kernel/Storage/ATA/AHCIController.cpp b/Kernel/Storage/ATA/AHCI/Controller.cpp similarity index 98% rename from Kernel/Storage/ATA/AHCIController.cpp rename to Kernel/Storage/ATA/AHCI/Controller.cpp index f66ec99ed89..439cc58277f 100644 --- a/Kernel/Storage/ATA/AHCIController.cpp +++ b/Kernel/Storage/ATA/AHCI/Controller.cpp @@ -12,8 +12,8 @@ #include #include #include -#include -#include +#include +#include namespace Kernel { diff --git a/Kernel/Storage/ATA/AHCIController.h b/Kernel/Storage/ATA/AHCI/Controller.h similarity index 97% rename from Kernel/Storage/ATA/AHCIController.h rename to Kernel/Storage/ATA/AHCI/Controller.h index 79abc0d1f74..a2cdc24498e 100644 --- a/Kernel/Storage/ATA/AHCIController.h +++ b/Kernel/Storage/ATA/AHCI/Controller.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/Kernel/Storage/ATA/AHCI.h b/Kernel/Storage/ATA/AHCI/Definitions.h similarity index 100% rename from Kernel/Storage/ATA/AHCI.h rename to Kernel/Storage/ATA/AHCI/Definitions.h diff --git a/Kernel/Storage/ATA/AHCIInterruptHandler.cpp b/Kernel/Storage/ATA/AHCI/InterruptHandler.cpp similarity index 97% rename from Kernel/Storage/ATA/AHCIInterruptHandler.cpp rename to Kernel/Storage/ATA/AHCI/InterruptHandler.cpp index a0f4304340b..b17cbb0210b 100644 --- a/Kernel/Storage/ATA/AHCIInterruptHandler.cpp +++ b/Kernel/Storage/ATA/AHCI/InterruptHandler.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include namespace Kernel { diff --git a/Kernel/Storage/ATA/AHCIInterruptHandler.h b/Kernel/Storage/ATA/AHCI/InterruptHandler.h similarity index 94% rename from Kernel/Storage/ATA/AHCIInterruptHandler.h rename to Kernel/Storage/ATA/AHCI/InterruptHandler.h index 266e9f11d45..5483ba7329f 100644 --- a/Kernel/Storage/ATA/AHCIInterruptHandler.h +++ b/Kernel/Storage/ATA/AHCI/InterruptHandler.h @@ -15,8 +15,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/Kernel/Storage/ATA/AHCIPort.cpp b/Kernel/Storage/ATA/AHCI/Port.cpp similarity index 99% rename from Kernel/Storage/ATA/AHCIPort.cpp rename to Kernel/Storage/ATA/AHCI/Port.cpp index 8f713c405c4..71cfadc2c23 100644 --- a/Kernel/Storage/ATA/AHCIPort.cpp +++ b/Kernel/Storage/ATA/AHCI/Port.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Kernel/Storage/ATA/AHCIPort.h b/Kernel/Storage/ATA/AHCI/Port.h similarity index 97% rename from Kernel/Storage/ATA/AHCIPort.h rename to Kernel/Storage/ATA/AHCI/Port.h index 8f24ae734db..db06200579c 100644 --- a/Kernel/Storage/ATA/AHCIPort.h +++ b/Kernel/Storage/ATA/AHCI/Port.h @@ -20,8 +20,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/Kernel/Storage/ATA/ATADevice.cpp b/Kernel/Storage/ATA/ATADevice.cpp index 6acbaf7f089..53fbf18bb84 100644 --- a/Kernel/Storage/ATA/ATADevice.cpp +++ b/Kernel/Storage/ATA/ATADevice.cpp @@ -7,8 +7,6 @@ #include #include #include -#include -#include #include namespace Kernel { diff --git a/Kernel/Storage/ATA/ATADiskDevice.cpp b/Kernel/Storage/ATA/ATADiskDevice.cpp index 321719beb9f..ca9c33c3337 100644 --- a/Kernel/Storage/ATA/ATADiskDevice.cpp +++ b/Kernel/Storage/ATA/ATADiskDevice.cpp @@ -8,8 +8,6 @@ #include #include #include -#include -#include #include namespace Kernel { diff --git a/Kernel/Storage/ATA/ATADiskDevice.h b/Kernel/Storage/ATA/ATADiskDevice.h index 5d611e01206..53fd22199b0 100644 --- a/Kernel/Storage/ATA/ATADiskDevice.h +++ b/Kernel/Storage/ATA/ATADiskDevice.h @@ -13,7 +13,6 @@ namespace Kernel { class IDEController; -class IDEChannel; class ATADiskDevice final : public ATADevice { friend class IDEController; friend class DeviceManagement; diff --git a/Kernel/Storage/ATA/ATAPIDiscDevice.cpp b/Kernel/Storage/ATA/ATAPIDiscDevice.cpp index f696043ecd3..91723c6304a 100644 --- a/Kernel/Storage/ATA/ATAPIDiscDevice.cpp +++ b/Kernel/Storage/ATA/ATAPIDiscDevice.cpp @@ -8,8 +8,6 @@ #include #include #include -#include -#include #include namespace Kernel { diff --git a/Kernel/Storage/ATA/BMIDEChannel.cpp b/Kernel/Storage/ATA/GenericIDE/BusMasterChannel.cpp similarity index 98% rename from Kernel/Storage/ATA/BMIDEChannel.cpp rename to Kernel/Storage/ATA/GenericIDE/BusMasterChannel.cpp index cc29eaaf9f7..d4757ee8730 100644 --- a/Kernel/Storage/ATA/BMIDEChannel.cpp +++ b/Kernel/Storage/ATA/GenericIDE/BusMasterChannel.cpp @@ -7,8 +7,8 @@ #include #include #include -#include -#include +#include +#include #include namespace Kernel { diff --git a/Kernel/Storage/ATA/BMIDEChannel.h b/Kernel/Storage/ATA/GenericIDE/BusMasterChannel.h similarity index 97% rename from Kernel/Storage/ATA/BMIDEChannel.h rename to Kernel/Storage/ATA/GenericIDE/BusMasterChannel.h index 89d7f090907..5757ab9aba8 100644 --- a/Kernel/Storage/ATA/BMIDEChannel.h +++ b/Kernel/Storage/ATA/GenericIDE/BusMasterChannel.h @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace Kernel { diff --git a/Kernel/Storage/ATA/IDEChannel.cpp b/Kernel/Storage/ATA/GenericIDE/Channel.cpp similarity index 99% rename from Kernel/Storage/ATA/IDEChannel.cpp rename to Kernel/Storage/ATA/GenericIDE/Channel.cpp index 27716a63170..783df8facc9 100644 --- a/Kernel/Storage/ATA/IDEChannel.cpp +++ b/Kernel/Storage/ATA/GenericIDE/Channel.cpp @@ -13,8 +13,8 @@ #include #include #include -#include -#include +#include +#include #include namespace Kernel { diff --git a/Kernel/Storage/ATA/IDEChannel.h b/Kernel/Storage/ATA/GenericIDE/Channel.h similarity index 100% rename from Kernel/Storage/ATA/IDEChannel.h rename to Kernel/Storage/ATA/GenericIDE/Channel.h diff --git a/Kernel/Storage/ATA/IDEController.cpp b/Kernel/Storage/ATA/GenericIDE/Controller.cpp similarity index 95% rename from Kernel/Storage/ATA/IDEController.cpp rename to Kernel/Storage/ATA/GenericIDE/Controller.cpp index 030591e71af..9ad7b9f66fb 100644 --- a/Kernel/Storage/ATA/IDEController.cpp +++ b/Kernel/Storage/ATA/GenericIDE/Controller.cpp @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include namespace Kernel { diff --git a/Kernel/Storage/ATA/IDEController.h b/Kernel/Storage/ATA/GenericIDE/Controller.h similarity index 95% rename from Kernel/Storage/ATA/IDEController.h rename to Kernel/Storage/ATA/GenericIDE/Controller.h index 4ca4f3f2bfe..59d5cf612c6 100644 --- a/Kernel/Storage/ATA/IDEController.h +++ b/Kernel/Storage/ATA/GenericIDE/Controller.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include namespace Kernel { diff --git a/Kernel/Storage/ATA/ISAIDEController.cpp b/Kernel/Storage/ATA/GenericIDE/ISAController.cpp similarity index 91% rename from Kernel/Storage/ATA/ISAIDEController.cpp rename to Kernel/Storage/ATA/GenericIDE/ISAController.cpp index 83fcd3b1a33..0772aa93dff 100644 --- a/Kernel/Storage/ATA/ISAIDEController.cpp +++ b/Kernel/Storage/ATA/GenericIDE/ISAController.cpp @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include namespace Kernel { diff --git a/Kernel/Storage/ATA/ISAIDEController.h b/Kernel/Storage/ATA/GenericIDE/ISAController.h similarity index 83% rename from Kernel/Storage/ATA/ISAIDEController.h rename to Kernel/Storage/ATA/GenericIDE/ISAController.h index 8142143b907..9a92719f260 100644 --- a/Kernel/Storage/ATA/ISAIDEController.h +++ b/Kernel/Storage/ATA/GenericIDE/ISAController.h @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #include namespace Kernel { diff --git a/Kernel/Storage/ATA/PCIIDEController.cpp b/Kernel/Storage/ATA/GenericIDE/PCIController.cpp similarity index 97% rename from Kernel/Storage/ATA/PCIIDEController.cpp rename to Kernel/Storage/ATA/GenericIDE/PCIController.cpp index 6e8b8981859..119a26fd907 100644 --- a/Kernel/Storage/ATA/PCIIDEController.cpp +++ b/Kernel/Storage/ATA/GenericIDE/PCIController.cpp @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include namespace Kernel { diff --git a/Kernel/Storage/ATA/PCIIDEController.h b/Kernel/Storage/ATA/GenericIDE/PCIController.h similarity index 90% rename from Kernel/Storage/ATA/PCIIDEController.h rename to Kernel/Storage/ATA/GenericIDE/PCIController.h index 981fea766be..29672632ff9 100644 --- a/Kernel/Storage/ATA/PCIIDEController.h +++ b/Kernel/Storage/ATA/GenericIDE/PCIController.h @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #include namespace Kernel { diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp index 9f173ae8643..56fac391cf3 100644 --- a/Kernel/Storage/StorageManagement.cpp +++ b/Kernel/Storage/StorageManagement.cpp @@ -16,9 +16,10 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include #include #include #include