diff options
| author | 2018-12-30 20:32:41 -0500 | |
|---|---|---|
| committer | 2018-12-30 20:32:41 -0500 | |
| commit | e5dfbe22ee458dc818e5e56daa7f1a43e6ed7205 (patch) | |
| tree | d12208284c7f3bff0d24ba5750019307eddccefe /src/core/hle/kernel/thread.cpp | |
| parent | Merge pull request #1847 from ogniK5377/backtrace-break (diff) | |
| parent | kernel/process: Start the main thread using the specified ideal core (diff) | |
| download | yuzu-e5dfbe22ee458dc818e5e56daa7f1a43e6ed7205.tar.gz yuzu-e5dfbe22ee458dc818e5e56daa7f1a43e6ed7205.tar.xz yuzu-e5dfbe22ee458dc818e5e56daa7f1a43e6ed7205.zip | |
Merge pull request #1956 from lioncash/process-thread
kernel/process: Start the main thread using the specified ideal core
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 434655638..d3984dfc4 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include "common/assert.h" | 12 | #include "common/assert.h" |
| 13 | #include "common/common_types.h" | 13 | #include "common/common_types.h" |
| 14 | #include "common/logging/log.h" | 14 | #include "common/logging/log.h" |
| 15 | #include "common/math_util.h" | ||
| 16 | #include "common/thread_queue_list.h" | 15 | #include "common/thread_queue_list.h" |
| 17 | #include "core/arm/arm_interface.h" | 16 | #include "core/arm/arm_interface.h" |
| 18 | #include "core/core.h" | 17 | #include "core/core.h" |
| @@ -232,29 +231,6 @@ void Thread::BoostPriority(u32 priority) { | |||
| 232 | current_priority = priority; | 231 | current_priority = priority; |
| 233 | } | 232 | } |
| 234 | 233 | ||
| 235 | SharedPtr<Thread> SetupMainThread(KernelCore& kernel, VAddr entry_point, u32 priority, | ||
| 236 | Process& owner_process) { | ||
| 237 | // Setup page table so we can write to memory | ||
| 238 | SetCurrentPageTable(&owner_process.VMManager().page_table); | ||
| 239 | |||
| 240 | // Initialize new "main" thread | ||
| 241 | const VAddr stack_top = owner_process.VMManager().GetTLSIORegionEndAddress(); | ||
| 242 | auto thread_res = Thread::Create(kernel, "main", entry_point, priority, 0, THREADPROCESSORID_0, | ||
| 243 | stack_top, owner_process); | ||
| 244 | |||
| 245 | SharedPtr<Thread> thread = std::move(thread_res).Unwrap(); | ||
| 246 | |||
| 247 | // Register 1 must be a handle to the main thread | ||
| 248 | const Handle guest_handle = owner_process.GetHandleTable().Create(thread).Unwrap(); | ||
| 249 | thread->SetGuestHandle(guest_handle); | ||
| 250 | thread->GetContext().cpu_registers[1] = guest_handle; | ||
| 251 | |||
| 252 | // Threads by default are dormant, wake up the main thread so it runs when the scheduler fires | ||
| 253 | thread->ResumeFromWait(); | ||
| 254 | |||
| 255 | return thread; | ||
| 256 | } | ||
| 257 | |||
| 258 | void Thread::SetWaitSynchronizationResult(ResultCode result) { | 234 | void Thread::SetWaitSynchronizationResult(ResultCode result) { |
| 259 | context.cpu_registers[0] = result.raw; | 235 | context.cpu_registers[0] = result.raw; |
| 260 | } | 236 | } |