mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-03 02:34:48 +12:00
[Kernel] Fix ArbitrateAddress
This commit is contained in:
parent
919951516a
commit
77078f73b3
5 changed files with 25 additions and 13 deletions
include/kernel
|
@ -66,6 +66,7 @@ class Kernel {
|
|||
Handle makeSession(Handle port);
|
||||
Handle makeThread(u32 entrypoint, u32 initialSP, u32 priority, u32 id, ThreadStatus status = ThreadStatus::Dormant);
|
||||
|
||||
void sleepThreadOnArbiter(u32 waitingAddress);
|
||||
void switchThread(int newThreadIndex);
|
||||
|
||||
std::optional<Handle> getPortHandle(const char* name);
|
||||
|
|
|
@ -88,13 +88,13 @@ struct Session {
|
|||
};
|
||||
|
||||
enum class ThreadStatus {
|
||||
Running, // Currently running
|
||||
Ready, // Ready to run
|
||||
WaitArb, // Waiting on an address arbiter
|
||||
WaitSleep, // Waiting due to a SleepThread SVC
|
||||
WaitIPC, // Waiting for the reply from an IPC request
|
||||
Dormant, // Created but not yet made ready
|
||||
Dead // Run to completion, or forcefully terminated
|
||||
Running, // Currently running
|
||||
Ready, // Ready to run
|
||||
WaitArbiter, // Waiting on an address arbiter
|
||||
WaitSleep, // Waiting due to a SleepThread SVC
|
||||
WaitIPC, // Waiting for the reply from an IPC request
|
||||
Dormant, // Created but not yet made ready
|
||||
Dead // Run to completion, or forcefully terminated
|
||||
};
|
||||
|
||||
struct Thread {
|
||||
|
@ -104,6 +104,9 @@ struct Thread {
|
|||
u32 processorID;
|
||||
ThreadStatus status;
|
||||
Handle handle; // OS handle for this thread
|
||||
|
||||
// The waiting address for threads that are waiting on an AddressArbiter
|
||||
u32 waitingAddress;
|
||||
|
||||
// Thread context used for switching between threads
|
||||
std::array<u32, 16> gprs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue