Implement svcClearEvent

This removes a signal from a KEvent. It is used by Mario Odyssey.
This commit is contained in:
Billy Laws 2020-07-09 14:10:18 +01:00 committed by ◱ PixelyIon
parent 92e3f84242
commit dae799dbb5
2 changed files with 12 additions and 1 deletions

View File

@ -300,6 +300,12 @@ namespace skyline::kernel::svc {
}
}
void ClearEvent(DeviceState &state) {
auto object = state.process->GetHandle<type::KEvent>(state.ctx->registers.w0);
object->signalled = false;
state.ctx->registers.w0 = constant::status::Success;
}
void MapSharedMemory(DeviceState &state) {
try {
auto object = state.process->GetHandle<type::KSharedMemory>(state.ctx->registers.w0);

View File

@ -100,6 +100,11 @@ namespace skyline {
*/
void SetThreadPriority(DeviceState &state);
/**
* @brief Clears a KEvent of it's signal (https://switchbrew.org/wiki/SVC#ClearEvent)
*/
void ClearEvent(DeviceState &state);
/**
* @brief Maps the block supplied by the handle (https://switchbrew.org/wiki/SVC#MapSharedMemory)
*/
@ -202,7 +207,7 @@ namespace skyline {
nullptr, // 0x0f
nullptr, // 0x10
nullptr, // 0x11
nullptr, // 0x12
ClearEvent, // 0x12
MapSharedMemory, // 0x13
nullptr, // 0x14
CreateTransferMemory, // 0x15