diff options
| author | 2015-05-10 18:35:37 -0500 | |
|---|---|---|
| committer | 2015-05-10 18:35:37 -0500 | |
| commit | 000876858d52d7e4fa8e21bc4407d43d548eff30 (patch) | |
| tree | f0af4cde78349cfe4ea7875b24d37cf85eb3eb03 /src/core/hle/kernel/session.h | |
| parent | Merge pull request #726 from bunnei/gpu-improvements (diff) | |
| download | yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.tar.gz yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.tar.xz yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.zip | |
Core/Memory: Give every emulated thread it's own TLS area.
The TLS area for thread T with id Ti is located at TLS_AREA_VADDR + (Ti - 1) * 0x200.
This allows some games like Mario Kart 7 to continue further.
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 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/kernel/kernel.h" | 7 | #include "core/hle/kernel/kernel.h" |
| 8 | #include "core/hle/kernel/thread.h" | ||
| 8 | #include "core/mem_map.h" | 9 | #include "core/mem_map.h" |
| 9 | 10 | ||
| 10 | namespace Kernel { | 11 | namespace Kernel { |
| @@ -12,12 +13,15 @@ namespace Kernel { | |||
| 12 | static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header | 13 | static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 15 | * Returns a pointer to the command buffer in kernel memory | 16 | * Returns a pointer to the command buffer in the current thread's TLS |
| 17 | * TODO(Subv): This is not entirely correct, the command buffer should be copied from | ||
| 18 | * the thread's TLS to an intermediate buffer in kernel memory, and then copied again to | ||
| 19 | * the service handler process' memory. | ||
| 16 | * @param offset Optional offset into command buffer | 20 | * @param offset Optional offset into command buffer |
| 17 | * @return Pointer to command buffer | 21 | * @return Pointer to command buffer |
| 18 | */ | 22 | */ |
| 19 | inline static u32* GetCommandBuffer(const int offset=0) { | 23 | inline static u32* GetCommandBuffer(const int offset = 0) { |
| 20 | return (u32*)Memory::GetPointer(Memory::TLS_AREA_VADDR + kCommandHeaderOffset + offset); | 24 | return (u32*)Memory::GetPointer(GetCurrentThread()->GetTLSAddress() + kCommandHeaderOffset + offset); |
| 21 | } | 25 | } |
| 22 | 26 | ||
| 23 | /** | 27 | /** |