From 52bc54205bfadb3e76a4cc52dc031839414c46d1 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 9 Oct 2024 15:20:32 -0700 Subject: [PATCH] kern: simplify KProcess max memory calculation --- libraries/libmesosphere/source/kern_k_process.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/libraries/libmesosphere/source/kern_k_process.cpp b/libraries/libmesosphere/source/kern_k_process.cpp index 96d82f975..24c6baef5 100644 --- a/libraries/libmesosphere/source/kern_k_process.cpp +++ b/libraries/libmesosphere/source/kern_k_process.cpp @@ -220,18 +220,8 @@ namespace ams::kern { m_running_thread_switch_counts[i] = 0; } - /* Set max memory based on address space type. */ - switch ((params.flags & ams::svc::CreateProcessFlag_AddressSpaceMask)) { - case ams::svc::CreateProcessFlag_AddressSpace32Bit: - case ams::svc::CreateProcessFlag_AddressSpace64BitDeprecated: - case ams::svc::CreateProcessFlag_AddressSpace64Bit: - m_max_process_memory = m_page_table.GetHeapRegionSize(); - break; - case ams::svc::CreateProcessFlag_AddressSpace32BitWithoutAlias: - m_max_process_memory = m_page_table.GetHeapRegionSize() + m_page_table.GetAliasRegionSize(); - break; - MESOSPHERE_UNREACHABLE_DEFAULT_CASE(); - } + /* Set max memory. */ + m_max_process_memory = m_page_table.GetHeapRegionSize(); /* Generate random entropy. */ KSystemControl::GenerateRandom(m_entropy, util::size(m_entropy));