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

@@ -131,6 +131,17 @@ namespace ams::htclow::mux {
}
}
size_t SendBuffer::AddData(const void *data, size_t size) {
/* Determine how much to actually add. */
size = std::min(size, m_ring_buffer.GetBufferSize() - m_ring_buffer.GetDataSize());
/* Write the data. */
R_ABORT_UNLESS(m_ring_buffer.Write(data, size));
/* Return the size we wrote. */
return size;
}
void SendBuffer::SetBuffer(void *buffer, size_t buffer_size) {
m_ring_buffer.Initialize(buffer, buffer_size);
}