summaryrefslogtreecommitdiff
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/svc.cpp')
-rw-r--r--src/core/hle/svc.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index db0c42e74..107d12156 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -12,6 +12,7 @@
12#include "core/hle/kernel/address_arbiter.h" 12#include "core/hle/kernel/address_arbiter.h"
13#include "core/hle/kernel/event.h" 13#include "core/hle/kernel/event.h"
14#include "core/hle/kernel/mutex.h" 14#include "core/hle/kernel/mutex.h"
15#include "core/hle/kernel/semaphore.h"
15#include "core/hle/kernel/shared_memory.h" 16#include "core/hle/kernel/shared_memory.h"
16#include "core/hle/kernel/thread.h" 17#include "core/hle/kernel/thread.h"
17 18
@@ -288,6 +289,14 @@ static Result GetThreadId(u32* thread_id, Handle handle) {
288 return result.raw; 289 return result.raw;
289} 290}
290 291
292/// Creates a semaphore
293static Result CreateSemaphore(Handle* semaphore, s32 initial_count, s32 max_count) {
294 *semaphore = Kernel::CreateSemaphore(initial_count, max_count);
295 DEBUG_LOG(SVC, "called initial_count=%d, max_count=%d, created handle=0x%08X",
296 initial_count, max_count, *semaphore);
297 return 0;
298}
299
291/// Query memory 300/// Query memory
292static Result QueryMemory(void* info, void* out, u32 addr) { 301static Result QueryMemory(void* info, void* out, u32 addr) {
293 LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr); 302 LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr);
@@ -366,7 +375,7 @@ const HLE::FunctionDef SVC_Table[] = {
366 {0x12, nullptr, "Run"}, 375 {0x12, nullptr, "Run"},
367 {0x13, HLE::Wrap<CreateMutex>, "CreateMutex"}, 376 {0x13, HLE::Wrap<CreateMutex>, "CreateMutex"},
368 {0x14, HLE::Wrap<ReleaseMutex>, "ReleaseMutex"}, 377 {0x14, HLE::Wrap<ReleaseMutex>, "ReleaseMutex"},
369 {0x15, nullptr, "CreateSemaphore"}, 378 {0x15, HLE::Wrap<CreateSemaphore>, "CreateSemaphore"},
370 {0x16, nullptr, "ReleaseSemaphore"}, 379 {0x16, nullptr, "ReleaseSemaphore"},
371 {0x17, HLE::Wrap<CreateEvent>, "CreateEvent"}, 380 {0x17, HLE::Wrap<CreateEvent>, "CreateEvent"},
372 {0x18, HLE::Wrap<SignalEvent>, "SignalEvent"}, 381 {0x18, HLE::Wrap<SignalEvent>, "SignalEvent"},