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.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index ce63a70d3..0e1397cd9 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -1,10 +1,13 @@
1// Copyright 2014 Citra Emulator Project / PPSSPP Project 1// Copyright 2014 Citra Emulator Project / PPSSPP Project
2// Licensed under GPLv2 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#pragma once 5#pragma once
6 6
7#include "common/common_types.h" 7#include "common/common_types.h"
8
9#include "core/mem_map.h"
10
8#include "core/hle/kernel/kernel.h" 11#include "core/hle/kernel/kernel.h"
9#include "core/hle/result.h" 12#include "core/hle/result.h"
10 13
@@ -37,7 +40,6 @@ enum WaitType {
37 WAITTYPE_SEMA, 40 WAITTYPE_SEMA,
38 WAITTYPE_EVENT, 41 WAITTYPE_EVENT,
39 WAITTYPE_THREADEND, 42 WAITTYPE_THREADEND,
40 WAITTYPE_VBLANK,
41 WAITTYPE_MUTEX, 43 WAITTYPE_MUTEX,
42 WAITTYPE_SYNCH, 44 WAITTYPE_SYNCH,
43 WAITTYPE_ARB, 45 WAITTYPE_ARB,
@@ -58,6 +60,14 @@ void Reschedule();
58/// Stops the current thread 60/// Stops the current thread
59ResultCode StopThread(Handle thread, const char* reason); 61ResultCode StopThread(Handle thread, const char* reason);
60 62
63/**
64 * Retrieves the ID of the specified thread handle
65 * @param thread_id Will contain the output thread id
66 * @param handle Handle to the thread we want
67 * @return Whether the function was successful or not
68 */
69ResultCode GetThreadId(u32* thread_id, Handle handle);
70
61/// Resumes a thread from waiting by marking it as "ready" 71/// Resumes a thread from waiting by marking it as "ready"
62void ResumeThreadFromWait(Handle handle); 72void ResumeThreadFromWait(Handle handle);
63 73
@@ -77,6 +87,14 @@ Handle GetCurrentThreadHandle();
77 */ 87 */
78void WaitCurrentThread(WaitType wait_type, Handle wait_handle=GetCurrentThreadHandle()); 88void WaitCurrentThread(WaitType wait_type, Handle wait_handle=GetCurrentThreadHandle());
79 89
90/**
91 * Puts the current thread in the wait state for the given type
92 * @param wait_type Type of wait
93 * @param wait_handle Handle of Kernel object that we are waiting on, defaults to current thread
94 * @param wait_address Arbitration address used to resume from wait
95 */
96void WaitCurrentThread(WaitType wait_type, Handle wait_handle, VAddr wait_address);
97
80/// Put current thread in a wait state - on WaitSynchronization 98/// Put current thread in a wait state - on WaitSynchronization
81void WaitThread_Synchronization(); 99void WaitThread_Synchronization();
82 100