summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-06 02:39:53 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-16 06:03:48 +0200
commit14eca982f4da2bfd4d2c105bc33722e88e59da5f (patch)
treed812de676c6e2d056ac43abec89251aa36162165 /src/core/hle/kernel/thread.cpp
parentKernel: Add more infrastructure to support different memory layouts (diff)
downloadyuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.tar
yuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.tar.gz
yuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.tar.bz2
yuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.tar.lz
yuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.tar.xz
yuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.tar.zst
yuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.zip
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r--src/core/hle/kernel/thread.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 29ea6d531..c10126513 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -117,6 +117,7 @@ void Thread::Stop() {
wait_objects.clear();
Kernel::g_current_process->used_tls_slots[tls_index] = false;
+ g_current_process->misc_memory_used -= Memory::TLS_ENTRY_SIZE;
HLE::Reschedule(__func__);
}
@@ -414,6 +415,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
}
ASSERT_MSG(thread->tls_index != -1, "Out of TLS space");
+ g_current_process->misc_memory_used += Memory::TLS_ENTRY_SIZE;
// TODO(peachum): move to ScheduleThread() when scheduler is added so selected core is used
// to initialize the context
@@ -504,7 +506,7 @@ void Thread::SetWaitSynchronizationOutput(s32 output) {
}
VAddr Thread::GetTLSAddress() const {
- return Memory::TLS_AREA_VADDR + tls_index * 0x200;
+ return Memory::TLS_AREA_VADDR + tls_index * Memory::TLS_ENTRY_SIZE;
}
////////////////////////////////////////////////////////////////////////////////////////////////////