mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-25 20:24:21 -04:00
dmnt: enable experimental standalone usage of gdbstub, while starlink is in dev
This commit is contained in:
parent
5eabca7f04
commit
4489513f7c
22 changed files with 464 additions and 68 deletions
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::dmnt {
|
||||
|
||||
class HtcsReceiveBuffer {
|
||||
public:
|
||||
static constexpr size_t ReceiveBufferSize = 4_KB;
|
||||
private:
|
||||
u8 m_buffer[ReceiveBufferSize];
|
||||
os::Event m_readable_event;
|
||||
os::Event m_writable_event;
|
||||
os::SdkMutex m_mutex;
|
||||
size_t m_readable_size;
|
||||
size_t m_offset;
|
||||
bool m_valid;
|
||||
public:
|
||||
HtcsReceiveBuffer() : m_readable_event(os::EventClearMode_ManualClear), m_writable_event(os::EventClearMode_ManualClear), m_mutex(), m_readable_size(), m_offset(), m_valid(true) { /* ... */ }
|
||||
|
||||
ALWAYS_INLINE bool IsReadable() const { return m_readable_size != 0; }
|
||||
ALWAYS_INLINE bool IsWritable() const { return m_readable_size == 0; }
|
||||
ALWAYS_INLINE bool IsValid() const { return m_valid; }
|
||||
|
||||
ssize_t Read(void *dst, size_t size);
|
||||
ssize_t Write(const void *src, size_t size);
|
||||
|
||||
bool WaitToBeReadable();
|
||||
bool WaitToBeReadable(TimeSpan timeout);
|
||||
bool WaitToBeWritable();
|
||||
|
||||
void Invalidate();
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue