diff options
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/kernel/process.h | 7 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index bf0d479af..9825274b4 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -28,12 +28,12 @@ namespace { | |||
| 28 | * | 28 | * |
| 29 | * @param owner_process The parent process for the main thread | 29 | * @param owner_process The parent process for the main thread |
| 30 | * @param kernel The kernel instance to create the main thread under. | 30 | * @param kernel The kernel instance to create the main thread under. |
| 31 | * @param entry_point The address at which the thread should start execution | ||
| 32 | * @param priority The priority to give the main thread | 31 | * @param priority The priority to give the main thread |
| 33 | */ | 32 | */ |
| 34 | void SetupMainThread(Process& owner_process, KernelCore& kernel, VAddr entry_point, u32 priority) { | 33 | void SetupMainThread(Process& owner_process, KernelCore& kernel, u32 priority) { |
| 35 | // Initialize new "main" thread | 34 | const auto& vm_manager = owner_process.VMManager(); |
| 36 | const VAddr stack_top = owner_process.VMManager().GetTLSIORegionEndAddress(); | 35 | const VAddr entry_point = vm_manager.GetCodeRegionBaseAddress(); |
| 36 | const VAddr stack_top = vm_manager.GetTLSIORegionEndAddress(); | ||
| 37 | auto thread_res = Thread::Create(kernel, "main", entry_point, priority, 0, | 37 | auto thread_res = Thread::Create(kernel, "main", entry_point, priority, 0, |
| 38 | owner_process.GetIdealCore(), stack_top, owner_process); | 38 | owner_process.GetIdealCore(), stack_top, owner_process); |
| 39 | 39 | ||
| @@ -117,7 +117,7 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata) { | |||
| 117 | return handle_table.SetSize(capabilities.GetHandleTableSize()); | 117 | return handle_table.SetSize(capabilities.GetHandleTableSize()); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void Process::Run(VAddr entry_point, s32 main_thread_priority, u64 stack_size) { | 120 | void Process::Run(s32 main_thread_priority, u64 stack_size) { |
| 121 | // The kernel always ensures that the given stack size is page aligned. | 121 | // The kernel always ensures that the given stack size is page aligned. |
| 122 | main_thread_stack_size = Common::AlignUp(stack_size, Memory::PAGE_SIZE); | 122 | main_thread_stack_size = Common::AlignUp(stack_size, Memory::PAGE_SIZE); |
| 123 | 123 | ||
| @@ -133,7 +133,7 @@ void Process::Run(VAddr entry_point, s32 main_thread_priority, u64 stack_size) { | |||
| 133 | vm_manager.LogLayout(); | 133 | vm_manager.LogLayout(); |
| 134 | ChangeStatus(ProcessStatus::Running); | 134 | ChangeStatus(ProcessStatus::Running); |
| 135 | 135 | ||
| 136 | SetupMainThread(*this, kernel, entry_point, main_thread_priority); | 136 | SetupMainThread(*this, kernel, main_thread_priority); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | void Process::PrepareForTermination() { | 139 | void Process::PrepareForTermination() { |
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index dda52f4c0..bf3b7eef3 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -225,9 +225,12 @@ public: | |||
| 225 | ResultCode LoadFromMetadata(const FileSys::ProgramMetadata& metadata); | 225 | ResultCode LoadFromMetadata(const FileSys::ProgramMetadata& metadata); |
| 226 | 226 | ||
| 227 | /** | 227 | /** |
| 228 | * Applies address space changes and launches the process main thread. | 228 | * Starts the main application thread for this process. |
| 229 | * | ||
| 230 | * @param main_thread_priority The priority for the main thread. | ||
| 231 | * @param stack_size The stack size for the main thread in bytes. | ||
| 229 | */ | 232 | */ |
| 230 | void Run(VAddr entry_point, s32 main_thread_priority, u64 stack_size); | 233 | void Run(s32 main_thread_priority, u64 stack_size); |
| 231 | 234 | ||
| 232 | /** | 235 | /** |
| 233 | * Prepares a process for termination by stopping all of its threads | 236 | * Prepares a process for termination by stopping all of its threads |