diff options
author | bunnei <bunneidev@gmail.com> | 2017-12-29 19:27:58 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2017-12-29 19:27:58 +0100 |
commit | ebd4b1422d55c9affc38e8133e897e39684e9ccb (patch) | |
tree | 53513cb3d4e28493173a3f708764a4924654ba91 /src/core/hle/kernel/thread.cpp | |
parent | applet_oe: Stub out a bunch of interfaces necessary for boot. (diff) | |
download | yuzu-ebd4b1422d55c9affc38e8133e897e39684e9ccb.tar yuzu-ebd4b1422d55c9affc38e8133e897e39684e9ccb.tar.gz yuzu-ebd4b1422d55c9affc38e8133e897e39684e9ccb.tar.bz2 yuzu-ebd4b1422d55c9affc38e8133e897e39684e9ccb.tar.lz yuzu-ebd4b1422d55c9affc38e8133e897e39684e9ccb.tar.xz yuzu-ebd4b1422d55c9affc38e8133e897e39684e9ccb.tar.zst yuzu-ebd4b1422d55c9affc38e8133e897e39684e9ccb.zip |
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 372cafdd9..1645437b6 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -103,8 +103,8 @@ void Thread::Stop() { ReleaseThreadMutexes(this); // Mark the TLS slot in the thread's page as free. - u32 tls_page = (tls_address - Memory::TLS_AREA_VADDR) / Memory::PAGE_SIZE; - u32 tls_slot = + u64 tls_page = (tls_address - Memory::TLS_AREA_VADDR) / Memory::PAGE_SIZE; + u64 tls_slot = ((tls_address - Memory::TLS_AREA_VADDR) % Memory::PAGE_SIZE) / Memory::TLS_ENTRY_SIZE; Kernel::g_current_process->tls_slots[tls_page].reset(tls_slot); } @@ -184,7 +184,7 @@ static void SwitchContext(Thread* new_thread) { } Core::CPU().LoadContext(new_thread->context); - Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); + Core::CPU().SetTlsAddress(new_thread->GetTLSAddress()); } else { current_thread = nullptr; // Note: We do not reset the current process and current page table when idling because @@ -369,7 +369,7 @@ static void ResetThreadContext(ARM_Interface::ThreadContext& context, VAddr stac } ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, u32 priority, - u32 arg, s32 processor_id, VAddr stack_top, + u64 arg, s32 processor_id, VAddr stack_top, SharedPtr<Process> owner_process) { // Check if priority is in ranged. Lowest priority -> highest priority id. if (priority > THREADPRIO_LOWEST) { @@ -493,7 +493,7 @@ void Thread::BoostPriority(u32 priority) { current_priority = priority; } -SharedPtr<Thread> SetupMainThread(u32 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 SetCurrentPageTable(&Kernel::g_current_process->vm_manager.page_table); |