From d48cbe75ef29a9c67c9d176bf58e56ea6448fb9e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 21 Oct 2024 20:23:36 +0200 Subject: IMP: Major refactor of header and source files extensions. Signed-off-by: Amlal El Mahrouss --- dev/zka/StorageKit/AHCI.h | 33 +++++++++++++++++++++++++++++++++ dev/zka/StorageKit/AHCI.hxx | 33 --------------------------------- dev/zka/StorageKit/ATA.h | 39 +++++++++++++++++++++++++++++++++++++++ dev/zka/StorageKit/ATA.hxx | 39 --------------------------------------- dev/zka/StorageKit/NVME.h | 36 ++++++++++++++++++++++++++++++++++++ dev/zka/StorageKit/NVME.hxx | 36 ------------------------------------ dev/zka/StorageKit/PRDT.h | 36 ++++++++++++++++++++++++++++++++++++ dev/zka/StorageKit/PRDT.hxx | 36 ------------------------------------ dev/zka/StorageKit/SCSI.h | 11 +++++++++++ dev/zka/StorageKit/SCSI.hxx | 11 ----------- dev/zka/StorageKit/Storage.h | 22 ++++++++++++++++++++++ dev/zka/StorageKit/Storage.hxx | 22 ---------------------- 12 files changed, 177 insertions(+), 177 deletions(-) create mode 100644 dev/zka/StorageKit/AHCI.h delete mode 100644 dev/zka/StorageKit/AHCI.hxx create mode 100644 dev/zka/StorageKit/ATA.h delete mode 100644 dev/zka/StorageKit/ATA.hxx create mode 100644 dev/zka/StorageKit/NVME.h delete mode 100644 dev/zka/StorageKit/NVME.hxx create mode 100644 dev/zka/StorageKit/PRDT.h delete mode 100644 dev/zka/StorageKit/PRDT.hxx create mode 100644 dev/zka/StorageKit/SCSI.h delete mode 100644 dev/zka/StorageKit/SCSI.hxx create mode 100644 dev/zka/StorageKit/Storage.h delete mode 100644 dev/zka/StorageKit/Storage.hxx (limited to 'dev/zka/StorageKit') diff --git a/dev/zka/StorageKit/AHCI.h b/dev/zka/StorageKit/AHCI.h new file mode 100644 index 00000000..e89f5654 --- /dev/null +++ b/dev/zka/StorageKit/AHCI.h @@ -0,0 +1,33 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace Kernel +{ + class AHCIDeviceInterface : public DeviceInterface + { + public: + explicit AHCIDeviceInterface(void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), + void (*Cleanup)(void)); + + virtual ~AHCIDeviceInterface(); + + public: + AHCIDeviceInterface& operator=(const AHCIDeviceInterface&) = default; + AHCIDeviceInterface(const AHCIDeviceInterface&) = default; + + const Char* Name() const override; + + private: + void (*fCleanup)(void) = {nullptr}; + }; +} // namespace Kernel diff --git a/dev/zka/StorageKit/AHCI.hxx b/dev/zka/StorageKit/AHCI.hxx deleted file mode 100644 index 67948033..00000000 --- a/dev/zka/StorageKit/AHCI.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace Kernel -{ - class AHCIDeviceInterface : public DeviceInterface - { - public: - explicit AHCIDeviceInterface(void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)); - - virtual ~AHCIDeviceInterface(); - - public: - AHCIDeviceInterface& operator=(const AHCIDeviceInterface&) = default; - AHCIDeviceInterface(const AHCIDeviceInterface&) = default; - - const Char* Name() const override; - - private: - void (*fCleanup)(void) = {nullptr}; - }; -} // namespace Kernel diff --git a/dev/zka/StorageKit/ATA.h b/dev/zka/StorageKit/ATA.h new file mode 100644 index 00000000..d4efd15c --- /dev/null +++ b/dev/zka/StorageKit/ATA.h @@ -0,0 +1,39 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include + +namespace Kernel +{ + /// @brief ATA device interface type. + class ATADeviceInterface : public DeviceInterface + { + public: + explicit ATADeviceInterface(void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), + void (*Cleanup)(void)); + + virtual ~ATADeviceInterface(); + + public: + ATADeviceInterface& operator<<(MountpointInterface* Data) override; + ATADeviceInterface& operator>>(MountpointInterface* Data) override; + + public: + ATADeviceInterface& operator=(const ATADeviceInterface&) = default; + ATADeviceInterface(const ATADeviceInterface&) = default; + + const Char* Name() const override; + + private: + void (*fCleanup)(void) = {nullptr}; + }; +} // namespace Kernel diff --git a/dev/zka/StorageKit/ATA.hxx b/dev/zka/StorageKit/ATA.hxx deleted file mode 100644 index 11a0d546..00000000 --- a/dev/zka/StorageKit/ATA.hxx +++ /dev/null @@ -1,39 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include - -namespace Kernel -{ - /// @brief ATA device interface type. - class ATADeviceInterface : public DeviceInterface - { - public: - explicit ATADeviceInterface(void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)); - - virtual ~ATADeviceInterface(); - - public: - ATADeviceInterface& operator<<(MountpointInterface* Data) override; - ATADeviceInterface& operator>>(MountpointInterface* Data) override; - - public: - ATADeviceInterface& operator=(const ATADeviceInterface&) = default; - ATADeviceInterface(const ATADeviceInterface&) = default; - - const Char* Name() const override; - - private: - void (*fCleanup)(void) = {nullptr}; - }; -} // namespace Kernel diff --git a/dev/zka/StorageKit/NVME.h b/dev/zka/StorageKit/NVME.h new file mode 100644 index 00000000..04b3df7f --- /dev/null +++ b/dev/zka/StorageKit/NVME.h @@ -0,0 +1,36 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace Kernel +{ + class NVMEDeviceInterface final : public DeviceInterface + { + public: + explicit NVMEDeviceInterface(void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), + void (*Cleanup)(void)); + + ~NVMEDeviceInterface() override; + + public: + NVMEDeviceInterface& operator=(const NVMEDeviceInterface&) = default; + NVMEDeviceInterface(const NVMEDeviceInterface&) = default; + + const Char* Name() const override; + + public: + OwnPtr operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); + + private: + void (*fCleanup)(void) = {nullptr}; + }; +} // namespace Kernel diff --git a/dev/zka/StorageKit/NVME.hxx b/dev/zka/StorageKit/NVME.hxx deleted file mode 100644 index e909b783..00000000 --- a/dev/zka/StorageKit/NVME.hxx +++ /dev/null @@ -1,36 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace Kernel -{ - class NVMEDeviceInterface final : public DeviceInterface - { - public: - explicit NVMEDeviceInterface(void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)); - - ~NVMEDeviceInterface() override; - - public: - NVMEDeviceInterface& operator=(const NVMEDeviceInterface&) = default; - NVMEDeviceInterface(const NVMEDeviceInterface&) = default; - - const Char* Name() const override; - - public: - OwnPtr operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); - - private: - void (*fCleanup)(void) = {nullptr}; - }; -} // namespace Kernel diff --git a/dev/zka/StorageKit/PRDT.h b/dev/zka/StorageKit/PRDT.h new file mode 100644 index 00000000..993782bf --- /dev/null +++ b/dev/zka/StorageKit/PRDT.h @@ -0,0 +1,36 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +#define kPrdtTransferSize (sizeof(Kernel::UShort)) + +namespace Kernel +{ + /// @brief Tranfer information about PRD. + enum kPRDTTransfer + { + kPRDTTransferInProgress, + kPRDTTransferIsDone, + kPRDTTransferCount, + }; + + /// @brief Physical Region Descriptor Table. + struct PRDT + { + UInt32 fPhysAddress; + UInt32 fSectorCount; + UInt8 fEndBit; + }; + + void construct_prdt(Ref& prd); + + EXTERN_C Int32 kPRDTTransferStatus; +} // namespace Kernel diff --git a/dev/zka/StorageKit/PRDT.hxx b/dev/zka/StorageKit/PRDT.hxx deleted file mode 100644 index df9f3cc1..00000000 --- a/dev/zka/StorageKit/PRDT.hxx +++ /dev/null @@ -1,36 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -#define kPrdtTransferSize (sizeof(Kernel::UShort)) - -namespace Kernel -{ - /// @brief Tranfer information about PRD. - enum kPRDTTransfer - { - kPRDTTransferInProgress, - kPRDTTransferIsDone, - kPRDTTransferCount, - }; - - /// @brief Physical Region Descriptor Table. - struct PRDT - { - UInt32 fPhysAddress; - UInt32 fSectorCount; - UInt8 fEndBit; - }; - - void construct_prdt(Ref& prd); - - EXTERN_C Int32 kPRDTTransferStatus; -} // namespace Kernel diff --git a/dev/zka/StorageKit/SCSI.h b/dev/zka/StorageKit/SCSI.h new file mode 100644 index 00000000..7c2f7c48 --- /dev/null +++ b/dev/zka/StorageKit/SCSI.h @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#pragma once + +#include + +extern const scsi_packet_type<12> kCDRomPacketTemplate; diff --git a/dev/zka/StorageKit/SCSI.hxx b/dev/zka/StorageKit/SCSI.hxx deleted file mode 100644 index 1d8470ec..00000000 --- a/dev/zka/StorageKit/SCSI.hxx +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#pragma once - -#include - -extern const scsi_packet_type<12> kCDRomPacketTemplate; diff --git a/dev/zka/StorageKit/Storage.h b/dev/zka/StorageKit/Storage.h new file mode 100644 index 00000000..5d388c7e --- /dev/null +++ b/dev/zka/StorageKit/Storage.h @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#pragma once + +#define kDriveSectorSizeHDD (512U) +#define kDriveSectorSizeSSD (512U) +#define kDriveSectorSizeOptical (2048) + +namespace Kernel +{ + template + class DeviceInterface; + + class NVMEDeviceInterface; + class AHCIDeviceInterface; + class ATADeviceInterface; + class SCSIDeviceInterface; +} // namespace Kernel diff --git a/dev/zka/StorageKit/Storage.hxx b/dev/zka/StorageKit/Storage.hxx deleted file mode 100644 index 5d388c7e..00000000 --- a/dev/zka/StorageKit/Storage.hxx +++ /dev/null @@ -1,22 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#pragma once - -#define kDriveSectorSizeHDD (512U) -#define kDriveSectorSizeSSD (512U) -#define kDriveSectorSizeOptical (2048) - -namespace Kernel -{ - template - class DeviceInterface; - - class NVMEDeviceInterface; - class AHCIDeviceInterface; - class ATADeviceInterface; - class SCSIDeviceInterface; -} // namespace Kernel -- cgit v1.2.3