Add threadGetCurHandle

This commit is contained in:
fincs 2018-10-27 17:34:44 +02:00
parent ccfb1fd4d2
commit ede79862fb
2 changed files with 10 additions and 0 deletions

View File

@ -73,3 +73,9 @@ Result threadResume(Thread* t);
* @warning Official kernel will not dump x0..x18 if the thread is currently executing a system call, and prior to 6.0.0 doesn't dump TPIDR_EL0. * @warning Official kernel will not dump x0..x18 if the thread is currently executing a system call, and prior to 6.0.0 doesn't dump TPIDR_EL0.
*/ */
Result threadDumpContext(ThreadContext* ctx, Thread* t); Result threadDumpContext(ThreadContext* ctx, Thread* t);
/**
* @brief Gets the raw handle to the current thread.
* @return The current thread's handle.
*/
Handle threadGetCurHandle(void);

View File

@ -138,3 +138,7 @@ Result threadResume(Thread* t) {
Result threadDumpContext(ThreadContext* ctx, Thread* t) { Result threadDumpContext(ThreadContext* ctx, Thread* t) {
return svcGetThreadContext3(ctx, t->handle); return svcGetThreadContext3(ctx, t->handle);
} }
Handle threadGetCurHandle(void) {
return getThreadVars()->handle;
}