1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-08 13:11:49 +00:00

kern: fix using memory config for half-of-true-size

This commit is contained in:
Michael Scire 2024-03-29 03:18:20 -07:00
parent 31ad4eec1d
commit 29cc13543a

View file

@ -39,7 +39,7 @@ namespace ams::kern {
KPhysicalAddress KSystemControlBase::Init::GetKernelPhysicalBaseAddress(KPhysicalAddress base_address) { KPhysicalAddress KSystemControlBase::Init::GetKernelPhysicalBaseAddress(KPhysicalAddress base_address) {
const size_t real_dram_size = KSystemControl::Init::GetRealMemorySize(); const size_t real_dram_size = KSystemControl::Init::GetRealMemorySize();
const size_t intended_dram_size = KSystemControl::Init::GetIntendedMemorySize(); const size_t intended_dram_size = KSystemControl::Init::GetIntendedMemorySize();
if (intended_dram_size * 2 < real_dram_size) { if (intended_dram_size * 2 <= real_dram_size) {
return base_address; return base_address;
} else { } else {
return base_address + ((real_dram_size - intended_dram_size) / 2); return base_address + ((real_dram_size - intended_dram_size) / 2);