summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal El Mahrouss <113760121+Amlal-ElMahrouss@users.noreply.github.com>2024-11-18 13:15:45 +0100
committerGitHub <noreply@github.com>2024-11-18 13:15:45 +0100
commit9e5339aed47bdb25a811a00bc5e376006aaadcf4 (patch)
tree1cff0223cf857b3a614866602751c95249110f7b /dev
parentd7c99ab3cd5815f6f1e051a9a4e270edd13d6519 (diff)
Update DeviceMgr.h
Incrementally improving the DeviceMgr.
Diffstat (limited to 'dev')
-rw-r--r--dev/ZKAKit/KernelKit/DeviceMgr.h25
1 files changed, 11 insertions, 14 deletions
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 <NewKit/ErrorOr.h>
#include <NewKit/Ref.h>
-#define kDeviceRootDirPath "/Mount/"
+#define kDeviceMgrRootDirPath "/Devices/"
-#define ZKA_DEVICE(T) : public ::Kernel::DeviceInterface<T>
+#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 <typename T>
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 <typename T>
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<T>&) = default;
@@ -135,7 +132,7 @@ namespace Kernel
kDeviceTypeAHCI,
kDeviceTypeMBCI,
kDeviceTypeUSB,
- kDeviceTypeMediaCtrl,
+ kDeviceTypeMediaCtrl, // MM controller
kDeviceTypeCount,
};
} // namespace Kernel