summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-01-07 16:55:17 -0500
committerGravatar bunnei2018-01-07 16:55:17 -0500
commitbc8ef64804841c996aeebfe7ce23f34347a0be60 (patch)
tree79cc8d020ce8eba2eaa6355262bf8bb40db8596c /src/core/hle/kernel/svc.cpp
parentaudio: Log dropping frames as trace to reduce spam. (diff)
downloadyuzu-bc8ef64804841c996aeebfe7ce23f34347a0be60.tar.gz
yuzu-bc8ef64804841c996aeebfe7ce23f34347a0be60.tar.xz
yuzu-bc8ef64804841c996aeebfe7ce23f34347a0be60.zip
svc: Implement svcSignalProcessWideKey.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 699d842fd..74643f598 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -520,8 +520,27 @@ static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr semaphore_add
520} 520}
521 521
522/// Signal process wide key 522/// Signal process wide key
523static ResultCode SignalProcessWideKey(VAddr addr, u32 target) { 523static ResultCode SignalProcessWideKey(VAddr semaphore_addr, s32 target) {
524 LOG_WARNING(Kernel_SVC, "(STUBBED) called, address=0x%llx, target=0x%08x", addr, target); 524 LOG_TRACE(Kernel_SVC, "called, semaphore_addr=0x%llx, target=0x%08x", semaphore_addr, target);
525
526 // Wakeup all or one thread - Any other value is unimplemented
527 ASSERT(target == -1 || target == 1);
528
529 SharedPtr<Semaphore> semaphore = g_object_address_table.Get<Semaphore>(semaphore_addr);
530 if (!semaphore) {
531 // Create a new semaphore for the specified address if one does not already exist
532 semaphore = Semaphore::Create(semaphore_addr).Unwrap();
533 semaphore->name = Common::StringFromFormat("semaphore-%llx", semaphore_addr);
534 }
535
536 CASCADE_CODE(semaphore->Release(target));
537
538 if (semaphore->mutex_addr) {
539 // If a mutex was created for this semaphore, wait the current thread on it
540 SharedPtr<Mutex> mutex = g_object_address_table.Get<Mutex>(semaphore->mutex_addr);
541 return WaitSynchronization1(mutex, GetCurrentThread());
542 }
543
525 return RESULT_SUCCESS; 544 return RESULT_SUCCESS;
526} 545}
527 546