Skip to content

Commit

Permalink
Add threadGetCurHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
fincs committed Oct 27, 2018
1 parent ccfb1fd commit ede7986
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nx/include/switch/kernel/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Result threadDumpContext(ThreadContext* ctx, Thread* t);

/**
* @brief Gets the raw handle to the current thread.
* @return The current thread's handle.
*/
Handle threadGetCurHandle(void);
4 changes: 4 additions & 0 deletions nx/source/kernel/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,7 @@ Result threadResume(Thread* t) {
Result threadDumpContext(ThreadContext* ctx, Thread* t) {
return svcGetThreadContext3(ctx, t->handle);
}

Handle threadGetCurHandle(void) {
return getThreadVars()->handle;
}

0 comments on commit ede7986

Please sign in to comment.