kern: SendSyncRequestLight, ReplyAndReceiveLight

This commit is contained in:
Michael Scire
2020-07-29 03:57:40 -07:00
committed by SciresM
parent b6cb561c47
commit 8922bbd108
8 changed files with 360 additions and 14 deletions

View File

@@ -30,7 +30,24 @@ namespace ams::kern {
Result KLightClientSession::SendSyncRequest(u32 *data) {
MESOSPHERE_ASSERT_THIS();
MESOSPHERE_UNIMPLEMENTED();
/* Get the request thread. */
KThread *cur_thread = GetCurrentThreadPointer();
/* Set the light data. */
cur_thread->SetLightSessionData(data);
/* Send the request. */
{
KScopedSchedulerLock sl;
cur_thread->SetSyncedObject(nullptr, ResultSuccess());
R_TRY(this->parent->OnRequest(cur_thread));
}
/* Get the result. */
KSynchronizationObject *dummy;
return cur_thread->GetWaitResult(std::addressof(dummy));
}
}