kern: implement SvcCancelSynchronization

This commit is contained in:
Michael Scire 2020-07-20 02:27:53 -07:00 committed by SciresM
parent 5b8a20dbf7
commit 26df56cd87
3 changed files with 35 additions and 2 deletions

View file

@ -102,6 +102,16 @@ namespace ams::kern::svc {
return ResultSuccess();
}
Result CancelSynchronization(ams::svc::Handle handle) {
/* Get the thread from its handle. */
KScopedAutoObject thread = GetCurrentProcess().GetHandleTable().GetObject<KThread>(handle);
R_UNLESS(thread.IsNotNull(), svc::ResultInvalidHandle());
/* Cancel the thread's wait. */
thread->WaitCancel();
return ResultSuccess();
}
}
/* ============================= 64 ABI ============================= */
@ -119,7 +129,7 @@ namespace ams::kern::svc {
}
Result CancelSynchronization64(ams::svc::Handle handle) {
MESOSPHERE_PANIC("Stubbed SvcCancelSynchronization64 was called.");
return CancelSynchronization(handle);
}
void SynchronizePreemptionState64() {
@ -141,7 +151,7 @@ namespace ams::kern::svc {
}
Result CancelSynchronization64From32(ams::svc::Handle handle) {
MESOSPHERE_PANIC("Stubbed SvcCancelSynchronization64From32 was called.");
return CancelSynchronization(handle);
}
void SynchronizePreemptionState64From32() {