diff options
| author | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-08 08:18:37 +0200 |
|---|---|---|
| committer | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-08 08:18:37 +0200 |
| commit | df8a42aa1266d953a9ee473afe9f6349bd1837c7 (patch) | |
| tree | cad53c222ca90ee98ac82ee2d630a4ff0b0c3ee3 /dev/ZKA/KernelKit/UserProcessScheduler.hxx | |
| parent | 884ea5c2d43b6c8d4c2bb4fc33c11dc2313eeca2 (diff) | |
[dev/FeatureAdd] Add mm_new_class, as C++ new doesn't initialize class directly.
[dev/FeatureFix] CR2 set to invalid address due to stack corruption, fixing that.
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/ZKA/KernelKit/UserProcessScheduler.hxx')
| -rw-r--r-- | dev/ZKA/KernelKit/UserProcessScheduler.hxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/dev/ZKA/KernelKit/UserProcessScheduler.hxx b/dev/ZKA/KernelKit/UserProcessScheduler.hxx index c35b65e1..845c0081 100644 --- a/dev/ZKA/KernelKit/UserProcessScheduler.hxx +++ b/dev/ZKA/KernelKit/UserProcessScheduler.hxx @@ -150,7 +150,7 @@ namespace Kernel UInt8* StackReserve{nullptr}; // Memory, images pointers. - ImagePtr Image{nullptr}; + ImagePtr Image{nullptr}; SizeT StackSize{mib_cast(8)}; @@ -168,9 +168,9 @@ namespace Kernel { VoidPtr MemoryEntry; - struct PROCESS_MEMORY_ENTRY *MemoryPrev; - struct PROCESS_MEMORY_ENTRY *MemoryNext; - } * MemoryEntryList{nullptr}; + struct PROCESS_MEMORY_ENTRY* MemoryPrev; + struct PROCESS_MEMORY_ENTRY* MemoryNext; + }* MemoryEntryList{nullptr}; SizeT MemoryPD{0}; @@ -259,6 +259,8 @@ namespace Kernel /// The main class which you call to schedule processes. class UserProcessScheduler final { + friend class UserProcessHelper; + public: explicit UserProcessScheduler() = default; @@ -266,14 +268,14 @@ namespace Kernel ZKA_COPY_DEFAULT(UserProcessScheduler) - operator bool(); + operator bool(); bool operator!(); public: UserProcessTeam& CurrentTeam(); public: - SizeT Add(UserProcess& processRef); + SizeT Add(UserProcess processRef); Bool Remove(ProcessID processSlot); public: @@ -294,11 +296,10 @@ namespace Kernel class UserProcessHelper final { public: - STATIC bool Switch(VoidPtr image_ptr, UInt8* stack_ptr, HAL::StackFramePtr frame_ptr, const PID& new_pid); - STATIC bool CanBeScheduled(const UserProcess process); + STATIC bool Switch(VoidPtr image_ptr, UInt8* stack_ptr, HAL::StackFramePtr frame_ptr, const PID& new_pid); + STATIC bool CanBeScheduled(const UserProcess& process); STATIC PID& TheCurrentPID(); STATIC SizeT StartScheduling(); - }; const UInt32& sched_get_exit_code(void) noexcept; |
