mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
Add status variable to threads
This commit is contained in:
parent
1ac9417d50
commit
0d9088eddc
5 changed files with 20 additions and 8 deletions
|
@ -59,7 +59,7 @@ class Kernel {
|
|||
Handle makeProcess();
|
||||
Handle makePort(const char* name);
|
||||
Handle makeSession(Handle port);
|
||||
Handle makeThread(u32 entrypoint, u32 initialSP, u32 priority, u32 id);
|
||||
Handle makeThread(u32 entrypoint, u32 initialSP, u32 priority, u32 id, ThreadStatus status = ThreadStatus::Dormant);
|
||||
|
||||
std::optional<Handle> getPortHandle(const char* name);
|
||||
void deleteObjectData(KernelObject& object);
|
||||
|
|
|
@ -86,14 +86,26 @@ struct Session {
|
|||
Session(Handle portHandle) : portHandle(portHandle) {}
|
||||
};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
struct Thread {
|
||||
u32 initialSP; // Initial r13 value
|
||||
u32 entrypoint; // Initial r15 value
|
||||
u32 priority;
|
||||
u32 processorID;
|
||||
|
||||
Thread(u32 initialSP, u32 entrypoint, u32 priority, u32 processorID) : initialSP(initialSP), entrypoint(entrypoint),
|
||||
priority(priority), processorID(processorID) {}
|
||||
ThreadStatus status;
|
||||
|
||||
Thread(u32 initialSP, u32 entrypoint, u32 priority, u32 processorID, ThreadStatus status = ThreadStatus::Dormant)
|
||||
: initialSP(initialSP), entrypoint(entrypoint), priority(priority), processorID(processorID), status(status) {}
|
||||
};
|
||||
|
||||
static const char* kernelObjectTypeToString(KernelObjectType t) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue