diff options
| author | Sebastian Valle <subv2112@gmail.com> | 2017-10-01 14:44:06 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-01 14:44:06 -0500 | 
| commit | 30fabc41c60b08af20b6eaf719d012b7480d7123 (patch) | |
| tree | 3b1828171d76559199dd4871b721795b67d7747e /src/core/hle | |
| parent | 9c123c29a62dfbd084186dac0bb0d80e2775b8e9 (diff) | |
| parent | 1f2de7501b427f9f5ac1e5d244f8ec52eca9bc64 (diff) | |
Merge pull request #2971 from Subv/per_process_memops
Memory: Add overloads for ReadBlock and WriteBlock that operate on a specific process.
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 6 | 
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 {      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 4679c2022..314fba81f 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -164,6 +164,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 | 
