From 1741e27116ae660848260e3c4a28be5a0a03219a Mon Sep 17 00:00:00 2001 From: Lightos1 <124387232+Lightos1@users.noreply.github.com> Date: Thu, 10 Sep 2026 13:24:25 +0200 Subject: [PATCH] remove bss crap --- .../stratosphere/loader/source/ldr_process_creation.cpp | 6 ------ .../loader/source/oc/pcv/mariko/pcv_mariko.cpp | 7 +++---- .../Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp | 4 ---- .../stratosphere/loader/source/oc/pcv/pcv_common.hpp | 3 --- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp b/Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp index 9c7bc4f1..a4d90b00 100644 --- a/Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp @@ -820,12 +820,6 @@ namespace ams::ldr { } Result CreateProcessAndLoadAutoLoadModules(ProcessInfo *out, const Meta *meta, const AutoLoadModuleContext &ctx, const ArgumentStore::Entry *argument, u32 flags, os::NativeHandle resource_limit) { - /* Append extra .bss for 64LUT */ - /* TODO: REMOVE THIS. */ - if (g_is_pcv && ctx.main_nso_idx >= 0) { - g_nso_headers[ctx.main_nso_idx].bss_size += static_cast(hoc::pcv::HocPcvScratchSize); - } - /* Get CreateProcessParameter. */ svc::CreateProcessParameter param; R_TRY(GetCreateProcessParameter(std::addressof(param), meta, flags, resource_limit)); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/mariko/pcv_mariko.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/mariko/pcv_mariko.cpp index a7dcd47a..b41f2061 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/mariko/pcv_mariko.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/mariko/pcv_mariko.cpp @@ -45,6 +45,7 @@ namespace ams::ldr::hoc::pcv::mariko { size_t g_nso_size = 0; } + /* Todo: Remove this bs. */ [[maybe_unused]] static uintptr_t CaveReserve(size_t count) { return reinterpret_cast(Hooks().Reserve(count)); } @@ -620,10 +621,8 @@ namespace ams::ldr::hoc::pcv::mariko { } void Patch(uintptr_t mapped_nso, size_t nso_size) { - nsoStart = reinterpret_cast(mapped_nso); - - g_pcv_scratch = mapped_nso + nso_size - HocPcvScratchSize; - g_nso_size = nso_size; + nsoStart = reinterpret_cast(mapped_nso); + g_nso_size = nso_size; MtcGenerateFreqTables(); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp index 9807c4a6..1b45a170 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp @@ -212,10 +212,6 @@ namespace ams::ldr::hoc::pcv { Result MemFreqPllmLimit(u32 *ptr); Result MemVoltHandler(u32 *ptr); // Used for Erista MEM Vdd2 + EMC Vddq or Mariko MEM Vdd2 - /* Extra pcv .bss */ - constexpr size_t HocPcvScratchSize = 0x2000; - constexpr size_t HocBusFreqBufOffset = 0x1000; /* start of the SOC bus region */ - void SafetyCheck(); void Patch(uintptr_t mapped_nso, size_t nso_size, uintptr_t cave, size_t cave_size, uintptr_t nso_address, uintptr_t data_arena); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_common.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_common.hpp index bdda0361..156da655 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_common.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_common.hpp @@ -204,9 +204,6 @@ namespace ams::ldr::hoc::pcv { // The pcv SoC-voltage DVB table is a fixed 32-entry region. (it doesn't need to be larger) constexpr size_t DvbTableCapacity = 32; - // extra .bss location, 0 until Patch() runs. - inline uintptr_t g_pcv_scratch = 0; - inline uintptr_t g_pcv_cave = 0; inline size_t g_pcv_cave_size = 0;