diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
| commit | da70596895d8135e08f8caac6978117697b4c021 (patch) | |
| tree | 2516785b5434df8453687f05dc8dd877438901ab /dev/Kernel/Sources/Storage | |
| parent | 005de79004c9d30e64bdee6e14e06f9d47d1f2ab (diff) | |
[REFACTOR]
Improved project structure.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/Sources/Storage')
| -rw-r--r-- | dev/Kernel/Sources/Storage/AHCIDeviceInterface.cxx | 35 | ||||
| -rw-r--r-- | dev/Kernel/Sources/Storage/ATADeviceInterface.cxx | 88 | ||||
| -rw-r--r-- | dev/Kernel/Sources/Storage/NVMEDeviceInterface.cxx | 28 | ||||
| -rw-r--r-- | dev/Kernel/Sources/Storage/SCSIDeviceInterface.cxx | 11 |
4 files changed, 0 insertions, 162 deletions
diff --git a/dev/Kernel/Sources/Storage/AHCIDeviceInterface.cxx b/dev/Kernel/Sources/Storage/AHCIDeviceInterface.cxx deleted file mode 100644 index dde33193..00000000 --- a/dev/Kernel/Sources/Storage/AHCIDeviceInterface.cxx +++ /dev/null @@ -1,35 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#include <StorageKit/AHCI.hxx> - -using namespace Kernel; - -/// @brief Class constructor -/// @param Out Disk output -/// @param In Disk input -/// @param Cleanup Disk cleanup. -AHCIDeviceInterface::AHCIDeviceInterface(void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)) - : DeviceInterface(Out, In), fCleanup(Cleanup) -{ -} - -/// @brief Class desctructor -AHCIDeviceInterface::~AHCIDeviceInterface() -{ - MUST_PASS(fCleanup); - if (fCleanup) - fCleanup(); -} - -/// @brief Returns the name of the device interface. -/// @return it's name as a string. -const char* AHCIDeviceInterface::Name() const -{ - return "AHCIDeviceInterface"; -} diff --git a/dev/Kernel/Sources/Storage/ATADeviceInterface.cxx b/dev/Kernel/Sources/Storage/ATADeviceInterface.cxx deleted file mode 100644 index 1611e790..00000000 --- a/dev/Kernel/Sources/Storage/ATADeviceInterface.cxx +++ /dev/null @@ -1,88 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#include <StorageKit/ATA.hxx> - -using namespace Kernel; - -/// @brief Class constructor -/// @param Out Disk output -/// @param In Disk input -/// @param Cleanup Disk cleanup. -ATADeviceInterface::ATADeviceInterface( - void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)) - : DeviceInterface(Out, In), fCleanup(Cleanup) -{ -} - -/// @brief Class desctructor -ATADeviceInterface::~ATADeviceInterface() -{ - MUST_PASS(fCleanup); - if (fCleanup) - fCleanup(); -} - -/// @brief Returns the name of the device interface. -/// @return it's name as a string. -const char* ATADeviceInterface::Name() const -{ - return "ATADeviceInterface"; -} - -/// @brief Output operator. -/// @param Data -/// @return -ATADeviceInterface& ATADeviceInterface::operator<<(MountpointInterface* Data) -{ - if (!Data) - return *this; - - for (SizeT driveCount = 0; driveCount < kDriveManagerCount; ++driveCount) - { - auto interface = Data->GetAddressOf(driveCount); - if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) - { - continue; - } - else if ((interface) && - rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) - { - return *this; - } - } - - return (ATADeviceInterface&)DeviceInterface<MountpointInterface*>::operator<<( - Data); -} - -/// @brief Input operator. -/// @param Data -/// @return -ATADeviceInterface& ATADeviceInterface::operator>>(MountpointInterface* Data) -{ - if (!Data) - return *this; - - for (SizeT driveCount = 0; driveCount < kDriveManagerCount; ++driveCount) - { - auto interface = Data->GetAddressOf(driveCount); - if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) - { - continue; - } - else if ((interface) && - rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) - { - return *this; - } - } - - return (ATADeviceInterface&)DeviceInterface<MountpointInterface*>::operator>>( - Data); -} diff --git a/dev/Kernel/Sources/Storage/NVMEDeviceInterface.cxx b/dev/Kernel/Sources/Storage/NVMEDeviceInterface.cxx deleted file mode 100644 index 7d07bf4b..00000000 --- a/dev/Kernel/Sources/Storage/NVMEDeviceInterface.cxx +++ /dev/null @@ -1,28 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#include <StorageKit/NVME.hxx> - -namespace Kernel -{ - NVMEDeviceInterface::NVMEDeviceInterface(void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)) - : DeviceInterface(Out, In), fCleanup(Cleanup) - { - } - - NVMEDeviceInterface::~NVMEDeviceInterface() - { - if (fCleanup) - fCleanup(); - } - - const char* NVMEDeviceInterface::Name() const - { - return ("NVMEDeviceInterface"); - } -} // namespace Kernel diff --git a/dev/Kernel/Sources/Storage/SCSIDeviceInterface.cxx b/dev/Kernel/Sources/Storage/SCSIDeviceInterface.cxx deleted file mode 100644 index da75a181..00000000 --- a/dev/Kernel/Sources/Storage/SCSIDeviceInterface.cxx +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#include <StorageKit/SCSI.hxx> - -///! @brief ATAPI SCSI packet. -const scsi_packet_type kCDRomPacketTemplate = {0x43, 0, 1, 0, 0, 0, - 0, 12, 0x40, 0, 0}; |
