summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_thread.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-03-24 00:58:48 +0100
committerLiam <byteslice@airmail.cc>2023-03-24 01:28:47 +0100
commit41d99aa89db7ee483112e49baa6c86e14adbd168 (patch)
tree085ba1f2eb6a75c2b93d70834cc20d4b14f4d10f /src/core/hle/kernel/k_thread.cpp
parentMerge pull request #9971 from Morph1984/q (diff)
downloadyuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.tar
yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.tar.gz
yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.tar.bz2
yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.tar.lz
yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.tar.xz
yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.tar.zst
yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.zip
Diffstat (limited to 'src/core/hle/kernel/k_thread.cpp')
-rw-r--r--src/core/hle/kernel/k_thread.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index 9d101c640..70480b725 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -546,7 +546,7 @@ u16 KThread::GetUserDisableCount() const {
return {};
}
- auto& memory = m_kernel.System().Memory();
+ auto& memory = this->GetOwnerProcess()->GetMemory();
return memory.Read16(m_tls_address + offsetof(ThreadLocalRegion, disable_count));
}
@@ -556,7 +556,7 @@ void KThread::SetInterruptFlag() {
return;
}
- auto& memory = m_kernel.System().Memory();
+ auto& memory = this->GetOwnerProcess()->GetMemory();
memory.Write16(m_tls_address + offsetof(ThreadLocalRegion, interrupt_flag), 1);
}
@@ -566,7 +566,7 @@ void KThread::ClearInterruptFlag() {
return;
}
- auto& memory = m_kernel.System().Memory();
+ auto& memory = this->GetOwnerProcess()->GetMemory();
memory.Write16(m_tls_address + offsetof(ThreadLocalRegion, interrupt_flag), 0);
}
@@ -1422,6 +1422,11 @@ s32 GetCurrentCoreId(KernelCore& kernel) {
return GetCurrentThread(kernel).GetCurrentCore();
}
+Core::Memory::Memory& GetCurrentMemory(KernelCore& kernel) {
+ // TODO: per-process memory
+ return kernel.System().ApplicationMemory();
+}
+
KScopedDisableDispatch::~KScopedDisableDispatch() {
// If we are shutting down the kernel, none of this is relevant anymore.
if (m_kernel.IsShuttingDown()) {