mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
Thread bonk part 1: Better rescheduling maybe
This commit is contained in:
parent
0ab1d6a0cc
commit
8dd5b990be
4 changed files with 48 additions and 42 deletions
|
@ -52,6 +52,9 @@ class Kernel {
|
|||
// Top 8 bits are the major version, bottom 8 are the minor version
|
||||
u16 kernelVersion = 0;
|
||||
|
||||
// Shows whether a reschedule will be need
|
||||
bool needReschedule = false;
|
||||
|
||||
Handle makeArbiter();
|
||||
Handle makeProcess(u32 id);
|
||||
Handle makePort(const char* name);
|
||||
|
@ -73,7 +76,6 @@ private:
|
|||
void switchThread(int newThreadIndex);
|
||||
void sortThreads();
|
||||
std::optional<int> getNextThread();
|
||||
void switchToNextThread();
|
||||
void rescheduleThreads();
|
||||
bool canThreadRun(const Thread& t);
|
||||
bool shouldWaitOnObject(KernelObject* object);
|
||||
|
@ -168,6 +170,8 @@ public:
|
|||
void serviceSVC(u32 svc);
|
||||
void reset();
|
||||
|
||||
void requireReschedule() { needReschedule = true; }
|
||||
|
||||
Handle makeObject(KernelObjectType type) {
|
||||
if (handleCounter > KernelHandles::Max) [[unlikely]] {
|
||||
Helpers::panic("Hlep we somehow created enough kernel objects to overflow this thing");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue