kern: SendSyncRequestLight, ReplyAndReceiveLight

This commit is contained in:
Michael Scire authored and SciresM committed 2020-07-31 14:50:52 -07:00
1 parent b6cb561c47
commit 8922bbd108
8 files changed
+360 -14

No files matched your search

@@ -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));
}
}