diff options
| author | 2014-05-13 22:00:11 -0400 | |
|---|---|---|
| committer | 2014-05-13 22:00:11 -0400 | |
| commit | 3838d46b9022964617b93a45f3feab5052c3538b (patch) | |
| tree | e9bb520a6e8e86543f0827524c45e0ce2e0edb4a /src/core/hle/kernel/thread.h | |
| parent | changed loader to use __KernelLoadExec (diff) | |
| download | yuzu-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.h | 25 |
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 | ||
| 9 | enum ThreadStatus { | 9 | enum 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 | ||
| 28 | class Thread; | ||
| 29 | |||
| 30 | Thread* __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); | ||
| 32 | void __KernelResetThread(Thread *t, int lowest_priority); | ||
| 33 | void __KernelChangeReadyState(Thread *thread, UID thread_id, bool ready); | ||
| 34 | void __KernelChangeReadyState(UID thread_id, bool ready); | ||
| 35 | Thread* __KernelNextThread(); | ||
| 36 | void __KernelSaveContext(ThreadContext *ctx); | ||
| 37 | void __KernelLoadContext(ThreadContext *ctx); | ||
| 38 | void __KernelSwitchContext(Thread *target, const char *reason); | ||
| 39 | UID __KernelSetupRootThread(UID module_id, int arg, int prio, int stack_size=0x4000); | ||
| 40 | |||
| 28 | void __KernelThreadingInit(); | 41 | void __KernelThreadingInit(); |
| 29 | void __KernelThreadingShutdown(); | 42 | void __KernelThreadingShutdown(); |
| 30 | 43 | ||