mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 22:57:22 +00:00
thread: Main thread should set thread handle to reg 1.
This commit is contained in:
parent
7ccd8de863
commit
b6087e35b5
1 changed files with 4 additions and 1 deletions
|
@ -490,7 +490,8 @@ void Thread::BoostPriority(u32 priority) {
|
||||||
current_priority = priority;
|
current_priority = priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority, SharedPtr<Process> owner_process) {
|
SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority,
|
||||||
|
SharedPtr<Process> owner_process) {
|
||||||
// Setup page table so we can write to memory
|
// Setup page table so we can write to memory
|
||||||
SetCurrentPageTable(&Kernel::g_current_process->vm_manager.page_table);
|
SetCurrentPageTable(&Kernel::g_current_process->vm_manager.page_table);
|
||||||
|
|
||||||
|
@ -500,6 +501,8 @@ SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority, SharedPtr<Pro
|
||||||
|
|
||||||
SharedPtr<Thread> thread = std::move(thread_res).Unwrap();
|
SharedPtr<Thread> thread = std::move(thread_res).Unwrap();
|
||||||
|
|
||||||
|
// Register 1 must be a handle to the main thread
|
||||||
|
thread->context.cpu_registers[1] = Kernel::g_handle_table.Create(thread).Unwrap();
|
||||||
thread->context.fpscr =
|
thread->context.fpscr =
|
||||||
FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO | FPSCR_IXC; // 0x03C00010
|
FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO | FPSCR_IXC; // 0x03C00010
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue