diff options
author | bunnei <bunneidev@gmail.com> | 2017-12-30 19:37:07 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2017-12-30 19:37:07 +0100 |
commit | 8ab33616ac2c11a621d77d0b585d2439db9a62c3 (patch) | |
tree | 566aa4c39be05ba9b4267b16c2a0debe168759b3 /src/core/hle/svc.cpp | |
parent | thread: Main thread should set thread handle to reg 1. (diff) | |
download | yuzu-8ab33616ac2c11a621d77d0b585d2439db9a62c3.tar yuzu-8ab33616ac2c11a621d77d0b585d2439db9a62c3.tar.gz yuzu-8ab33616ac2c11a621d77d0b585d2439db9a62c3.tar.bz2 yuzu-8ab33616ac2c11a621d77d0b585d2439db9a62c3.tar.lz yuzu-8ab33616ac2c11a621d77d0b585d2439db9a62c3.tar.xz yuzu-8ab33616ac2c11a621d77d0b585d2439db9a62c3.tar.zst yuzu-8ab33616ac2c11a621d77d0b585d2439db9a62c3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/svc.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 9db3d632a..120cf75f3 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -179,6 +179,21 @@ static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, VAdd return QueryProcessMemory(memory_info, page_info, Kernel::CurrentProcess, addr); } +/// Starts the thread for the provided handle. +static ResultCode StartThread(Handle thread_handle) { + LOG_TRACE(Kernel_SVC, "called thread=0x%08X", thread_handle); + + const SharedPtr<Kernel::Thread> thread = + Kernel::g_handle_table.Get<Kernel::Thread>(thread_handle); + if (!thread) { + return ERR_INVALID_HANDLE; + } + + thread->ResumeFromWait(); + + return RESULT_SUCCESS; +} + /// Sleep the current thread static void SleepThread(s64 nanoseconds) { LOG_TRACE(Kernel_SVC, "called nanoseconds=%lld", nanoseconds); @@ -230,6 +245,7 @@ static const FunctionDef SVC_Table[] = { {0x07, nullptr, "svcExitProcess"}, {0x08, nullptr, "svcCreateThread"}, {0x09, nullptr, "svcStartThread"}, + {0x09, HLE::Wrap<StartThread>, "svcStartThread"}, {0x0A, nullptr, "svcExitThread"}, {0x0B, HLE::Wrap<SleepThread>, "svcSleepThread"}, {0x0C, HLE::Wrap<GetThreadPriority>, "svcGetThreadPriority"}, |