summaryrefslogtreecommitdiffhomepage
path: root/Private/KernelKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-26 13:44:38 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-26 13:47:32 +0100
commit66e4f909bd1a495d3f1c34d2e1b5cd71099ab1ae (patch)
treed64cc867d352d190dfd5693262a42b31e28b9239 /Private/KernelKit
parentdbe4573f61ae059c9dafb8e7623370121d443451 (diff)
Kernel and System.Core: kernel related fixes and :boom: on User API.
- UserHeap.cxx: Document code and fix issue in ke_free_heap_internal. - Scheduler: Rename ProcessManager to ProcessScheduler. - The System API has been reworked to improve it's design, such as no more C++ to improve it's portability. - Moved containers into it's own API. Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/KernelKit')
-rw-r--r--Private/KernelKit/ProcessScheduler.hpp16
-rw-r--r--Private/KernelKit/ThreadLocalStorage.inl8
2 files changed, 12 insertions, 12 deletions
diff --git a/Private/KernelKit/ProcessScheduler.hpp b/Private/KernelKit/ProcessScheduler.hpp
index bc974a9b..4f499033 100644
--- a/Private/KernelKit/ProcessScheduler.hpp
+++ b/Private/KernelKit/ProcessScheduler.hpp
@@ -26,7 +26,7 @@
namespace HCore {
class ProcessHeader;
class ProcessTeam;
-class ProcessManager;
+class ProcessScheduler;
//! @brief ProcessHeader identifier.
typedef Int64 ProcessID;
@@ -36,7 +36,7 @@ inline constexpr SizeT kProcessLen = 256U;
//! @brief Forward declaration.
class ProcessHeader;
-class ProcessManager;
+class ProcessScheduler;
class ProcessHelper;
//! @brief ProcessHeader status enum.
@@ -181,7 +181,7 @@ class ProcessHeader final {
const AffinityKind &GetAffinity();
private:
- friend ProcessManager;
+ friend ProcessScheduler;
friend ProcessHelper;
};
@@ -206,14 +206,14 @@ using ProcessPtr = ProcessHeader *;
/// @brief ProcessHeader manager class.
/// The main class which you call to schedule an app.
-class ProcessManager final {
+class ProcessScheduler final {
private:
- explicit ProcessManager() = default;
+ explicit ProcessScheduler() = default;
public:
- ~ProcessManager() = default;
+ ~ProcessScheduler() = default;
- HCORE_COPY_DEFAULT(ProcessManager)
+ HCORE_COPY_DEFAULT(ProcessScheduler)
operator bool() { return mTeam.AsArray().Count() > 0; }
bool operator!() { return mTeam.AsArray().Count() == 0; }
@@ -226,7 +226,7 @@ class ProcessManager final {
Ref<ProcessHeader> &GetCurrent();
SizeT Run() noexcept;
- static Ref<ProcessManager> Shared();
+ static Ref<ProcessScheduler> Shared();
private:
ProcessTeam mTeam;
diff --git a/Private/KernelKit/ThreadLocalStorage.inl b/Private/KernelKit/ThreadLocalStorage.inl
index 4a8a816a..fe2d02d0 100644
--- a/Private/KernelKit/ThreadLocalStorage.inl
+++ b/Private/KernelKit/ThreadLocalStorage.inl
@@ -14,9 +14,9 @@ template <typename T>
inline T* tls_new_ptr(void) {
using namespace HCore;
- MUST_PASS(ProcessManager::Shared().Leak().GetCurrent());
+ MUST_PASS(ProcessScheduler::Shared().Leak().GetCurrent());
- auto ref_process = ProcessManager::Shared().Leak().GetCurrent();
+ auto ref_process = ProcessScheduler::Shared().Leak().GetCurrent();
T* pointer = (T*)ref_process.Leak().New(sizeof(T));
return pointer;
@@ -29,11 +29,11 @@ inline bool tls_delete_ptr(T* ptr) {
using namespace HCore;
- MUST_PASS(ProcessManager::Shared().Leak().GetCurrent());
+ MUST_PASS(ProcessScheduler::Shared().Leak().GetCurrent());
ptr->~T();
- auto ref_process = ProcessManager::Shared().Leak().GetCurrent();
+ auto ref_process = ProcessScheduler::Shared().Leak().GetCurrent();
return ref_process.Leak().Delete(ptr, sizeof(T));
}