summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-07-07 04:19:16 -0400
committerGravatar Lioncash2019-07-07 14:08:28 -0400
commit56c7912159e210e009228f83e6c3ead3e5c99d4b (patch)
tree4c73a1ecf2050d12740020856caa3f003babb31d /src/core/hle/kernel/process.cpp
parentkernel/process: Move main thread stack allocation to its own function (diff)
downloadyuzu-56c7912159e210e009228f83e6c3ead3e5c99d4b.tar.gz
yuzu-56c7912159e210e009228f83e6c3ead3e5c99d4b.tar.xz
yuzu-56c7912159e210e009228f83e6c3ead3e5c99d4b.zip
kernel/process: Allocate the process' TLS region during initialization
Prior to execution within a process beginning, the process establishes its own TLS region for uses (as far as I can tell) related to exception handling. Now that TLS creation was decoupled from threads themselves, we can add this behavior to our Process class. This is also good, as it allows us to remove a stub within svcGetInfo, namely querying the address of that region.
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
-rw-r--r--src/core/hle/kernel/process.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index 90d579b5c..73ee1eb0f 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -187,6 +187,8 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata) {
187 187
188void Process::Run(s32 main_thread_priority, u64 stack_size) { 188void Process::Run(s32 main_thread_priority, u64 stack_size) {
189 AllocateMainThreadStack(stack_size); 189 AllocateMainThreadStack(stack_size);
190 tls_region_address = CreateTLSRegion();
191
190 vm_manager.LogLayout(); 192 vm_manager.LogLayout();
191 193
192 ChangeStatus(ProcessStatus::Running); 194 ChangeStatus(ProcessStatus::Running);
@@ -218,6 +220,9 @@ void Process::PrepareForTermination() {
218 stop_threads(system.Scheduler(2).GetThreadList()); 220 stop_threads(system.Scheduler(2).GetThreadList());
219 stop_threads(system.Scheduler(3).GetThreadList()); 221 stop_threads(system.Scheduler(3).GetThreadList());
220 222
223 FreeTLSRegion(tls_region_address);
224 tls_region_address = 0;
225
221 ChangeStatus(ProcessStatus::Exited); 226 ChangeStatus(ProcessStatus::Exited);
222} 227}
223 228