|
@@ -12,6 +12,7 @@
|
|
|
#include "core/hle/kernel/address_arbiter.h"
|
|
#include "core/hle/kernel/address_arbiter.h"
|
|
|
#include "core/hle/kernel/event.h"
|
|
#include "core/hle/kernel/event.h"
|
|
|
#include "core/hle/kernel/mutex.h"
|
|
#include "core/hle/kernel/mutex.h"
|
|
|
|
|
+#include "core/hle/kernel/semaphore.h"
|
|
|
#include "core/hle/kernel/shared_memory.h"
|
|
#include "core/hle/kernel/shared_memory.h"
|
|
|
#include "core/hle/kernel/thread.h"
|
|
#include "core/hle/kernel/thread.h"
|
|
|
|
|
|
|
@@ -288,6 +289,14 @@ static Result GetThreadId(u32* thread_id, Handle handle) {
|
|
|
return result.raw;
|
|
return result.raw;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/// Creates a semaphore
|
|
|
|
|
+static Result CreateSemaphore(Handle* semaphore, s32 initial_count, s32 max_count) {
|
|
|
|
|
+ *semaphore = Kernel::CreateSemaphore(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;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/// Query memory
|
|
/// Query memory
|
|
|
static Result QueryMemory(void* info, void* out, u32 addr) {
|
|
static Result QueryMemory(void* info, void* out, u32 addr) {
|
|
|
LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr);
|
|
LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr);
|
|
@@ -366,7 +375,7 @@ const HLE::FunctionDef SVC_Table[] = {
|
|
|
{0x12, nullptr, "Run"},
|
|
{0x12, nullptr, "Run"},
|
|
|
{0x13, HLE::Wrap<CreateMutex>, "CreateMutex"},
|
|
{0x13, HLE::Wrap<CreateMutex>, "CreateMutex"},
|
|
|
{0x14, HLE::Wrap<ReleaseMutex>, "ReleaseMutex"},
|
|
{0x14, HLE::Wrap<ReleaseMutex>, "ReleaseMutex"},
|
|
|
- {0x15, nullptr, "CreateSemaphore"},
|
|
|
|
|
|
|
+ {0x15, HLE::Wrap<CreateSemaphore>, "CreateSemaphore"},
|
|
|
{0x16, nullptr, "ReleaseSemaphore"},
|
|
{0x16, nullptr, "ReleaseSemaphore"},
|
|
|
{0x17, HLE::Wrap<CreateEvent>, "CreateEvent"},
|
|
{0x17, HLE::Wrap<CreateEvent>, "CreateEvent"},
|
|
|
{0x18, HLE::Wrap<SignalEvent>, "SignalEvent"},
|
|
{0x18, HLE::Wrap<SignalEvent>, "SignalEvent"},
|