diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-08 12:32:41 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-08 12:32:41 +0200 |
| commit | 09dd11ddf800898c00ecb04a65fb5cd10fb481fa (patch) | |
| tree | eda0b4e23d6a71da7de3a78f0bb76ec3201dd2f9 /NewKernel/StorageKit/NVME.hpp | |
| parent | ca83108fd138cc0398f900e6a6c0a53ad51aee31 (diff) | |
MHR-23: :boom: changes, reworked project tree.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'NewKernel/StorageKit/NVME.hpp')
| -rw-r--r-- | NewKernel/StorageKit/NVME.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/NewKernel/StorageKit/NVME.hpp b/NewKernel/StorageKit/NVME.hpp new file mode 100644 index 00000000..7b570cf2 --- /dev/null +++ b/NewKernel/StorageKit/NVME.hpp @@ -0,0 +1,43 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include <KernelKit/DeviceManager.hpp> +#include <KernelKit/DriveManager.hxx> +#include <NewKit/OwnPtr.hpp> + +namespace NewOS +{ + class NVMEDeviceInterface : public DeviceInterface<MountpointInterface*> + { + public: + explicit NVMEDeviceInterface(void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), + void (*Cleanup)(void)) + : DeviceInterface(Out, In), fCleanup(Cleanup) + { + } + + virtual ~NVMEDeviceInterface() + { + if (fCleanup) + fCleanup(); + } + + public: + NVMEDeviceInterface& operator=(const NVMEDeviceInterface&) = default; + NVMEDeviceInterface(const NVMEDeviceInterface&) = default; + + const char* Name() const override; + + public: + OwnPtr<MountpointInterface*> operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); + + private: + void (*fCleanup)(void); + }; +} // namespace NewOS |
