mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
[Kernel] Much better arbiter & thread scheduling impl
This commit is contained in:
parent
d777981204
commit
81b0f3dde0
8 changed files with 109 additions and 12 deletions
|
@ -23,6 +23,9 @@ class Kernel {
|
|||
std::vector<KernelObject> objects;
|
||||
std::vector<Handle> portHandles;
|
||||
|
||||
// Thread indices, sorted by priority
|
||||
std::vector<int> threadIndices;
|
||||
|
||||
Handle currentProcess;
|
||||
Handle mainThread;
|
||||
int currentThreadIndex;
|
||||
|
@ -62,8 +65,14 @@ class Kernel {
|
|||
Handle makeSession(Handle port);
|
||||
Handle makeThread(u32 entrypoint, u32 initialSP, u32 priority, s32 id, u32 arg,ThreadStatus status = ThreadStatus::Dormant);
|
||||
|
||||
void signalArbiter(u32 waitingAddress, s32 threadCount);
|
||||
void sleepThreadOnArbiter(u32 waitingAddress);
|
||||
void switchThread(int newThreadIndex);
|
||||
void sortThreads();
|
||||
std::optional<int> getNextThread();
|
||||
void switchToNextThread();
|
||||
void rescheduleThreads();
|
||||
bool canThreadRun(const Thread& t);
|
||||
|
||||
std::optional<Handle> getPortHandle(const char* name);
|
||||
void deleteObjectData(KernelObject& object);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue