diff options
| author | 2014-08-06 18:30:01 -0400 | |
|---|---|---|
| committer | 2014-08-06 18:30:01 -0400 | |
| commit | d0c179485392903fa413543d6b6908d45bc1f0fb (patch) | |
| tree | a2e85ca4b091042e2e45446fda5b36bf6f62d2b3 /src/core/hle/service/srv.cpp | |
| parent | Merge pull request #36 from bunnei/fix-memory-unaligned-reads (diff) | |
| parent | GPU: Updated g_last_ticks variable to be more descriptive (represents CPU tic... (diff) | |
| download | yuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.tar.gz yuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.tar.xz yuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.zip | |
Merge pull request #34 from bunnei/gsp-command-synch
Gsp command synch
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) { |