From 9b8afed5f74b0b2be87943d1b417146f59f6de36 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 1 Jan 2018 14:04:36 -0500 Subject: svc: Implement svcUnlockMutex. --- src/core/hle/svc.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index c0e3200d4..cba94eac3 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -160,6 +160,16 @@ static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr, return RESULT_SUCCESS; } +/// Unlock a mutex +static ResultCode UnlockMutex(VAddr mutex_addr) { + LOG_TRACE(Kernel_SVC, "called mutex_addr=0x%llx", mutex_addr); + + SharedPtr mutex = Kernel::g_object_address_table.Get(mutex_addr); + ASSERT(mutex); + + return mutex->Release(Kernel::GetCurrentThread()); +} + /// Break program execution static void Break(u64 unk_0, u64 unk_1, u64 unk_2) { LOG_CRITICAL(Debug_Emulated, "Emulated program broke execution!"); @@ -409,8 +419,8 @@ static const FunctionDef SVC_Table[] = { {0x17, nullptr, "svcResetSignal"}, {0x18, nullptr, "svcWaitSynchronization"}, {0x19, nullptr, "svcCancelSynchronization"}, - {0x1B, nullptr, "svcUnlockMutex"}, {0x1A, HLE::Wrap, "svcLockMutex"}, + {0x1B, HLE::Wrap, "svcUnlockMutex"}, {0x1C, nullptr, "svcWaitProcessWideKeyAtomic"}, {0x1D, HLE::Wrap, "svcSignalProcessWideKey"}, {0x1E, nullptr, "svcGetSystemTick"}, -- cgit v1.2.3