Skip to content
Snippets Groups Projects
Commit bc8ef648 authored by bunnei's avatar bunnei
Browse files

svc: Implement svcSignalProcessWideKey.

parent bd377908
No related branches found
No related tags found
No related merge requests found
...@@ -520,8 +520,27 @@ static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr semaphore_add ...@@ -520,8 +520,27 @@ static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr semaphore_add
} }
/// Signal process wide key /// Signal process wide key
static ResultCode SignalProcessWideKey(VAddr addr, u32 target) { static ResultCode SignalProcessWideKey(VAddr semaphore_addr, s32 target) {
LOG_WARNING(Kernel_SVC, "(STUBBED) called, address=0x%llx, target=0x%08x", addr, target); LOG_TRACE(Kernel_SVC, "called, semaphore_addr=0x%llx, target=0x%08x", semaphore_addr, target);
// Wakeup all or one thread - Any other value is unimplemented
ASSERT(target == -1 || target == 1);
SharedPtr<Semaphore> semaphore = g_object_address_table.Get<Semaphore>(semaphore_addr);
if (!semaphore) {
// Create a new semaphore for the specified address if one does not already exist
semaphore = Semaphore::Create(semaphore_addr).Unwrap();
semaphore->name = Common::StringFromFormat("semaphore-%llx", semaphore_addr);
}
CASCADE_CODE(semaphore->Release(target));
if (semaphore->mutex_addr) {
// If a mutex was created for this semaphore, wait the current thread on it
SharedPtr<Mutex> mutex = g_object_address_table.Get<Mutex>(semaphore->mutex_addr);
return WaitSynchronization1(mutex, GetCurrentThread());
}
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }
......
...@@ -57,9 +57,9 @@ void SvcWrap() { ...@@ -57,9 +57,9 @@ void SvcWrap() {
FuncReturn(retval); FuncReturn(retval);
} }
template <ResultCode func(u64, u32)> template <ResultCode func(u64, s32)>
void SvcWrap() { void SvcWrap() {
FuncReturn(func(PARAM(0), (u32)PARAM(1)).raw); FuncReturn(func(PARAM(0), (s32)PARAM(1)).raw);
} }
template <ResultCode func(u64*, u64)> template <ResultCode func(u64*, u64)>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment