htc: implement remainder of Mux/Tasks

This commit is contained in:
Michael Scire
2021-02-09 19:51:52 -08:00
committed by SciresM
parent 42cf3f50d7
commit b925344c3b
13 changed files with 291 additions and 24 deletions

View File

@@ -120,9 +120,12 @@ namespace ams::htc::server::driver {
}
Result HtclowDriver::ReceiveInternal(size_t *out, void *dst, size_t dst_size, htclow::ChannelId channel, htclow::ReceiveOption option) {
/* Determine whether we're blocking. */
const bool blocking = option != htclow::ReceiveOption_NonBlocking;
/* Begin receiving. */
u32 task_id;
R_TRY(m_manager->ReceiveBegin(std::addressof(task_id), GetHtclowChannel(channel, m_module_id), option != htclow::ReceiveOption_NonBlocking));
R_TRY(m_manager->ReceiveBegin(std::addressof(task_id), GetHtclowChannel(channel, m_module_id), blocking ? 1 : 0));
/* Wait for the task to complete. */
this->WaitTask(task_id);