summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-09-29 21:47:52 +0200
committerSubv <subv2112@gmail.com>2017-10-01 21:18:35 +0200
commit8217ed7acb71bfa574e0a29e69b902a0c539c814 (patch)
tree4a4d8e657d1f0d8b84bf9694df2f4d33842d7d1d /src/core/hle
parentMerge pull request #2962 from huwpascoe/static_cast (diff)
downloadyuzu-8217ed7acb71bfa574e0a29e69b902a0c539c814.tar
yuzu-8217ed7acb71bfa574e0a29e69b902a0c539c814.tar.gz
yuzu-8217ed7acb71bfa574e0a29e69b902a0c539c814.tar.bz2
yuzu-8217ed7acb71bfa574e0a29e69b902a0c539c814.tar.lz
yuzu-8217ed7acb71bfa574e0a29e69b902a0c539c814.tar.xz
yuzu-8217ed7acb71bfa574e0a29e69b902a0c539c814.tar.zst
yuzu-8217ed7acb71bfa574e0a29e69b902a0c539c814.zip
Diffstat (limited to 'src/core/hle')
-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 11f7d2127..6ebc8c151 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -534,6 +534,12 @@ s32 Thread::GetWaitObjectIndex(WaitObject* object) const {
return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1);
}
+VAddr Thread::GetCommandBufferAddress() const {
+ // Offset from the start of TLS at which the IPC command buffer begins.
+ static constexpr int CommandHeaderOffset = 0x80;
+ return GetTLSAddress() + CommandHeaderOffset;
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
void ThreadingInit() {
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index f02e1d43a..520ac22c2 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -159,6 +159,12 @@ public:
return tls_address;
}
+ /*
+ * Returns the address of the current thread's command buffer, located in the TLS.
+ * @returns VAddr of the thread's command buffer.
+ */
+ VAddr GetCommandBufferAddress() const;
+
/**
* Returns whether this thread is waiting for all the objects in
* its wait list to become ready, as a result of a WaitSynchronizationN call