summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-05-23 00:50:36 +0200
committerbunnei <ericbunnie@gmail.com>2014-05-23 00:50:36 +0200
commit14bd37c5dc67c7777d4bea8d996bf2dfd8c7bdcc (patch)
tree1849fdeba7de9c6bd98b42c31a6c853af487acea /src/core/hle/kernel/thread.h
parentAPT_U: added a debug log on calling GetLockHandle (diff)
downloadyuzu-14bd37c5dc67c7777d4bea8d996bf2dfd8c7bdcc.tar
yuzu-14bd37c5dc67c7777d4bea8d996bf2dfd8c7bdcc.tar.gz
yuzu-14bd37c5dc67c7777d4bea8d996bf2dfd8c7bdcc.tar.bz2
yuzu-14bd37c5dc67c7777d4bea8d996bf2dfd8c7bdcc.tar.lz
yuzu-14bd37c5dc67c7777d4bea8d996bf2dfd8c7bdcc.tar.xz
yuzu-14bd37c5dc67c7777d4bea8d996bf2dfd8c7bdcc.tar.zst
yuzu-14bd37c5dc67c7777d4bea8d996bf2dfd8c7bdcc.zip
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 {
THREADPROCESSORID_ALL = 0xFFFFFFFC, ///< Enables both cores
};
+enum ThreadStatus {
+ THREADSTATUS_RUNNING = 1,
+ THREADSTATUS_READY = 2,
+ THREADSTATUS_WAIT = 4,
+ THREADSTATUS_SUSPEND = 8,
+ THREADSTATUS_DORMANT = 16,
+ THREADSTATUS_DEAD = 32,
+ THREADSTATUS_WAITSUSPEND = THREADSTATUS_WAIT | THREADSTATUS_SUSPEND
+};
+
+enum WaitType {
+ WAITTYPE_NONE,
+ WAITTYPE_SLEEP,
+ WAITTYPE_SEMA,
+ WAITTYPE_EVENTFLAG,
+ WAITTYPE_THREADEND,
+ WAITTYPE_VBLANK,
+ WAITTYPE_MUTEX,
+ WAITTYPE_SYNCH,
+};
+
namespace Kernel {
/// Creates a new thread - wrapper for external user
-Handle CreateThread(const char* name, u32 entry_point, s32 priority, s32 processor_id,
+Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s32 processor_id,
u32 stack_top, int stack_size=Kernel::DEFAULT_STACK_SIZE);
/// Sets up the primary application thread
@@ -32,6 +53,9 @@ Handle SetupMainThread(s32 priority, int stack_size=Kernel::DEFAULT_STACK_SIZE);
/// Reschedules to the next available thread (call after current thread is suspended)
void Reschedule(const char* reason);
+/// Puts a thread in the wait state for the given type/reason
+void WaitCurThread(WaitType wait_type, const char* reason);
+
/// Resumes a thread from waiting by marking it as "ready"
void ResumeThreadFromWait(Handle handle);