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 --- CODEOWNERS | 5 ++--- 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 ++++---- zka-dev.files | 2 +- 6 files changed, 36 insertions(+), 39 deletions(-) delete mode 100644 dev/ZKAKit/StorageKit/Storage.h create mode 100644 dev/ZKAKit/StorageKit/StorageKit.h diff --git a/CODEOWNERS b/CODEOWNERS index 51ccdb77..e582db7d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,5 +1,4 @@ -# ZBA and ZKA are owned by Amlal. +# ZBA, SCI and ZKA are owned by Amlal. /dev/ZKAKit/ @Amlal-ElMahrouss /dev/ZBAKit/ @Amlal-ElMahrouss - -# SCI is led by none. +/dev/SCIKit/ @Amlal-ElMahrouss 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) { } diff --git a/zka-dev.files b/zka-dev.files index 7d43859f..adbcd33e 100644 --- a/zka-dev.files +++ b/zka-dev.files @@ -260,7 +260,7 @@ dev/ZKAKit/StorageKit/ATA.h dev/ZKAKit/StorageKit/NVME.h dev/ZKAKit/StorageKit/PRDT.h dev/ZKAKit/StorageKit/SCSI.h -dev/ZKAKit/StorageKit/Storage.h +dev/ZKAKit/StorageKit/StorageKit.h dev/ZKAKit/amd64-efi.make dev/ZKAKit/arm64-efi.make dev/ZKAKit/doc/Explicit Partition Map.pdf -- cgit v1.2.3