From 9e5339aed47bdb25a811a00bc5e376006aaadcf4 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss <113760121+Amlal-ElMahrouss@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:15:45 +0100 Subject: Update DeviceMgr.h Incrementally improving the DeviceMgr. --- dev/ZKAKit/KernelKit/DeviceMgr.h | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'dev') diff --git a/dev/ZKAKit/KernelKit/DeviceMgr.h b/dev/ZKAKit/KernelKit/DeviceMgr.h index a38f39d1..cbdfb542 100644 --- a/dev/ZKAKit/KernelKit/DeviceMgr.h +++ b/dev/ZKAKit/KernelKit/DeviceMgr.h @@ -15,16 +15,16 @@ #pragma once -/* Device manager. */ +/* @note Device Mgr. */ /* @file KernelKit/DeviceMgr.h */ /* @brief Device abstraction and I/O buffer. */ #include #include -#define kDeviceRootDirPath "/Mount/" +#define kDeviceMgrRootDirPath "/Devices/" -#define ZKA_DEVICE(T) : public ::Kernel::DeviceInterface +#define ZKA_DEVICE : public ::Kernel::DeviceInterface // Last Rev: Wed, Apr 3, 2024 9:09:41 AM @@ -34,17 +34,14 @@ namespace Kernel class DeviceInterface; /***********************************************************************************/ - /// @brief Device interface class. - /// @note This is a class which represents an hardware device. + /// @brief Device contract interface, represents an HW device. /***********************************************************************************/ template class DeviceInterface { public: explicit DeviceInterface(void (*Out)(T), void (*In)(T)) - : fOut(Out), fIn(In) - { - } + : fOut(Out), fIn(In) {} virtual ~DeviceInterface() = default; @@ -86,18 +83,18 @@ namespace Kernel }; /// - /// @brief Input Output Buffer + /// @brief Input Output abstract class. /// Used mainly to communicate between OS to hardware. /// template class IOBuf final { public: - explicit IOBuf(T Dat) - : fData(Dat) + explicit IOBuf(T dma_addr) + : fData(dma_addr) { - // at least pass something valid when instancating this struct. - MUST_PASS(Dat); + // At least pass something valid when instancating this struct. + MUST_PASS(fData); } IOBuf& operator=(const IOBuf&) = default; @@ -135,7 +132,7 @@ namespace Kernel kDeviceTypeAHCI, kDeviceTypeMBCI, kDeviceTypeUSB, - kDeviceTypeMediaCtrl, + kDeviceTypeMediaCtrl, // MM controller kDeviceTypeCount, }; } // namespace Kernel -- cgit v1.2.3