diff options
| author | Amlal <amlal@el-mahrouss-logic.com> | 2024-10-23 10:08:05 +0200 |
|---|---|---|
| committer | Amlal <amlal@el-mahrouss-logic.com> | 2024-10-23 10:08:05 +0200 |
| commit | 08e69a55cfda4722277d16ddb632669edde3580b (patch) | |
| tree | c84511296c0a8d290673df8ffaa52ef75a65a877 /dev/zka/src/UserProcessScheduler.cc | |
| parent | 1742d940e54696432459b8ced18b99bcafeb2178 (diff) | |
IMP: Process scheduler timer interrupt have been implemented, fixes regarding interrupt API and use __TOOLCHAINKIT__ instead of __NDK__
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/zka/src/UserProcessScheduler.cc')
| -rw-r--r-- | dev/zka/src/UserProcessScheduler.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/dev/zka/src/UserProcessScheduler.cc b/dev/zka/src/UserProcessScheduler.cc index bbe644dc..0081367a 100644 --- a/dev/zka/src/UserProcessScheduler.cc +++ b/dev/zka/src/UserProcessScheduler.cc @@ -423,6 +423,12 @@ namespace Kernel SizeT process_index = 0; //! we store this guy to tell the scheduler how many //! things we have scheduled. + if (mTeam.mProcessAmount < 1) + { + kcout << "UserProcessScheduler::Run(): This team doesn't have any process!\r"; + return 0; + } + for (; process_index < mTeam.AsArray().Capacity(); ++process_index) { auto& process = mTeam.AsArray()[process_index]; @@ -430,9 +436,6 @@ namespace Kernel //! check if process needs to be scheduled. if (UserProcessHelper::CanBeScheduled(process)) { - // Set current process header. - this->CurrentProcess() = process; - process.PTime = static_cast<Int32>(process.Affinity); UserProcessScheduler::The().CurrentProcess().Leak().Status = ProcessStatusKind::kFrozen; @@ -440,6 +443,9 @@ namespace Kernel kcout << "Switch to '" << process.Name << "'.\r"; + // Set current process header. + this->CurrentProcess() = process; + // tell helper to find a core to schedule on. if (!UserProcessHelper::Switch(process.Image, &process.StackReserve[process.StackSize - 1], process.StackFrame, process.ProcessId)) @@ -494,6 +500,10 @@ namespace Kernel process.Status == ProcessStatusKind::kDead) return No; + if (process.Status == ProcessStatusKind::kStarting && + process.Image) + return Yes; + if (!process.Image && process.Kind == UserProcess::kExectuableKind) return No; |
