From 141786008aa639c313d83a6a06db700ed69ed064 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 23 Aug 2025 09:13:37 +0200 Subject: feat: scheduler: ProcessImage should be friend with KernelScheduler, not helper. feat! scheduler: Introduce ProcessID as only PID type. Signed-off-by: Amlal El Mahrouss --- dev/kernel/src/UserProcessScheduler.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dev/kernel/src') diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc index b73c9a3f..19e509ed 100644 --- a/dev/kernel/src/UserProcessScheduler.cc +++ b/dev/kernel/src/UserProcessScheduler.cc @@ -437,7 +437,7 @@ ProcessID UserProcessScheduler::Spawn(const Char* name, VoidPtr code, VoidPtr im /// @todo File Tree allocation and dispose methods (amlal) } - (Void)(kout << "PID: " << number(process.ProcessId) << kendl); + (Void)(kout << "ProcessID: " << number(process.ProcessId) << kendl); (Void)(kout << "Name: " << process.Name << kendl); return pid; @@ -573,11 +573,11 @@ Ref& UserProcessScheduler::TheCurrentProcess() { /// @brief Current proccess id getter. /// @return USER_PROCESS ID integer. -ErrorOr UserProcessHelper::TheCurrentPID() { - if (!UserProcessScheduler::The().TheCurrentProcess()) return ErrorOr{-kErrorProcessFault}; +ErrorOr UserProcessHelper::TheCurrentPID() { + if (!UserProcessScheduler::The().TheCurrentProcess()) return ErrorOr{-kErrorProcessFault}; kout << "UserProcessHelper::TheCurrentPID: Leaking ProcessId...\r"; - return ErrorOr{UserProcessScheduler::The().TheCurrentProcess().Leak().ProcessId}; + return ErrorOr{UserProcessScheduler::The().TheCurrentProcess().Leak().ProcessId}; } /// @brief Check if process can be schedulded. @@ -613,11 +613,11 @@ SizeT UserProcessHelper::StartScheduling() { /** * \brief Does a context switch in a CPU. * \param the_stack the stackframe of the running app. - * \param new_pid the process's PID. + * \param new_pid the process's ProcessID. */ /***********************************************************************************/ -Bool UserProcessHelper::Switch(HAL::StackFramePtr frame_ptr, PID new_pid) { +Bool UserProcessHelper::Switch(HAL::StackFramePtr frame_ptr, ProcessID new_pid) { (Void)(kout << "IP: " << hex_number(frame_ptr->IP) << kendl); for (SizeT index = 0UL; index < HardwareThreadScheduler::The().Capacity(); ++index) { -- cgit v1.2.3