1
0
Fork 0

SRV: Updated GetProcSemaphore to create an event instead of a mutex.

This commit is contained in:
bunnei 2014-07-21 21:25:35 -04:00
parent 4d4607041b
commit 1b247b8031
1 changed files with 10 additions and 8 deletions

View File

@ -5,28 +5,30 @@
#include "core/hle/hle.h" #include "core/hle/hle.h"
#include "core/hle/service/srv.h" #include "core/hle/service/srv.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/hle/kernel/mutex.h" #include "core/hle/kernel/event.h"
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace SRV // Namespace SRV
namespace SRV { namespace SRV {
Handle g_mutex = 0; Handle g_event_handle = 0;
void Initialize(Service::Interface* self) { void Initialize(Service::Interface* self) {
DEBUG_LOG(OSHLE, "called"); DEBUG_LOG(OSHLE, "called");
if (!g_mutex) {
g_mutex = Kernel::CreateMutex(true, "SRV:Lock");
}
} }
void GetProcSemaphore(Service::Interface* self) { void GetProcSemaphore(Service::Interface* self) {
DEBUG_LOG(OSHLE, "called"); DEBUG_LOG(OSHLE, "called");
// Get process semaphore?
u32* cmd_buff = Service::GetCommandBuffer(); u32* cmd_buff = Service::GetCommandBuffer();
// TODO(bunnei): Change to a semaphore once these have been implemented
g_event_handle = Kernel::CreateEvent(RESETTYPE_ONESHOT, "SRV:Event");
Kernel::SetEventLocked(g_event_handle, false);
cmd_buff[1] = 0; // No error cmd_buff[1] = 0; // No error
cmd_buff[3] = g_mutex; // Return something... 0 == nullptr, raises an exception cmd_buff[3] = g_event_handle;
} }
void GetServiceHandle(Service::Interface* self) { void GetServiceHandle(Service::Interface* self) {