mirror of
https://github.com/izzy2lost/Panda3DS.git
synced 2026-03-10 12:38:37 -07:00
Thread bonk part 1: Better rescheduling maybe
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user