improve build system for uart

This commit is contained in:
Lightos1
2026-07-27 19:57:41 +02:00
parent 139721761a
commit 02bbdcdb57
4 changed files with 166 additions and 13 deletions

View File

@@ -21,20 +21,32 @@
#include <stratosphere.hpp>
#include <vapours/results/results_common.hpp>
#define HOC_UART_LOG 1
#ifndef HOC_UART_LOG
#define HOC_UART_LOG 0
#endif
#if HOC_UART_LOG && !(defined(AMS_BUILD_FOR_AUDITING) || defined(AMS_BUILD_FOR_DEBUGGING))
#undef HOC_UART_LOG
#define HOC_UART_LOG 0
#endif
#define HOC_PCV_NVLOG_PATCH 1
#define HOC_PCV_FORCE_VERBOSITY 1
#include "customize.hpp"
#include "oc_log.hpp"
#define HOC_IRAM_LOG 0
#if (!HOC_UART_LOG) && (defined(AMS_BUILD_FOR_AUDITING) || defined(AMS_BUILD_FOR_DEBUGGING))
#undef HOC_IRAM_LOG
#define HOC_IRAM_LOG 1
#endif
#if defined(AMS_BUILD_FOR_AUDITING) || defined(AMS_BUILD_FOR_DEBUGGING)
#if defined(HOC_IRAM_LOG)
#if HOC_IRAM_LOG
#define LOGGING(...) Log(__VA_ARGS__)
#elif HOC_UART_LOG
#define LOGGING(fmt, ...) AMS_LOG(fmt "\n", ##__VA_ARGS__)

View File

@@ -19,7 +19,7 @@
#include "oc_common.hpp"
#ifdef HOC_IRAM_LOG
#if HOC_IRAM_LOG
#include "fatal_handler_bin.h"
#endif
@@ -107,7 +107,7 @@ namespace ams::ldr::hoc {
#define IRAM_LOG_CTX_ADDR 0x4003C000
#define IRAM_LOG_MAX_SZ 4096
#ifdef HOC_IRAM_LOG
#if HOC_IRAM_LOG
void Log(const char *data, ...) {
static const u32 max_log_sz = sizeof(working_buf) - sizeof(log_ctx_t);
static bool initDone = false;
@@ -139,7 +139,7 @@ namespace ams::ldr::hoc {
#endif
void ViewLog() {
#ifdef HOC_IRAM_LOG
#if HOC_IRAM_LOG
if (spl::GetSocType() == spl::SocType_Mariko) {
return;
}