Browse Source
Merge pull request #1372 from lioncash/thread
kernel/thread: Use owner_process when setting the page table in SetupMainThread()
pull/15/merge
bunnei
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
5 additions and
5 deletions
-
src/core/hle/kernel/process.cpp
-
src/core/hle/kernel/thread.cpp
-
src/core/hle/kernel/thread.h
|
|
|
@ -125,7 +125,7 @@ void Process::Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size) { |
|
|
|
vm_manager.LogLayout(); |
|
|
|
status = ProcessStatus::Running; |
|
|
|
|
|
|
|
Kernel::SetupMainThread(kernel, entry_point, main_thread_priority, this); |
|
|
|
Kernel::SetupMainThread(kernel, entry_point, main_thread_priority, *this); |
|
|
|
} |
|
|
|
|
|
|
|
void Process::LoadModule(SharedPtr<CodeSet> module_, VAddr base_addr) { |
|
|
|
|
|
|
|
@ -311,13 +311,13 @@ void Thread::BoostPriority(u32 priority) { |
|
|
|
} |
|
|
|
|
|
|
|
SharedPtr<Thread> SetupMainThread(KernelCore& kernel, VAddr entry_point, u32 priority, |
|
|
|
SharedPtr<Process> owner_process) { |
|
|
|
Process& owner_process) { |
|
|
|
// Setup page table so we can write to memory
|
|
|
|
SetCurrentPageTable(&Core::CurrentProcess()->vm_manager.page_table); |
|
|
|
SetCurrentPageTable(&owner_process.vm_manager.page_table); |
|
|
|
|
|
|
|
// Initialize new "main" thread
|
|
|
|
auto thread_res = Thread::Create(kernel, "main", entry_point, priority, 0, THREADPROCESSORID_0, |
|
|
|
Memory::STACK_AREA_VADDR_END, std::move(owner_process)); |
|
|
|
Memory::STACK_AREA_VADDR_END, &owner_process); |
|
|
|
|
|
|
|
SharedPtr<Thread> thread = std::move(thread_res).Unwrap(); |
|
|
|
|
|
|
|
|
|
|
|
@ -281,7 +281,7 @@ private: |
|
|
|
* @return A shared pointer to the main thread |
|
|
|
*/ |
|
|
|
SharedPtr<Thread> SetupMainThread(KernelCore& kernel, VAddr entry_point, u32 priority, |
|
|
|
SharedPtr<Process> owner_process); |
|
|
|
Process& owner_process); |
|
|
|
|
|
|
|
/** |
|
|
|
* Gets the current thread |
|
|
|
|