mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-31 23:08:22 -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,50 +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>
|
||||
#include "dmnt2_htcs_receive_buffer.hpp"
|
||||
|
||||
namespace ams::dmnt {
|
||||
|
||||
class HtcsSession {
|
||||
private:
|
||||
alignas(os::ThreadStackAlignment) u8 m_receive_thread_stack[util::AlignUp(os::MemoryPageSize + HtcsReceiveBuffer::ReceiveBufferSize, os::ThreadStackAlignment)];
|
||||
HtcsReceiveBuffer m_receive_buffer;
|
||||
os::ThreadType m_receive_thread;
|
||||
int m_socket;
|
||||
bool m_valid;
|
||||
public:
|
||||
HtcsSession(int fd);
|
||||
~HtcsSession();
|
||||
|
||||
ALWAYS_INLINE bool IsValid() const { return m_valid; }
|
||||
|
||||
bool WaitToBeReadable();
|
||||
bool WaitToBeReadable(TimeSpan timeout);
|
||||
|
||||
util::optional<char> GetChar();
|
||||
ssize_t PutChar(char c);
|
||||
ssize_t PutString(const char *str);
|
||||
|
||||
private:
|
||||
static void ReceiveThreadEntry(void *arg) {
|
||||
static_cast<HtcsSession *>(arg)->ReceiveThreadFunction();
|
||||
}
|
||||
|
||||
void ReceiveThreadFunction();
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue