From ef71b80d3df1969a2be85eadf2d83cd85745469d Mon Sep 17 00:00:00 2001 From: Amlal Date: Sun, 8 Sep 2024 22:19:00 +0200 Subject: A lot: - Changed task banks are being switched in the kernel. - Changed user mode switch mode, improved it to push rflags. - User proc will start the scheduler when it's being jumped on. Signed-off-by: Amlal --- dev/ZKA/ArchKit/ArchKit.hxx | 4 +-- dev/ZKA/HALKit/AMD64/HalCoreMPScheduler.cxx | 2 +- dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm | 35 +++++++++++++++++--------- dev/ZKA/HALKit/ARM64/HalSchedulerCore.cxx | 2 +- dev/ZKA/HALKit/POWER/HalContextSwitchPowerPC.s | 6 +++-- dev/ZKA/Sources/ExeMain.cxx | 7 ++---- dev/ZKA/Sources/HardwareThreadScheduler.cxx | 25 ++++++------------ 7 files changed, 39 insertions(+), 42 deletions(-) (limited to 'dev/ZKA') diff --git a/dev/ZKA/ArchKit/ArchKit.hxx b/dev/ZKA/ArchKit/ArchKit.hxx index 6e93359b..8ccb430c 100644 --- a/dev/ZKA/ArchKit/ArchKit.hxx +++ b/dev/ZKA/ArchKit/ArchKit.hxx @@ -107,6 +107,4 @@ inline Kernel::ArrayGetParser()) { @@ -146,8 +146,5 @@ EXTERN_C Kernel::Void ke_dll_entrypoint(Kernel::Void) CG::CGDrawStringToWnd(cKernelWnd, "Running: ", 10, 10, RGB(0, 0, 0)); CG::CGDrawStringToWnd(cKernelWnd, kSysProcess, 10, 10 + (FONT_SIZE_X * Kernel::rt_string_len("Running: ")), RGB(0, 0, 0)); - while (Yes) - { - Kernel::UserProcessHelper::StartScheduling(); - } + mp_do_user_switch(); } diff --git a/dev/ZKA/Sources/HardwareThreadScheduler.cxx b/dev/ZKA/Sources/HardwareThreadScheduler.cxx index 09eadefb..e5947357 100644 --- a/dev/ZKA/Sources/HardwareThreadScheduler.cxx +++ b/dev/ZKA/Sources/HardwareThreadScheduler.cxx @@ -97,27 +97,16 @@ namespace Kernel fStack = frame; - if (kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled) - { - if (this->IsBusy()) - return false; + if (this->IsBusy()) + return false; - kcout << "Switching to the Process's HW thread...\r"; + kcout << "Registering process bank...\r"; - this->Busy(true); - Bool ret = mp_register_process(image, stack_ptr, fStack); - this->Busy(false); + this->Busy(true); + Bool ret = mp_register_process(image, stack_ptr, fStack); + this->Busy(false); - return ret; - } - else - { - kcout << "Switching to the Process's thread...\r"; - - mp_do_context_switch(image, stack_ptr, fStack); - - return Yes; - } + return ret; } ///! @brief Tells if processor is waked up. -- cgit v1.2.3