diff options
| author | 2017-12-30 12:10:58 -0500 | |
|---|---|---|
| committer | 2017-12-30 12:10:58 -0500 | |
| commit | b6087e35b5fe624a072d923efdf700b4671da132 (patch) | |
| tree | 2e837ccc2bdd9a4ea8cd5f598e0a45b623827a2e /src/core/hle/kernel/thread.cpp | |
| parent | thread: Remove THUMB mode flag. (diff) | |
| download | yuzu-b6087e35b5fe624a072d923efdf700b4671da132.tar.gz yuzu-b6087e35b5fe624a072d923efdf700b4671da132.tar.xz yuzu-b6087e35b5fe624a072d923efdf700b4671da132.zip | |
thread: Main thread should set thread handle to reg 1.
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index fc0364d5f..b20092761 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -490,7 +490,8 @@ void Thread::BoostPriority(u32 priority) { | |||
| 490 | current_priority = priority; | 490 | current_priority = priority; |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority, SharedPtr<Process> owner_process) { | 493 | SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority, |
| 494 | SharedPtr<Process> owner_process) { | ||
| 494 | // Setup page table so we can write to memory | 495 | // Setup page table so we can write to memory |
| 495 | SetCurrentPageTable(&Kernel::g_current_process->vm_manager.page_table); | 496 | SetCurrentPageTable(&Kernel::g_current_process->vm_manager.page_table); |
| 496 | 497 | ||
| @@ -500,6 +501,8 @@ SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority, SharedPtr<Pro | |||
| 500 | 501 | ||
| 501 | SharedPtr<Thread> thread = std::move(thread_res).Unwrap(); | 502 | SharedPtr<Thread> thread = std::move(thread_res).Unwrap(); |
| 502 | 503 | ||
| 504 | // Register 1 must be a handle to the main thread | ||
| 505 | thread->context.cpu_registers[1] = Kernel::g_handle_table.Create(thread).Unwrap(); | ||
| 503 | thread->context.fpscr = | 506 | thread->context.fpscr = |
| 504 | FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO | FPSCR_IXC; // 0x03C00010 | 507 | FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO | FPSCR_IXC; // 0x03C00010 |
| 505 | 508 | ||