mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2025-01-03 03:01:11 +00:00
pgl: fix minor bugs in impl
This commit is contained in:
parent
db55e9f6b1
commit
2421ba6c96
3 changed files with 11 additions and 4 deletions
|
@ -44,7 +44,7 @@ namespace ams::diag {
|
||||||
inline void DebugLog(const char *format, ...) __attribute__((format(printf, 1, 2)));
|
inline void DebugLog(const char *format, ...) __attribute__((format(printf, 1, 2)));
|
||||||
|
|
||||||
#ifdef AMS_ENABLE_DEBUG_PRINT
|
#ifdef AMS_ENABLE_DEBUG_PRINT
|
||||||
os::Mutex g_debug_log_lock;
|
os::Mutex g_debug_log_lock(true);
|
||||||
char g_debug_buffer[0x400];
|
char g_debug_buffer[0x400];
|
||||||
|
|
||||||
void DebugLogImpl(const char *format, ::std::va_list vl) {
|
void DebugLogImpl(const char *format, ::std::va_list vl) {
|
||||||
|
|
|
@ -169,7 +169,7 @@ namespace ams::fssystem {
|
||||||
if (this->size > ideal_size) {
|
if (this->size > ideal_size) {
|
||||||
/* If we do, we need to have a buffer allocated from the heap. */
|
/* If we do, we need to have a buffer allocated from the heap. */
|
||||||
AMS_ASSERT(this->buffer != nullptr);
|
AMS_ASSERT(this->buffer != nullptr);
|
||||||
AMS_ASSERT(g_heap.GetBlockSize(), HeapBlockSize);
|
AMS_ASSERT(g_heap.GetBlockSize() == HeapBlockSize);
|
||||||
|
|
||||||
const size_t new_size = util::AlignUp(ideal_size, HeapBlockSize);
|
const size_t new_size = util::AlignUp(ideal_size, HeapBlockSize);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace ams::pgl::srv {
|
||||||
bool g_enable_crash_report_screenshot = true;
|
bool g_enable_crash_report_screenshot = true;
|
||||||
bool g_enable_jit_debug = false;
|
bool g_enable_jit_debug = false;
|
||||||
|
|
||||||
constexpr inline size_t ProcessControlTaskStackSize = 4_KB;
|
constexpr inline size_t ProcessControlTaskStackSize = 8_KB;
|
||||||
constexpr inline s32 ProcessControlTaskPriority = 21;
|
constexpr inline s32 ProcessControlTaskPriority = 21;
|
||||||
os::ThreadType g_process_control_task_thread;
|
os::ThreadType g_process_control_task_thread;
|
||||||
alignas(os::ThreadStackAlignment) u8 g_process_control_task_stack[ProcessControlTaskStackSize];
|
alignas(os::ThreadStackAlignment) u8 g_process_control_task_stack[ProcessControlTaskStackSize];
|
||||||
|
@ -290,7 +290,7 @@ namespace ams::pgl::srv {
|
||||||
while (true) {
|
while (true) {
|
||||||
/* Wait for an event to come in, and clear our signal. */
|
/* Wait for an event to come in, and clear our signal. */
|
||||||
process_event.Wait();
|
process_event.Wait();
|
||||||
process_event.Signal();
|
process_event.Clear();
|
||||||
|
|
||||||
bool continue_getting_event = true;
|
bool continue_getting_event = true;
|
||||||
while (continue_getting_event) {
|
while (continue_getting_event) {
|
||||||
|
@ -329,6 +329,13 @@ namespace ams::pgl::srv {
|
||||||
settings::fwdbg::GetSettingsItemValue(std::addressof(g_enable_crash_report_screenshot), sizeof(g_enable_crash_report_screenshot), "creport", "crash_screen_shot");
|
settings::fwdbg::GetSettingsItemValue(std::addressof(g_enable_crash_report_screenshot), sizeof(g_enable_crash_report_screenshot), "creport", "crash_screen_shot");
|
||||||
g_is_production = !settings::fwdbg::IsDebugModeEnabled();
|
g_is_production = !settings::fwdbg::IsDebugModeEnabled();
|
||||||
|
|
||||||
|
/* Clear all process data. */
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < util::size(g_process_data); i++) {
|
||||||
|
g_process_data[i].process_id = os::InvalidProcessId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Start the thread. */
|
/* Start the thread. */
|
||||||
os::StartThread(std::addressof(g_process_control_task_thread));
|
os::StartThread(std::addressof(g_process_control_task_thread));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue