summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 0d1fe19bf..82bf16082 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -20,10 +20,31 @@ enum ThreadProcessorId {
20 THREADPROCESSORID_ALL = 0xFFFFFFFC, ///< Enables both cores 20 THREADPROCESSORID_ALL = 0xFFFFFFFC, ///< Enables both cores
21}; 21};
22 22
23enum ThreadStatus {
24 THREADSTATUS_RUNNING = 1,
25 THREADSTATUS_READY = 2,
26 THREADSTATUS_WAIT = 4,
27 THREADSTATUS_SUSPEND = 8,
28 THREADSTATUS_DORMANT = 16,
29 THREADSTATUS_DEAD = 32,
30 THREADSTATUS_WAITSUSPEND = THREADSTATUS_WAIT | THREADSTATUS_SUSPEND
31};
32
33enum WaitType {
34 WAITTYPE_NONE,
35 WAITTYPE_SLEEP,
36 WAITTYPE_SEMA,
37 WAITTYPE_EVENTFLAG,
38 WAITTYPE_THREADEND,
39 WAITTYPE_VBLANK,
40 WAITTYPE_MUTEX,
41 WAITTYPE_SYNCH,
42};
43
23namespace Kernel { 44namespace Kernel {
24 45
25/// Creates a new thread - wrapper for external user 46/// Creates a new thread - wrapper for external user
26Handle CreateThread(const char* name, u32 entry_point, s32 priority, s32 processor_id, 47Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s32 processor_id,
27 u32 stack_top, int stack_size=Kernel::DEFAULT_STACK_SIZE); 48 u32 stack_top, int stack_size=Kernel::DEFAULT_STACK_SIZE);
28 49
29/// Sets up the primary application thread 50/// Sets up the primary application thread
@@ -32,6 +53,9 @@ Handle SetupMainThread(s32 priority, int stack_size=Kernel::DEFAULT_STACK_SIZE);
32/// Reschedules to the next available thread (call after current thread is suspended) 53/// Reschedules to the next available thread (call after current thread is suspended)
33void Reschedule(const char* reason); 54void Reschedule(const char* reason);
34 55
56/// Puts a thread in the wait state for the given type/reason
57void WaitCurThread(WaitType wait_type, const char* reason);
58
35/// Resumes a thread from waiting by marking it as "ready" 59/// Resumes a thread from waiting by marking it as "ready"
36void ResumeThreadFromWait(Handle handle); 60void ResumeThreadFromWait(Handle handle);
37 61