diff options
author | Lioncash <mathew1800@gmail.com> | 2018-12-05 01:59:29 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-12-05 02:14:59 +0100 |
commit | 2f253986df3e5cf5aca0bb2fcec2e23c0cab57d7 (patch) | |
tree | d1ab3e29f5c02689b19a954231dd102b1cf3b745 | |
parent | kernel/process: Make Process a WaitObject (diff) | |
download | yuzu-2f253986df3e5cf5aca0bb2fcec2e23c0cab57d7.tar yuzu-2f253986df3e5cf5aca0bb2fcec2e23c0cab57d7.tar.gz yuzu-2f253986df3e5cf5aca0bb2fcec2e23c0cab57d7.tar.bz2 yuzu-2f253986df3e5cf5aca0bb2fcec2e23c0cab57d7.tar.lz yuzu-2f253986df3e5cf5aca0bb2fcec2e23c0cab57d7.tar.xz yuzu-2f253986df3e5cf5aca0bb2fcec2e23c0cab57d7.tar.zst yuzu-2f253986df3e5cf5aca0bb2fcec2e23c0cab57d7.zip |
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index e6c77f9db..84df2040e 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -1433,17 +1433,24 @@ static ResultCode CloseHandle(Handle handle) { return handle_table.Close(handle); } -/// Reset an event +/// Clears the signaled state of an event or process. static ResultCode ResetSignal(Handle handle) { LOG_DEBUG(Kernel_SVC, "called handle 0x{:08X}", handle); const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); + auto event = handle_table.Get<ReadableEvent>(handle); + if (event) { + return event->Reset(); + } - ASSERT(event != nullptr); + auto process = handle_table.Get<Process>(handle); + if (process) { + return process->ClearSignalState(); + } - event->Clear(); - return RESULT_SUCCESS; + LOG_ERROR(Kernel_SVC, "Invalid handle (0x{:08X})", handle); + return ERR_INVALID_HANDLE; } /// Creates a TransferMemory object |