From 34e1f39510348a6e40236aea90c6ecfd9662ec86 Mon Sep 17 00:00:00 2001 From: Lightos1 <124387232+Lightos1@users.noreply.github.com> Date: Tue, 12 May 2026 13:07:46 +0200 Subject: [PATCH] ldr: even more (partially guessed) labeling of CvbMeta --- .../loader/source/oc/pcv/pcv_common.hpp | 15 +++++---------- .../loader/source/oc/pcv/pcv_erista.cpp | 2 +- .../loader/source/oc/pcv/pcv_mariko.cpp | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) 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 437942c0..10e70395 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_common.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_common.hpp @@ -38,14 +38,14 @@ namespace ams::ldr::hoc::pcv { }; static_assert(sizeof(cvb_entry_t) == 0x38); - struct cvb_cpu_dfll_data { + struct CvbCpuDfllData { u32 tune0_low; u32 tune0_high; u32 tune1_low; u32 tune1_high; - unsigned int tune_high_min_millivolts; - unsigned int tune_high_margin_millivolts; - unsigned long dvco_calibration_max; + u32 tune_high_min_millivolts; + u32 tune_high_margin_millivolts; + u64 dvco_calibration_max; }; struct __attribute__((packed)) div_nmp { @@ -117,12 +117,7 @@ namespace ams::ldr::hoc::pcv { struct __attribute__((packed)) CvbMeta { u64 socType; - u32 tune0_low; - u32 tune0_high; - u32 tune1_low; - u32 tune1_high; - u32 unkZero[2]; - u64 unkScale; + CvbCpuDfllData dfllData; /* Maybe? */ u32 unkZero2[6]; u32 unkMagic; u32 unkZero3; 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 7a56b101..6cad4558 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp @@ -66,7 +66,7 @@ namespace ams::ldr::hoc::pcv::erista { } Result CpuVoltDfll(u32* ptr) { - cvb_cpu_dfll_data *entry = reinterpret_cast(ptr); + CvbCpuDfllData *entry = reinterpret_cast(ptr); R_UNLESS(entry->tune0_low == 0xFFEAD0FF, ldr::ResultInvalidCpuVoltDfllEntry()); R_UNLESS(entry->tune0_high == 0x0, ldr::ResultInvalidCpuVoltDfllEntry()); R_UNLESS(entry->tune1_low == 0x0, ldr::ResultInvalidCpuVoltDfllEntry()); 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 0137ab12..2427da54 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp @@ -134,7 +134,7 @@ namespace ams::ldr::hoc::pcv::mariko { } Result CpuVoltDfll(u32 *ptr) { - cvb_cpu_dfll_data *entry = reinterpret_cast(ptr); + CvbCpuDfllData *entry = reinterpret_cast(ptr); R_UNLESS(entry->tune0_low == 0xFFCF, ldr::ResultInvalidCpuVoltDfllEntry()); R_UNLESS(entry->tune0_high == 0x0, ldr::ResultInvalidCpuVoltDfllEntry());