diff options
| author | 2018-12-04 15:39:49 -0500 | |
|---|---|---|
| committer | 2018-12-04 15:47:59 -0500 | |
| commit | a543c35962bf070689ac80be9a57f165c2ae9d33 (patch) | |
| tree | 8c2b9532d12c2980bb41e9d21dece03de9a1f9ee /src/core/hle/kernel/svc.cpp | |
| parent | kernel/svc: Implement svcCreateEvent() (diff) | |
| download | yuzu-a543c35962bf070689ac80be9a57f165c2ae9d33.tar.gz yuzu-a543c35962bf070689ac80be9a57f165c2ae9d33.tar.xz yuzu-a543c35962bf070689ac80be9a57f165c2ae9d33.zip | |
kernel/svc: Implement svcSignalEvent()
This function simply does a handle table lookup for a writable event
instance identified by the given handle value. If a writable event
cannot be found for the given handle, then an invalid handle error is
returned. If a writable event is found, then it simply signals the
event, as one would expect.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index a0e3dc470..830594d72 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1647,6 +1647,21 @@ static ResultCode ClearEvent(Handle handle) { | |||
| 1647 | return ERR_INVALID_HANDLE; | 1647 | return ERR_INVALID_HANDLE; |
| 1648 | } | 1648 | } |
| 1649 | 1649 | ||
| 1650 | static ResultCode SignalEvent(Handle handle) { | ||
| 1651 | LOG_DEBUG(Kernel_SVC, "called. Handle=0x{:08X}", handle); | ||
| 1652 | |||
| 1653 | HandleTable& handle_table = Core::CurrentProcess()->GetHandleTable(); | ||
| 1654 | auto writable_event = handle_table.Get<WritableEvent>(handle); | ||
| 1655 | |||
| 1656 | if (!writable_event) { | ||
| 1657 | LOG_ERROR(Kernel_SVC, "Non-existent writable event handle used (0x{:08X})", handle); | ||
| 1658 | return ERR_INVALID_HANDLE; | ||
| 1659 | } | ||
| 1660 | |||
| 1661 | writable_event->Signal(); | ||
| 1662 | return RESULT_SUCCESS; | ||
| 1663 | } | ||
| 1664 | |||
| 1650 | static ResultCode GetProcessInfo(u64* out, Handle process_handle, u32 type) { | 1665 | static ResultCode GetProcessInfo(u64* out, Handle process_handle, u32 type) { |
| 1651 | LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, type=0x{:X}", process_handle, type); | 1666 | LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, type=0x{:X}", process_handle, type); |
| 1652 | 1667 | ||
| @@ -1782,7 +1797,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 1782 | {0x0E, SvcWrap<GetThreadCoreMask>, "GetThreadCoreMask"}, | 1797 | {0x0E, SvcWrap<GetThreadCoreMask>, "GetThreadCoreMask"}, |
| 1783 | {0x0F, SvcWrap<SetThreadCoreMask>, "SetThreadCoreMask"}, | 1798 | {0x0F, SvcWrap<SetThreadCoreMask>, "SetThreadCoreMask"}, |
| 1784 | {0x10, SvcWrap<GetCurrentProcessorNumber>, "GetCurrentProcessorNumber"}, | 1799 | {0x10, SvcWrap<GetCurrentProcessorNumber>, "GetCurrentProcessorNumber"}, |
| 1785 | {0x11, nullptr, "SignalEvent"}, | 1800 | {0x11, SvcWrap<SignalEvent>, "SignalEvent"}, |
| 1786 | {0x12, SvcWrap<ClearEvent>, "ClearEvent"}, | 1801 | {0x12, SvcWrap<ClearEvent>, "ClearEvent"}, |
| 1787 | {0x13, SvcWrap<MapSharedMemory>, "MapSharedMemory"}, | 1802 | {0x13, SvcWrap<MapSharedMemory>, "MapSharedMemory"}, |
| 1788 | {0x14, SvcWrap<UnmapSharedMemory>, "UnmapSharedMemory"}, | 1803 | {0x14, SvcWrap<UnmapSharedMemory>, "UnmapSharedMemory"}, |