aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorGravatar bunnei <ericbunnie@gmail.com>2014-05-13 22:00:11 -0400
committerGravatar bunnei <ericbunnie@gmail.com>2014-05-13 22:00:11 -0400
commit3838d46b9022964617b93a45f3feab5052c3538b (patch)
treee9bb520a6e8e86543f0827524c45e0ce2e0edb4a /src/core/hle/kernel/thread.h
parentb87536e82cc1708d22ce4e38b34dac8190919798 (diff)
added a bunch of threading code, recycled from PPSSPP, with lots of hacks in for 3DS... doesn't really do much yet. Just a jumping off point
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index c3cdca31..38180cb9 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -7,12 +7,12 @@
#include "common/common_types.h"
enum ThreadStatus {
- THREADSTATUS_RUNNING = 1,
- THREADSTATUS_READY = 2,
- THREADSTATUS_WAIT = 4,
- THREADSTATUS_SUSPEND = 8,
- THREADSTATUS_DORMANT = 16,
- THREADSTATUS_DEAD = 32,
+ THREADSTATUS_RUNNING = 1,
+ THREADSTATUS_READY = 2,
+ THREADSTATUS_WAIT = 4,
+ THREADSTATUS_SUSPEND = 8,
+ THREADSTATUS_DORMANT = 16,
+ THREADSTATUS_DEAD = 32,
THREADSTATUS_WAITSUSPEND = THREADSTATUS_WAIT | THREADSTATUS_SUSPEND
};
@@ -25,6 +25,19 @@ struct ThreadContext {
u32 pc;
};
+class Thread;
+
+Thread* __KernelCreateThread(UID& id, UID module_id, const char* name, u32 priority, u32 entrypoint,
+ u32 arg, u32 stack_top, u32 processor_id, int stack_size=0x4000);
+void __KernelResetThread(Thread *t, int lowest_priority);
+void __KernelChangeReadyState(Thread *thread, UID thread_id, bool ready);
+void __KernelChangeReadyState(UID thread_id, bool ready);
+Thread* __KernelNextThread();
+void __KernelSaveContext(ThreadContext *ctx);
+void __KernelLoadContext(ThreadContext *ctx);
+void __KernelSwitchContext(Thread *target, const char *reason);
+UID __KernelSetupRootThread(UID module_id, int arg, int prio, int stack_size=0x4000);
+
void __KernelThreadingInit();
void __KernelThreadingShutdown();