summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2017-12-31 16:11:27 -0500
committerGravatar bunnei2017-12-31 16:11:27 -0500
commit45debfe4fd11556d54793032fa22fbc10ecdfc50 (patch)
tree0d87ecb16febe7f3f31f8a2d572f56d89631c339 /src
parentsvc: Implement svcCreateThread. (diff)
downloadyuzu-45debfe4fd11556d54793032fa22fbc10ecdfc50.tar.gz
yuzu-45debfe4fd11556d54793032fa22fbc10ecdfc50.tar.xz
yuzu-45debfe4fd11556d54793032fa22fbc10ecdfc50.zip
svc: Implement svcExitThread.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/svc.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 3b2eb5d5e..bffa18c39 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -295,6 +295,14 @@ static ResultCode StartThread(Handle thread_handle) {
295 return RESULT_SUCCESS; 295 return RESULT_SUCCESS;
296} 296}
297 297
298/// Called when a thread exits
299static void ExitThread() {
300 LOG_TRACE(Kernel_SVC, "called, pc=0x%08X", Core::CPU().GetPC());
301
302 Kernel::ExitCurrentThread();
303 Core::System::GetInstance().PrepareReschedule();
304}
305
298/// Sleep the current thread 306/// Sleep the current thread
299static void SleepThread(s64 nanoseconds) { 307static void SleepThread(s64 nanoseconds) {
300 LOG_TRACE(Kernel_SVC, "called nanoseconds=%lld", nanoseconds); 308 LOG_TRACE(Kernel_SVC, "called nanoseconds=%lld", nanoseconds);
@@ -346,7 +354,7 @@ static const FunctionDef SVC_Table[] = {
346 {0x07, nullptr, "svcExitProcess"}, 354 {0x07, nullptr, "svcExitProcess"},
347 {0x08, HLE::Wrap<CreateThread>, "svcCreateThread"}, 355 {0x08, HLE::Wrap<CreateThread>, "svcCreateThread"},
348 {0x09, HLE::Wrap<StartThread>, "svcStartThread"}, 356 {0x09, HLE::Wrap<StartThread>, "svcStartThread"},
349 {0x0A, nullptr, "svcExitThread"}, 357 {0x0A, HLE::Wrap<ExitThread>, "svcExitThread"},
350 {0x0B, HLE::Wrap<SleepThread>, "svcSleepThread"}, 358 {0x0B, HLE::Wrap<SleepThread>, "svcSleepThread"},
351 {0x0C, HLE::Wrap<GetThreadPriority>, "svcGetThreadPriority"}, 359 {0x0C, HLE::Wrap<GetThreadPriority>, "svcGetThreadPriority"},
352 {0x0D, HLE::Wrap<SetThreadPriority>, "svcSetThreadPriority"}, 360 {0x0D, HLE::Wrap<SetThreadPriority>, "svcSetThreadPriority"},