From 194761ca5490aeac1f2e5b447c8e84ae5ff39ef7 Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Tue, 20 Sep 2022 19:23:16 +0300 Subject: [PATCH] [Kernel] Fix IPC on non-main threads --- src/core/kernel/kernel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/kernel/kernel.cpp b/src/core/kernel/kernel.cpp index fc511af9..5f5ca72e 100644 --- a/src/core/kernel/kernel.cpp +++ b/src/core/kernel/kernel.cpp @@ -98,9 +98,8 @@ void Kernel::reset() { } // Get pointer to thread-local storage -// TODO: Every thread should have its own TLS. We need to adjust for this when we add threads u32 Kernel::getTLSPointer() { - return VirtualAddrs::TLSBase; + return VirtualAddrs::TLSBase + currentThreadIndex * VirtualAddrs::TLSSize; } // Result CloseHandle(Handle handle)