summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/NewKit
diff options
context:
space:
mode:
authorAmlal <amlal@el-mahrouss-logic.com>2024-09-11 11:45:52 +0200
committerAmlal <amlal@el-mahrouss-logic.com>2024-09-11 11:45:52 +0200
commit8b6cc0cbe5e19e8114a65785e24bbcf4d22e0d2f (patch)
tree3713620f703318ab9fb9ad6906263e68c64ee789 /dev/ZKA/NewKit
parent56fcf152004c913bddd19b6eeac1f96eb2c9b869 (diff)
IMP: Better architecture for task scheduling.
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/ZKA/NewKit')
-rw-r--r--dev/ZKA/NewKit/Defines.hxx47
1 files changed, 39 insertions, 8 deletions
diff --git a/dev/ZKA/NewKit/Defines.hxx b/dev/ZKA/NewKit/Defines.hxx
index 77d400df..395b14a5 100644
--- a/dev/ZKA/NewKit/Defines.hxx
+++ b/dev/ZKA/NewKit/Defines.hxx
@@ -67,7 +67,7 @@ namespace Kernel
using WideChar = wchar_t;
using Utf32Char = char32_t;
- typedef UInt32 PhysicalAddressKind;
+ typedef UInt32 PhysicalAddressKind;
typedef UIntPtr VirtualAddressKind;
using Void = void;
@@ -103,16 +103,16 @@ namespace Kernel
return static_cast<Args&&>(arg);
}
- /// @brief Encoder class
+ /// @brief Coder/Decoder class, used as a proxy to convert T to Char*
/// Used to cast A to B or B to A.
- class Encoder final
+ class IEncoderObject final
{
public:
- explicit Encoder() = default;
- ~Encoder() = default;
+ explicit IEncoderObject() = default;
+ ~IEncoderObject() = default;
- Encoder& operator=(const Encoder&) = default;
- Encoder(const Encoder&) = default;
+ IEncoderObject& operator=(const IEncoderObject&) = default;
+ IEncoderObject(const IEncoderObject&) = default;
public:
/// @brief Convert type to bytes.
@@ -122,7 +122,7 @@ namespace Kernel
template <typename T>
Char* AsBytes(T type) noexcept
{
- return reinterpret_cast<Char*>(type);
+ return nullptr;
}
/// @brief Convert T class to Y class.
@@ -133,9 +133,40 @@ namespace Kernel
template <typename T, typename Y>
Y As(T type) noexcept
{
+ if (type.IsCastable())
+ {
+ return reinterpret_cast<Char*>(type);
+ }
+
return type.template As<Y>();
}
};
+
+ class ISchedulerObject
+ {
+ public:
+ explicit ISchedulerObject() = default;
+ virtual ~ISchedulerObject() = default;
+
+ ISchedulerObject& operator=(const ISchedulerObject&) = default;
+ ISchedulerObject(const ISchedulerObject&) = default;
+
+ virtual const Bool IsUser()
+ {
+ return false;
+ }
+
+ virtual const Bool IsKernel()
+ {
+ return false;
+ }
+
+ virtual const Bool HasMP()
+ {
+ return false;
+ }
+
+ };
} // namespace Kernel
#define DEDUCE_ENDIAN(address, value) \