From 0e92d4841f0d1b6a5f2e1b093d9d0b6864dfac93 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 30 May 2025 10:56:29 +0200 Subject: refactor: Refactor IDeviceObject to DeviceInterface and its usages. refactor: Cleanup UPS (UserProcessScheduler) implementation. Signed-off-by: Amlal El Mahrouss --- dev/kernel/KernelKit/DeviceMgr.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'dev/kernel/KernelKit/DeviceMgr.h') diff --git a/dev/kernel/KernelKit/DeviceMgr.h b/dev/kernel/KernelKit/DeviceMgr.h index 0a21710d..d82b43dc 100644 --- a/dev/kernel/KernelKit/DeviceMgr.h +++ b/dev/kernel/KernelKit/DeviceMgr.h @@ -24,13 +24,13 @@ #define kDeviceMgrRootDirPath "/devices/" -#define NE_DEVICE : public ::Kernel::IDeviceObject +#define NE_DEVICE : public ::Kernel::DeviceInterface // Last Rev: Wed, May 27, 2025 6:22 PM namespace Kernel { template -class IDeviceObject; +class DeviceInterface; template class IOBuf; @@ -39,26 +39,26 @@ class IOBuf; /// @brief Device contract interface, represents an HW device. /***********************************************************************************/ template -class IDeviceObject { +class DeviceInterface { public: - IDeviceObject() = default; + DeviceInterface() = default; - explicit IDeviceObject(void (*Out)(IDeviceObject*, T), void (*In)(IDeviceObject*, T)) + explicit DeviceInterface(void (*Out)(DeviceInterface*, T), void (*In)(DeviceInterface*, T)) : fOut(Out), fIn(In) {} - virtual ~IDeviceObject() = default; + virtual ~DeviceInterface() = default; public: - IDeviceObject& operator=(const IDeviceObject&) = default; - IDeviceObject(const IDeviceObject&) = default; + DeviceInterface& operator=(const DeviceInterface&) = default; + DeviceInterface(const DeviceInterface&) = default; public: - virtual IDeviceObject& operator<<(T Data) { + virtual DeviceInterface& operator<<(T Data) { fOut(this, Data); return *this; } - virtual IDeviceObject& operator>>(T Data) { + virtual DeviceInterface& operator>>(T Data) { fIn(this, Data); return *this; } @@ -70,8 +70,8 @@ class IDeviceObject { Bool operator!() { return !fOut || !fIn; } protected: - Void (*fOut)(IDeviceObject*, T Data) = {nullptr}; - Void (*fIn)(IDeviceObject*, T Data) = {nullptr}; + Void (*fOut)(DeviceInterface*, T Data) = {nullptr}; + Void (*fIn)(DeviceInterface*, T Data) = {nullptr}; }; /// -- cgit v1.2.3