From ade3a2578ca8d6836b8e73160455df80d49cf045 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 19 Nov 2024 18:48:45 +0100 Subject: IMP: Implement NVME device as ZKA_DEVICE type. Signed-off-by: Amlal El Mahrouss --- dev/ZKAKit/StorageKit/NVME.h | 16 +++++++--------- dev/ZKAKit/StorageKit/Storage.h | 22 ---------------------- dev/ZKAKit/StorageKit/StorageKit.h | 22 ++++++++++++++++++++++ dev/ZKAKit/src/Storage/NVMEDeviceInterface.cc | 8 ++++---- 4 files changed, 33 insertions(+), 35 deletions(-) delete mode 100644 dev/ZKAKit/StorageKit/Storage.h create mode 100644 dev/ZKAKit/StorageKit/StorageKit.h (limited to 'dev') diff --git a/dev/ZKAKit/StorageKit/NVME.h b/dev/ZKAKit/StorageKit/NVME.h index b2af9734..3cab60c3 100644 --- a/dev/ZKAKit/StorageKit/NVME.h +++ b/dev/ZKAKit/StorageKit/NVME.h @@ -8,29 +8,27 @@ #include #include -#include namespace Kernel { - class NVMEDeviceInterface final : public DeviceInterface + class NVMEDeviceInterface final ZKA_DEVICE { public: - explicit NVMEDeviceInterface(void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)); + explicit NVMEDeviceInterface(Void (*out)(MountpointInterface* out_packet), + Void (*in)(MountpointInterface* in_packet), + Void (*cleanup)(Void)); ~NVMEDeviceInterface() override; public: - NVMEDeviceInterface& operator=(const NVMEDeviceInterface&) = default; - NVMEDeviceInterface(const NVMEDeviceInterface&) = default; + ZKA_COPY_DEFAULT(NVMEDeviceInterface); const Char* Name() const override; public: - OwnPtr operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); + OwnPtr operator()(UInt32 dma_low, UInt32 dma_high, SizeT dma_sz); private: - void (*fCleanup)(void) = {nullptr}; + Void (*fCleanup)(Void) = {nullptr}; }; } // namespace Kernel diff --git a/dev/ZKAKit/StorageKit/Storage.h b/dev/ZKAKit/StorageKit/Storage.h deleted file mode 100644 index 4b8b2411..00000000 --- a/dev/ZKAKit/StorageKit/Storage.h +++ /dev/null @@ -1,22 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024, EL Mahrouss Logic, all rights reserved. - -------------------------------------------- */ - -#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/ZKAKit/StorageKit/StorageKit.h b/dev/ZKAKit/StorageKit/StorageKit.h new file mode 100644 index 00000000..4b8b2411 --- /dev/null +++ b/dev/ZKAKit/StorageKit/StorageKit.h @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright (C) 2024, EL Mahrouss Logic, all rights reserved. + +------------------------------------------- */ + +#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/ZKAKit/src/Storage/NVMEDeviceInterface.cc b/dev/ZKAKit/src/Storage/NVMEDeviceInterface.cc index 5e5f9160..89ce4fb2 100644 --- a/dev/ZKAKit/src/Storage/NVMEDeviceInterface.cc +++ b/dev/ZKAKit/src/Storage/NVMEDeviceInterface.cc @@ -8,10 +8,10 @@ namespace Kernel { - NVMEDeviceInterface::NVMEDeviceInterface(void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)) - : DeviceInterface(Out, In), fCleanup(Cleanup) + NVMEDeviceInterface::NVMEDeviceInterface(void (*out)(MountpointInterface* outpacket), + void (*in)(MountpointInterface* inpacket), + void (*cleanup)(void)) + : DeviceInterface(out, in), fCleanup(cleanup) { } -- cgit v1.2.3