htc: implement remaining htclow::HtclowManagerImpl funcs (mux impls pending)

This commit is contained in:
Michael Scire
2021-02-09 17:42:39 -08:00
committed by SciresM
parent e20c2450ce
commit 87165e0f08
11 changed files with 190 additions and 34 deletions

View File

@@ -18,6 +18,29 @@
namespace ams::htclow::mux {
void RingBuffer::Initialize(void *buffer, size_t buffer_size) {
/* Validate pre-conditions. */
AMS_ASSERT(m_buffer == nullptr);
AMS_ASSERT(m_read_only_buffer == nullptr);
/* Set our fields. */
m_buffer = buffer;
m_buffer_size = buffer_size;
m_is_read_only = false;
}
void RingBuffer::InitializeForReadOnly(const void *buffer, size_t buffer_size) {
/* Validate pre-conditions. */
AMS_ASSERT(m_buffer == nullptr);
AMS_ASSERT(m_read_only_buffer == nullptr);
/* Set our fields. */
m_read_only_buffer = const_cast<void *>(buffer);
m_buffer_size = buffer_size;
m_data_size = buffer_size;
m_is_read_only = true;
}
Result RingBuffer::Write(const void *data, size_t size) {
/* Validate pre-conditions. */
AMS_ASSERT(!m_is_read_only);