summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-08-05 21:39:53 -0300
committerGravatar Yuri Kunde Schlesner2015-08-16 01:03:48 -0300
commit14eca982f4da2bfd4d2c105bc33722e88e59da5f (patch)
treed812de676c6e2d056ac43abec89251aa36162165 /src/core/hle/kernel/thread.cpp
parentKernel: Add more infrastructure to support different memory layouts (diff)
downloadyuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.tar.gz
yuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.tar.xz
yuzu-14eca982f4da2bfd4d2c105bc33722e88e59da5f.zip
Kernel: Implement svcGetProcessInfo in a basic way
This also adds some basic memory usage accounting. These two types are used by Super Smash Bros. during startup.
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() {
117 wait_objects.clear(); 117 wait_objects.clear();
118 118
119 Kernel::g_current_process->used_tls_slots[tls_index] = false; 119 Kernel::g_current_process->used_tls_slots[tls_index] = false;
120 g_current_process->misc_memory_used -= Memory::TLS_ENTRY_SIZE;
120 121
121 HLE::Reschedule(__func__); 122 HLE::Reschedule(__func__);
122} 123}
@@ -414,6 +415,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
414 } 415 }
415 416
416 ASSERT_MSG(thread->tls_index != -1, "Out of TLS space"); 417 ASSERT_MSG(thread->tls_index != -1, "Out of TLS space");
418 g_current_process->misc_memory_used += Memory::TLS_ENTRY_SIZE;
417 419
418 // TODO(peachum): move to ScheduleThread() when scheduler is added so selected core is used 420 // TODO(peachum): move to ScheduleThread() when scheduler is added so selected core is used
419 // to initialize the context 421 // to initialize the context
@@ -504,7 +506,7 @@ void Thread::SetWaitSynchronizationOutput(s32 output) {
504} 506}
505 507
506VAddr Thread::GetTLSAddress() const { 508VAddr Thread::GetTLSAddress() const {
507 return Memory::TLS_AREA_VADDR + tls_index * 0x200; 509 return Memory::TLS_AREA_VADDR + tls_index * Memory::TLS_ENTRY_SIZE;
508} 510}
509 511
510//////////////////////////////////////////////////////////////////////////////////////////////////// 512////////////////////////////////////////////////////////////////////////////////////////////////////