diff options
author | Lioncash <mathew1800@gmail.com> | 2018-09-24 20:01:45 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-09-24 22:16:03 -0400 |
commit | 83377113bfe7791483a1b67e06dd0f51620c04ec (patch) | |
tree | d766a2d2f20d247e8663c1a76d5c41fcf7f643d4 /src/core/hle/kernel/thread.cpp | |
parent | 6c6f95d071b25f2743fcb6652f4389c9e25a7506 (diff) |
memory: Dehardcode the use of fixed memory range constants
The locations of these can actually vary depending on the address space
layout, so we shouldn't be using these when determining where to map
memory or be using them as offsets for calculations. This keeps all the
memory ranges flexible and malleable based off of the virtual memory
manager instance state.
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 315f653385..064ed908d1 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -262,8 +262,9 @@ SharedPtr<Thread> SetupMainThread(KernelCore& kernel, VAddr entry_point, u32 pri SetCurrentPageTable(&owner_process.vm_manager.page_table); // Initialize new "main" thread + const VAddr stack_top = owner_process.vm_manager.GetTLSIORegionEndAddress(); auto thread_res = Thread::Create(kernel, "main", entry_point, priority, 0, THREADPROCESSORID_0, - Memory::STACK_AREA_VADDR_END, &owner_process); + stack_top, &owner_process); SharedPtr<Thread> thread = std::move(thread_res).Unwrap(); |