mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +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
|
@ -2,14 +2,14 @@
|
|||
#include "resource_limits.hpp"
|
||||
|
||||
// Internal OS function to spawn a thread
|
||||
Handle Kernel::makeThread(u32 entrypoint, u32 initialSP, u32 priority, u32 id) {
|
||||
Handle Kernel::makeThread(u32 entrypoint, u32 initialSP, u32 priority, u32 id, ThreadStatus status) {
|
||||
if (threadCount >= appResourceLimits.maxThreads) {
|
||||
Helpers::panic("Overflowed the number of threads");
|
||||
}
|
||||
threadCount++;
|
||||
|
||||
Handle ret = makeObject(KernelObjectType::Thread);
|
||||
objects[ret].data = new Thread(initialSP, entrypoint, priority, id);
|
||||
objects[ret].data = new Thread(initialSP, entrypoint, priority, id, status);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ void Kernel::createThread() {
|
|||
printf("CreateThread(entry = %08X, stacktop = %08X, priority = %X, processor ID = %d)\n", entrypoint,
|
||||
initialSP, priority, id);
|
||||
|
||||
if (!(priority <= 0x3F)) [[unlikely]] {
|
||||
if (priority > 0x3F) [[unlikely]] {
|
||||
Helpers::panic("Created thread with bad priority value %X", priority);
|
||||
regs[0] = SVCResult::BadThreadPriority;
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue