From 9b91d7487c5eeaae9cf6c4e76d92c02b670deabd Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Sun, 8 Feb 2026 11:56:04 -0500 Subject: [PATCH] ldr: rename namespace --- .../loader/source/ldr_process_creation.cpp | 4 +-- .../loader/source/oc/customize.cpp | 2 +- .../loader/source/oc/customize.hpp | 2 +- .../source/oc/mariko/calculate_timings.cpp | 2 +- .../source/oc/mariko/calculate_timings.hpp | 2 +- .../loader/source/oc/mariko/timing_tables.cpp | 2 +- .../loader/source/oc/mariko/timing_tables.hpp | 2 +- .../loader/source/oc/mtc_timing_value.hpp | 2 +- .../loader/source/oc/oc_common.hpp | 2 +- .../stratosphere/loader/source/oc/oc_test.cpp | 28 +++++++++---------- .../stratosphere/loader/source/oc/pcv/pcv.cpp | 2 +- .../stratosphere/loader/source/oc/pcv/pcv.hpp | 2 +- .../loader/source/oc/pcv/pcv_common.hpp | 2 +- .../loader/source/oc/pcv/pcv_erista.cpp | 2 +- .../loader/source/oc/pcv/pcv_mariko.cpp | 2 +- .../stratosphere/loader/source/oc/ptm/ptm.cpp | 2 +- .../stratosphere/loader/source/oc/ptm/ptm.hpp | 2 +- 17 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp b/Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp index 7b32a110..a63a84c1 100644 --- a/Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/ldr_process_creation.cpp @@ -694,11 +694,11 @@ namespace ams::ldr { /* Apply PCV and PTM patches */ if (g_is_pcv) { - oc::pcv::Patch(map_address, nso_size); + hoc::pcv::Patch(map_address, nso_size); } if (g_is_ptm) { - oc::ptm::Patch(map_address, nso_size); + hoc::ptm::Patch(map_address, nso_size); } } diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp index f5dc05d6..1d5b1947 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp @@ -29,7 +29,7 @@ #define GPU_MIN_MIN_VOLT 480000 #define CPU_MAX_MAX_VOLT 1235000 -namespace ams::ldr::oc { +namespace ams::ldr::hoc { volatile CustomizeTable C = { /* Disables RAM powerdown */ diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp index e8836b4a..693881f3 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp @@ -25,7 +25,7 @@ #include "oc_common.hpp" #include "pcv/pcv_common.hpp" -namespace ams::ldr::oc { +namespace ams::ldr::hoc { #include "mtc_timing_table.hpp" diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/mariko/calculate_timings.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/mariko/calculate_timings.cpp index 22146959..d2446bfb 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/mariko/calculate_timings.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/mariko/calculate_timings.cpp @@ -18,7 +18,7 @@ #include "../mtc_timing_value.hpp" #include "timing_tables.hpp" -namespace ams::ldr::oc::pcv::mariko { +namespace ams::ldr::hoc::pcv::mariko { u32 GetRext() { if (auto r = FindRext()) { diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/mariko/calculate_timings.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/mariko/calculate_timings.hpp index 57fcb24a..a885c323 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/mariko/calculate_timings.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/mariko/calculate_timings.hpp @@ -16,7 +16,7 @@ #pragma once -namespace ams::ldr::oc::pcv::mariko { +namespace ams::ldr::hoc::pcv::mariko { void CalculateTimings(); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/mariko/timing_tables.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/mariko/timing_tables.cpp index 68699706..102e4a9b 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/mariko/timing_tables.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/mariko/timing_tables.cpp @@ -17,7 +17,7 @@ #include "../mtc_timing_value.hpp" #include "timing_tables.hpp" -namespace ams::ldr::oc::pcv::mariko { +namespace ams::ldr::hoc::pcv::mariko { const ReplacePatch g_rext_table[] = { {2'133'000, 0x1A}, {2'166'000, 0x19}, {2'200'000, 0x19}, diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/mariko/timing_tables.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/mariko/timing_tables.hpp index 893007d2..429cd3c4 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/mariko/timing_tables.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/mariko/timing_tables.hpp @@ -17,7 +17,7 @@ #pragma once #include "../mtc_timing_value.hpp" -namespace ams::ldr::oc::pcv::mariko { +namespace ams::ldr::hoc::pcv::mariko { struct ReplacePatch { u32 freq; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/mtc_timing_value.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/mtc_timing_value.hpp index 4f459e68..6d5cd99b 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/mtc_timing_value.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/mtc_timing_value.hpp @@ -20,7 +20,7 @@ #include "oc_common.hpp" -namespace ams::ldr::oc { +namespace ams::ldr::hoc { #define MAX(A, B) std::max(A, B) #define MIN(A, B) std::min(A, B) #define CEIL(A) std::ceil(A) diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/oc_common.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/oc_common.hpp index c1a65914..1afddad1 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/oc_common.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/oc_common.hpp @@ -52,7 +52,7 @@ namespace ams::ldr { R_DEFINE_ERROR_RESULT(SafetyCheckFailure, 1015); } -namespace ams::ldr::oc { +namespace ams::ldr::hoc { template struct PatcherEntry { using patternFn = bool(*)(Pointer* ptr); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/oc_test.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/oc_test.cpp index b86f717b..aac74454 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/oc_test.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/oc_test.cpp @@ -65,7 +65,7 @@ void saveExec(const char* file_loc, const void* buf, size_t size) { } Result Test_PcvDvfsTable() { - using namespace ams::ldr::oc::pcv; + using namespace ams::ldr::hoc::pcv; assert(GetDvfsTableEntryCount((cvb_entry_t *)(&mariko::CpuCvbTableDefault)) == 18); assert(GetDvfsTableEntryCount((cvb_entry_t *)(&erista::CpuCvbTableDefault)) == 16); @@ -76,19 +76,19 @@ Result Test_PcvDvfsTable() { cvb_entry_t last_mariko_cpu_cvb_entry_default = { 1963500, { 1675751, -38635, 27 }, { 1120000 } }; assert(memcmp(GetDvfsTableLastEntry((cvb_entry_t *)(&mariko::CpuCvbTableDefault)), (void *)&last_mariko_cpu_cvb_entry_default, sizeof(last_mariko_cpu_cvb_entry_default)) == 0); assert(GetDvfsTableLastEntry((cvb_entry_t *)(&erista::GpuCvbTableDefault))->freq == 921600); - assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::oc::C.marikoCpuDvfsTableSLT)) == 25); + assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::hoc::C.marikoCpuDvfsTableSLT)) == 25); // Customized table default - assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::oc::C.eristaCpuDvfsTable)) == 19); - assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::oc::C.marikoCpuDvfsTable)) == 21); - assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::oc::C.marikoCpuDvfsTableSLT)) == 22); + assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::hoc::C.eristaCpuDvfsTable)) == 19); + assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::hoc::C.marikoCpuDvfsTable)) == 21); + assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::hoc::C.marikoCpuDvfsTableSLT)) == 22); - assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::oc::C.eristaGpuDvfsTable)) == 12); - assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::oc::C.marikoGpuDvfsTable)) == 17); - assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::oc::C.marikoGpuDvfsTableSLT)) == 17); - assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::oc::C.marikoGpuDvfsTableHiOPT)) == 17); + assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::hoc::C.eristaGpuDvfsTable)) == 12); + assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::hoc::C.marikoGpuDvfsTable)) == 17); + assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::hoc::C.marikoGpuDvfsTableSLT)) == 17); + assert(GetDvfsTableEntryCount((cvb_entry_t *)(&ams::ldr::hoc::C.marikoGpuDvfsTableHiOPT)) == 17); - constexpr size_t limit = ams::ldr::oc::pcv::DvfsTableEntryLimit; + constexpr size_t limit = ams::ldr::hoc::pcv::DvfsTableEntryLimit; cvb_entry_t customized_table[limit] = {}; for (size_t i = 0; i < limit; i++) { assert(GetDvfsTableEntryCount(customized_table) == i); @@ -156,14 +156,14 @@ int main(int argc, char** argv) { size_t exec_path_patched_len = exec_path_len + std::max(strlen(mariko_ext), strlen(erista_ext)) + 1; if (exe_opt == EXE_PCV) { - ams::ldr::oc::pcv::SafetyCheck(); + ams::ldr::hoc::pcv::SafetyCheck(); { void* erista_buf = malloc(file_size); std::memcpy(erista_buf, file_buffer, file_size); printf("Patching %s for Erista...\n", pcv_opt); - ams::ldr::oc::pcv::erista::Patch(reinterpret_cast(erista_buf), file_size); + ams::ldr::hoc::pcv::erista::Patch(reinterpret_cast(erista_buf), file_size); if (save_patched) { char* exec_path_erista = reinterpret_cast(malloc(exec_path_patched_len)); strncpy(exec_path_erista, exec_path, exec_path_patched_len); @@ -179,7 +179,7 @@ int main(int argc, char** argv) { std::memcpy(mariko_buf, file_buffer, file_size); printf("Patching %s for Mariko...\n", pcv_opt); - ams::ldr::oc::pcv::mariko::Patch(reinterpret_cast(mariko_buf), file_size); + ams::ldr::hoc::pcv::mariko::Patch(reinterpret_cast(mariko_buf), file_size); if (save_patched) { char* exec_path_mariko = reinterpret_cast(malloc(exec_path_patched_len)); strncpy(exec_path_mariko, exec_path, exec_path_patched_len); @@ -196,7 +196,7 @@ int main(int argc, char** argv) { std::memcpy(mariko_buf, file_buffer, file_size); printf("Patching %s (Mariko Only)...\n", ptm_opt); - ams::ldr::oc::ptm::Patch(reinterpret_cast(mariko_buf), file_size); + ams::ldr::hoc::ptm::Patch(reinterpret_cast(mariko_buf), file_size); if (save_patched) { char* exec_path_mariko = reinterpret_cast(malloc(exec_path_patched_len)); strncpy(exec_path_mariko, exec_path, exec_path_patched_len); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp index 8c5412c4..35d3ebae 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp @@ -20,7 +20,7 @@ #include "pcv.hpp" -namespace ams::ldr::oc::pcv { +namespace ams::ldr::hoc::pcv { Result MemFreqPllmLimit(u32* ptr) { clk_pll_param* entry = reinterpret_cast(ptr); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp index 0eb25e4e..ab52f759 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp @@ -23,7 +23,7 @@ #include "../oc_common.hpp" #include "pcv_common.hpp" -namespace ams::ldr::oc::pcv { +namespace ams::ldr::hoc::pcv { namespace mariko { constexpr cvb_entry_t CpuCvbTableDefault[] = { 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 d852745b..ea77bac2 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_common.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_common.hpp @@ -18,7 +18,7 @@ #pragma once - namespace ams::ldr::oc::pcv { + namespace ams::ldr::hoc::pcv { typedef struct cvb_coefficients { s32 c0 = 0; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp index 6815fdd2..f9e83081 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp @@ -21,7 +21,7 @@ #include "pcv.hpp" #include "../mtc_timing_value.hpp" -namespace ams::ldr::oc::pcv::erista { +namespace ams::ldr::hoc::pcv::erista { Result CpuVoltDvfs(u32 *ptr) { if (MatchesPattern(ptr, cpuVoltDvfsPattern, cpuVoltDvfsOffsets)) { diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp index d8beb55b..05db6a6d 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp @@ -22,7 +22,7 @@ #include "../mtc_timing_value.hpp" #include "../mariko/calculate_timings.hpp" -namespace ams::ldr::oc::pcv::mariko { +namespace ams::ldr::hoc::pcv::mariko { u32 GetGpuVminVoltage() { for (auto e : vminTable) { diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/ptm/ptm.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/ptm/ptm.cpp index c5ff8fca..e7a8d66d 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/ptm/ptm.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/ptm/ptm.cpp @@ -18,7 +18,7 @@ #include "ptm.hpp" -namespace ams::ldr::oc::ptm { +namespace ams::ldr::hoc::ptm { Result CpuPtmBoost(perf_conf_entry* entry) { diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/ptm/ptm.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/ptm/ptm.hpp index 0c4b5f9a..9c82bc60 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/ptm/ptm.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/ptm/ptm.hpp @@ -20,7 +20,7 @@ #include "../oc_common.hpp" -namespace ams::ldr::oc::ptm { +namespace ams::ldr::hoc::ptm { typedef struct { u32 conf_id;