summaryrefslogtreecommitdiffstats
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2014-12-04 17:40:36 +0100
committerSubv <subv2112@gmail.com>2014-12-13 19:40:10 +0100
commit49b31badba5672bae3a5950abe3d45c883879c0d (patch)
tree9e0b3da4ac87b39e58ea8d0f1c347b06a6e82169 /src/core/hle/svc.cpp
parentSVC: Implemented svcCreateSemaphore (diff)
downloadyuzu-49b31badba5672bae3a5950abe3d45c883879c0d.tar
yuzu-49b31badba5672bae3a5950abe3d45c883879c0d.tar.gz
yuzu-49b31badba5672bae3a5950abe3d45c883879c0d.tar.bz2
yuzu-49b31badba5672bae3a5950abe3d45c883879c0d.tar.lz
yuzu-49b31badba5672bae3a5950abe3d45c883879c0d.tar.xz
yuzu-49b31badba5672bae3a5950abe3d45c883879c0d.tar.zst
yuzu-49b31badba5672bae3a5950abe3d45c883879c0d.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/svc.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 107d12156..2846bb482 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -291,10 +291,17 @@ static Result GetThreadId(u32* thread_id, Handle handle) {
/// Creates a semaphore
static Result CreateSemaphore(Handle* semaphore, s32 initial_count, s32 max_count) {
- *semaphore = Kernel::CreateSemaphore(initial_count, max_count);
+ ResultCode res = Kernel::CreateSemaphore(semaphore, initial_count, max_count);
DEBUG_LOG(SVC, "called initial_count=%d, max_count=%d, created handle=0x%08X",
initial_count, max_count, *semaphore);
- return 0;
+ return res.raw;
+}
+
+/// Releases a certain number of slots in a semaphore
+static Result ReleaseSemaphore(s32* count, Handle semaphore, s32 release_count) {
+ DEBUG_LOG(SVC, "called release_count=%d, handle=0x%08X", release_count, semaphore);
+ ResultCode res = Kernel::ReleaseSemaphore(count, semaphore, release_count);
+ return res.raw;
}
/// Query memory
@@ -376,7 +383,7 @@ const HLE::FunctionDef SVC_Table[] = {
{0x13, HLE::Wrap<CreateMutex>, "CreateMutex"},
{0x14, HLE::Wrap<ReleaseMutex>, "ReleaseMutex"},
{0x15, HLE::Wrap<CreateSemaphore>, "CreateSemaphore"},
- {0x16, nullptr, "ReleaseSemaphore"},
+ {0x16, HLE::Wrap<ReleaseSemaphore>, "ReleaseSemaphore"},
{0x17, HLE::Wrap<CreateEvent>, "CreateEvent"},
{0x18, HLE::Wrap<SignalEvent>, "SignalEvent"},
{0x19, HLE::Wrap<ClearEvent>, "ClearEvent"},