add exosphere.ini option to determine memory mode from physical memory instead of boot config

This commit is contained in:
Christoph Baumann
2025-05-21 01:17:18 +02:00
parent 77a01f0a9b
commit 5819f3a830
3 changed files with 33 additions and 23 deletions

View File

@@ -132,10 +132,13 @@ namespace ams::secmon::smc {
}
u32 GetMemoryMode() {
/* Unless development function is enabled, we're 4 GB. */
/* Unless development function is enabled or memory_mode_auto is set, we're 4 GB. */
u32 memory_mode = pkg1::MemoryMode_4GB;
if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) {
if (GetSecmonConfiguration().IsMemoryModeAuto()) {
/* If memory_mode_auto is set, determine memory mode from physical memory */
memory_mode = GetMemoryMode(pkg1::MemoryMode_Auto);
} else if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) {
memory_mode = GetMemoryMode(bcd.GetMemoryMode());
}