summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-13 22:00:11 -0400
committerGravatar bunnei2014-05-13 22:00:11 -0400
commit3838d46b9022964617b93a45f3feab5052c3538b (patch)
treee9bb520a6e8e86543f0827524c45e0ce2e0edb4a /src/core/hle/kernel/thread.h
parentchanged loader to use __KernelLoadExec (diff)
downloadyuzu-3838d46b9022964617b93a45f3feab5052c3538b.tar.gz
yuzu-3838d46b9022964617b93a45f3feab5052c3538b.tar.xz
yuzu-3838d46b9022964617b93a45f3feab5052c3538b.zip
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 c3cdca31f..38180cb9b 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -7,12 +7,12 @@
7#include "common/common_types.h" 7#include "common/common_types.h"
8 8
9enum ThreadStatus { 9enum ThreadStatus {
10 THREADSTATUS_RUNNING = 1, 10 THREADSTATUS_RUNNING = 1,
11 THREADSTATUS_READY = 2, 11 THREADSTATUS_READY = 2,
12 THREADSTATUS_WAIT = 4, 12 THREADSTATUS_WAIT = 4,
13 THREADSTATUS_SUSPEND = 8, 13 THREADSTATUS_SUSPEND = 8,
14 THREADSTATUS_DORMANT = 16, 14 THREADSTATUS_DORMANT = 16,
15 THREADSTATUS_DEAD = 32, 15 THREADSTATUS_DEAD = 32,
16 16
17 THREADSTATUS_WAITSUSPEND = THREADSTATUS_WAIT | THREADSTATUS_SUSPEND 17 THREADSTATUS_WAITSUSPEND = THREADSTATUS_WAIT | THREADSTATUS_SUSPEND
18}; 18};
@@ -25,6 +25,19 @@ struct ThreadContext {
25 u32 pc; 25 u32 pc;
26}; 26};
27 27
28class Thread;
29
30Thread* __KernelCreateThread(UID& id, UID module_id, const char* name, u32 priority, u32 entrypoint,
31 u32 arg, u32 stack_top, u32 processor_id, int stack_size=0x4000);
32void __KernelResetThread(Thread *t, int lowest_priority);
33void __KernelChangeReadyState(Thread *thread, UID thread_id, bool ready);
34void __KernelChangeReadyState(UID thread_id, bool ready);
35Thread* __KernelNextThread();
36void __KernelSaveContext(ThreadContext *ctx);
37void __KernelLoadContext(ThreadContext *ctx);
38void __KernelSwitchContext(Thread *target, const char *reason);
39UID __KernelSetupRootThread(UID module_id, int arg, int prio, int stack_size=0x4000);
40
28void __KernelThreadingInit(); 41void __KernelThreadingInit();
29void __KernelThreadingShutdown(); 42void __KernelThreadingShutdown();
30 43