From 56ec55f3c48e5eb6d643b7356f9eb73a9efd1523 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 17 Aug 2020 16:48:52 -0700 Subject: [PATCH] kern: avoid hardcoding maximum board memory size --- .../nintendo/nx/kern_k_memory_layout.board.nintendo_nx.hpp | 3 ++- .../libmesosphere/include/mesosphere/kern_k_memory_layout.hpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/libmesosphere/include/mesosphere/board/nintendo/nx/kern_k_memory_layout.board.nintendo_nx.hpp b/libraries/libmesosphere/include/mesosphere/board/nintendo/nx/kern_k_memory_layout.board.nintendo_nx.hpp index beb1775f9..7ddb4a62b 100644 --- a/libraries/libmesosphere/include/mesosphere/board/nintendo/nx/kern_k_memory_layout.board.nintendo_nx.hpp +++ b/libraries/libmesosphere/include/mesosphere/board/nintendo/nx/kern_k_memory_layout.board.nintendo_nx.hpp @@ -18,6 +18,7 @@ namespace ams::kern { - constexpr inline size_t MainMemorySize = 4_GB; + constexpr inline size_t MainMemorySize = 4_GB; + constexpr inline size_t MainMemorySizeMax = 8_GB; } diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_memory_layout.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_memory_layout.hpp index bf03aa26a..814e64ab8 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_memory_layout.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_memory_layout.hpp @@ -39,7 +39,7 @@ namespace ams::kern { constexpr size_t KernelPhysicalAddressSpaceLast = KernelPhysicalAddressSpaceEnd - 1ul; constexpr size_t KernelPhysicalAddressSpaceSize = KernelPhysicalAddressSpaceEnd - KernelPhysicalAddressSpaceBase; - constexpr size_t KernelPageTableHeapSize = init::KInitialPageTable::GetMaximumOverheadSize(8_GB); + constexpr size_t KernelPageTableHeapSize = init::KInitialPageTable::GetMaximumOverheadSize(kern::MainMemorySizeMax); constexpr size_t KernelInitialPageHeapSize = 128_KB; constexpr size_t KernelSlabHeapDataSize = 5_MB;