Implement GetIdle function in Custom scheduler

This commit is contained in:
EnderIce2 2024-03-02 00:16:18 +02:00
parent df457e8097
commit 525a102f20
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 11 additions and 0 deletions

View File

@ -93,6 +93,11 @@ namespace Tasking::Scheduler
assert(!"PopProcess not implemented"); assert(!"PopProcess not implemented");
} }
virtual std::pair<PCB *, TCB *> GetIdle()
{
assert(!"GetIdle not implemented");
}
Base(Task *_ctx) Base(Task *_ctx)
: ctx(_ctx) {} : ctx(_ctx) {}
@ -121,6 +126,7 @@ namespace Tasking::Scheduler
void Yield() final; void Yield() final;
void PushProcess(PCB *pcb) final; void PushProcess(PCB *pcb) final;
void PopProcess(PCB *pcb) final; void PopProcess(PCB *pcb) final;
std::pair<PCB *, TCB *> GetIdle() final;
void OneShot(int TimeSlice); void OneShot(int TimeSlice);

View File

@ -252,6 +252,11 @@ namespace Tasking::Scheduler
this->ProcessList.remove(pcb); this->ProcessList.remove(pcb);
} }
std::pair<PCB *, TCB *> Custom::GetIdle()
{
return std::make_pair(IdleProcess, IdleThread);
}
/* --------------------------------------------------------------- */ /* --------------------------------------------------------------- */
nsa void Custom::OneShot(int TimeSlice) nsa void Custom::OneShot(int TimeSlice)