kern: write thread handle to tls +0x110 on creation

This commit is contained in:
Alula
2026-03-17 10:59:11 +01:00
parent 9cc82c6f80
commit 0ee6277be9
4 changed files with 10 additions and 2 deletions

View File

@@ -66,6 +66,9 @@ namespace ams::kern::svc {
/* Add the thread to the handle table. */
R_TRY(process.GetHandleTable().Add(out, thread));
/* Pass the thread handle to the thread local region. */
static_cast<ams::svc::ThreadLocalRegion *>(thread->GetThreadLocalRegionHeapAddress())->thread_handle = *out;
R_SUCCEED();
}