From 34f62ae2dd8c77cee1f0f3680caf407b1be6b350 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sat, 22 Feb 2025 08:45:43 +0100 Subject: New DeviceMgr, other APIs have been reworked as a result. AHCI becomes the first module to be available in StorageKit. Signed-off-by: Amlal --- dev/Kernel/src/Storage/AHCIDeviceInterface.cc | 11 ++++++----- dev/Kernel/src/Storage/ATADeviceInterface.cc | 6 +++--- dev/Kernel/src/Storage/NVMEDeviceInterface.cc | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'dev/Kernel/src/Storage') diff --git a/dev/Kernel/src/Storage/AHCIDeviceInterface.cc b/dev/Kernel/src/Storage/AHCIDeviceInterface.cc index a6f36731..ff348f57 100644 --- a/dev/Kernel/src/Storage/AHCIDeviceInterface.cc +++ b/dev/Kernel/src/Storage/AHCIDeviceInterface.cc @@ -12,10 +12,10 @@ using namespace NeOS; /// @param Out Drive output /// @param In Drive input /// @param Cleanup Drive cleanup. -AHCIDeviceInterface::AHCIDeviceInterface(void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), - void (*Cleanup)(void)) - : IDeviceObject(Out, In), fCleanup(Cleanup) +AHCIDeviceInterface::AHCIDeviceInterface(void (*out)(IDeviceObject* self, MountpointInterface* outpacket), + void (*in)(IDeviceObject* self, MountpointInterface* inpacket), + void (*cleanup)(void)) + : IDeviceObject(out, in), fCleanup(cleanup) { } @@ -23,6 +23,7 @@ AHCIDeviceInterface::AHCIDeviceInterface(void (*Out)(MountpointInterface* outpac AHCIDeviceInterface::~AHCIDeviceInterface() { MUST_PASS(fCleanup); + if (fCleanup) fCleanup(); } @@ -31,5 +32,5 @@ AHCIDeviceInterface::~AHCIDeviceInterface() /// @return it's name as a string. const Char* AHCIDeviceInterface::Name() const { - return "AHCIDeviceInterface"; + return "/dev/sda{}"; } diff --git a/dev/Kernel/src/Storage/ATADeviceInterface.cc b/dev/Kernel/src/Storage/ATADeviceInterface.cc index 4223e9f9..9f1a0068 100644 --- a/dev/Kernel/src/Storage/ATADeviceInterface.cc +++ b/dev/Kernel/src/Storage/ATADeviceInterface.cc @@ -13,8 +13,8 @@ using namespace NeOS; /// @param In Drive input /// @param Cleanup Drive cleanup. ATADeviceInterface::ATADeviceInterface( - void (*Out)(MountpointInterface* outpacket), - void (*In)(MountpointInterface* inpacket), + void (*Out)(IDeviceObject*, MountpointInterface* outpacket), + void (*In)(IDeviceObject*, MountpointInterface* inpacket), void (*Cleanup)(void)) : IDeviceObject(Out, In), fCleanup(Cleanup) { @@ -32,7 +32,7 @@ ATADeviceInterface::~ATADeviceInterface() /// @return it's name as a string. const Char* ATADeviceInterface::Name() const { - return "ATADeviceInterface"; + return "/dev/hda{}"; } /// @brief Output operator. diff --git a/dev/Kernel/src/Storage/NVMEDeviceInterface.cc b/dev/Kernel/src/Storage/NVMEDeviceInterface.cc index 7884ce99..3e2c2c53 100644 --- a/dev/Kernel/src/Storage/NVMEDeviceInterface.cc +++ b/dev/Kernel/src/Storage/NVMEDeviceInterface.cc @@ -8,8 +8,8 @@ namespace NeOS { - NVMEDeviceInterface::NVMEDeviceInterface(void (*out)(MountpointInterface* outpacket), - void (*in)(MountpointInterface* inpacket), + NVMEDeviceInterface::NVMEDeviceInterface(void (*out)(IDeviceObject*, MountpointInterface* outpacket), + void (*in)(IDeviceObject*, MountpointInterface* inpacket), void (*cleanup)(void)) : IDeviceObject(out, in), fCleanup(cleanup) { @@ -23,6 +23,6 @@ namespace NeOS const Char* NVMEDeviceInterface::Name() const { - return ("NVMEDeviceInterface"); + return ("/dev/nvme{}"); } } // namespace NeOS -- cgit v1.2.3