diff options
Diffstat (limited to 'src/core/hle/service/srv.cpp')
| -rw-r--r-- | src/core/hle/service/srv.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index f45c0efc2..8f8413d02 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp | |||
| @@ -5,28 +5,30 @@ | |||
| 5 | #include "core/hle/hle.h" | 5 | #include "core/hle/hle.h" |
| 6 | #include "core/hle/service/srv.h" | 6 | #include "core/hle/service/srv.h" |
| 7 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 8 | #include "core/hle/kernel/mutex.h" | 8 | #include "core/hle/kernel/event.h" |
| 9 | 9 | ||
| 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 11 | // Namespace SRV | 11 | // Namespace SRV |
| 12 | 12 | ||
| 13 | namespace SRV { | 13 | namespace SRV { |
| 14 | 14 | ||
| 15 | Handle g_mutex = 0; | 15 | Handle g_event_handle = 0; |
| 16 | 16 | ||
| 17 | void Initialize(Service::Interface* self) { | 17 | void Initialize(Service::Interface* self) { |
| 18 | DEBUG_LOG(OSHLE, "called"); | 18 | DEBUG_LOG(OSHLE, "called"); |
| 19 | if (!g_mutex) { | ||
| 20 | g_mutex = Kernel::CreateMutex(true, "SRV:Lock"); | ||
| 21 | } | ||
| 22 | } | 19 | } |
| 23 | 20 | ||
| 24 | void GetProcSemaphore(Service::Interface* self) { | 21 | void GetProcSemaphore(Service::Interface* self) { |
| 25 | DEBUG_LOG(OSHLE, "called"); | 22 | DEBUG_LOG(OSHLE, "called"); |
| 26 | // Get process semaphore? | 23 | |
| 27 | u32* cmd_buff = Service::GetCommandBuffer(); | 24 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 28 | cmd_buff[1] = 0; // No error | 25 | |
| 29 | cmd_buff[3] = g_mutex; // Return something... 0 == nullptr, raises an exception | 26 | // TODO(bunnei): Change to a semaphore once these have been implemented |
| 27 | g_event_handle = Kernel::CreateEvent(RESETTYPE_ONESHOT, "SRV:Event"); | ||
| 28 | Kernel::SetEventLocked(g_event_handle, false); | ||
| 29 | |||
| 30 | cmd_buff[1] = 0; // No error | ||
| 31 | cmd_buff[3] = g_event_handle; | ||
| 30 | } | 32 | } |
| 31 | 33 | ||
| 32 | void GetServiceHandle(Service::Interface* self) { | 34 | void GetServiceHandle(Service::Interface* self) { |