diff options
| author | Lioncash <mathew1800@gmail.com> | 2015-05-10 20:50:23 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2015-05-10 20:50:23 -0400 |
| commit | 2a19de1d09f725e8ef267a51d4c5ff994b036b04 (patch) | |
| tree | 945fc0617a3329e14f0b4ec3cf2679a0054cbb7b /src/core/hle/kernel/session.h | |
| parent | ba0bfe7d82a241f1dbe449a1bdcc2a76c594c667 (diff) | |
| parent | 115ad8e16a69c8823118f210654fc9ea70a03213 (diff) | |
Merge pull request #741 from Subv/tls
Give each emulated thread it's own TLS memory
Diffstat (limited to 'src/core/hle/kernel/session.h')
| -rw-r--r-- | src/core/hle/kernel/session.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/hle/kernel/session.h b/src/core/hle/kernel/session.h index 0fd18148a..8c3886ffd 100644 --- a/src/core/hle/kernel/session.h +++ b/src/core/hle/kernel/session.h @@ -5,6 +5,7 @@ #pragma once #include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/thread.h" #include "core/mem_map.h" namespace Kernel { @@ -12,12 +13,15 @@ namespace Kernel { static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header /** - * Returns a pointer to the command buffer in kernel memory + * Returns a pointer to the command buffer in the current thread's TLS + * TODO(Subv): This is not entirely correct, the command buffer should be copied from + * the thread's TLS to an intermediate buffer in kernel memory, and then copied again to + * the service handler process' memory. * @param offset Optional offset into command buffer * @return Pointer to command buffer */ -inline static u32* GetCommandBuffer(const int offset=0) { - return (u32*)Memory::GetPointer(Memory::TLS_AREA_VADDR + kCommandHeaderOffset + offset); +inline static u32* GetCommandBuffer(const int offset = 0) { + return (u32*)Memory::GetPointer(GetCurrentThread()->GetTLSAddress() + kCommandHeaderOffset + offset); } /** |
