From 63a12453f355a8502995545e915d9c43adc01e4b Mon Sep 17 00:00:00 2001 From: Christoph Baumann Date: Thu, 22 May 2025 22:50:11 +0200 Subject: [PATCH] fix memory mode --- exosphere/program/source/smc/secmon_smc_info.cpp | 6 +++++- .../include/exosphere/secmon/secmon_monitor_context.hpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/exosphere/program/source/smc/secmon_smc_info.cpp b/exosphere/program/source/smc/secmon_smc_info.cpp index 6bcd0ddd6..e1a6044eb 100644 --- a/exosphere/program/source/smc/secmon_smc_info.cpp +++ b/exosphere/program/source/smc/secmon_smc_info.cpp @@ -141,7 +141,6 @@ namespace ams::secmon::smc { } else if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) { memory_mode = GetMemoryMode(bcd.GetMemoryMode()); } - return memory_mode; } @@ -156,6 +155,11 @@ namespace ams::secmon::smc { value.Set(bcd.GetKernelFlags0()); } + if (GetSecmonConfiguration().IsMemoryModeAuto()) { + memory_size = pkg1::GetMemorySize(GetMemoryMode(pkg1::MemoryMode_Auto)); + } + + value.Set(memory_size); /* Exosphere extensions. */ diff --git a/libraries/libexosphere/include/exosphere/secmon/secmon_monitor_context.hpp b/libraries/libexosphere/include/exosphere/secmon/secmon_monitor_context.hpp index 3223202bf..3ea1fd016 100644 --- a/libraries/libexosphere/include/exosphere/secmon/secmon_monitor_context.hpp +++ b/libraries/libexosphere/include/exosphere/secmon/secmon_monitor_context.hpp @@ -97,7 +97,7 @@ namespace ams::secmon { constexpr u32 GetLogBaudRate() const { return this->log_baud_rate; } constexpr bool IsProduction() const { return this->GetHardwareState() != fuse::HardwareState_Development; } - constexpr bool IsMemoryModeAuto() const { return (this->memory_mode_auto); } + constexpr bool IsMemoryModeAuto() const { return (this->memory_mode_auto) != 0; } constexpr bool IsDevelopmentFunctionEnabledForKernel() const { return (this->flags[0] & SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForKernel) != 0; } constexpr bool IsDevelopmentFunctionEnabledForUser() const { return (this->flags[0] & SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForUser) != 0; }