summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/thread.cpp6
-rw-r--r--src/core/hle/kernel/thread.h6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 2614a260c..0f7970ebe 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -541,6 +541,12 @@ s32 Thread::GetWaitObjectIndex(WaitObject* object) const {
541 return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1); 541 return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1);
542} 542}
543 543
544VAddr Thread::GetCommandBufferAddress() const {
545 // Offset from the start of TLS at which the IPC command buffer begins.
546 static constexpr int CommandHeaderOffset = 0x80;
547 return GetTLSAddress() + CommandHeaderOffset;
548}
549
544//////////////////////////////////////////////////////////////////////////////////////////////////// 550////////////////////////////////////////////////////////////////////////////////////////////////////
545 551
546void ThreadingInit() { 552void ThreadingInit() {
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 4679c2022..314fba81f 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -164,6 +164,12 @@ public:
164 return tls_address; 164 return tls_address;
165 } 165 }
166 166
167 /*
168 * Returns the address of the current thread's command buffer, located in the TLS.
169 * @returns VAddr of the thread's command buffer.
170 */
171 VAddr GetCommandBufferAddress() const;
172
167 /** 173 /**
168 * Returns whether this thread is waiting for all the objects in 174 * Returns whether this thread is waiting for all the objects in
169 * its wait list to become ready, as a result of a WaitSynchronizationN call 175 * its wait list to become ready, as a result of a WaitSynchronizationN call