diff options
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 | /** |