kern: load initial process binary from user pool, rather than from pt heap

This commit is contained in:
Michael Scire 2021-04-07 12:25:10 -07:00 committed by SciresM
parent a1e137cc1c
commit 0f8b7be2d2
13 changed files with 350 additions and 184 deletions

View file

@ -21,7 +21,8 @@ namespace ams::kern::board::nintendo::nx {
namespace {
constexpr size_t SecureAlignment = 128_KB;
constexpr uintptr_t DramPhysicalAddress = 0x80000000;
constexpr size_t SecureAlignment = 128_KB;
/* Global variables for panic. */
constinit bool g_call_smc_on_panic;
@ -348,6 +349,10 @@ namespace ams::kern::board::nintendo::nx {
}
}
KPhysicalAddress KSystemControl::Init::GetInitialProcessBinaryPhysicalAddress() {
return GetKernelPhysicalBaseAddress(DramPhysicalAddress) + GetIntendedMemorySize() - KTraceBufferSize - InitialProcessBinarySizeMax;
}
bool KSystemControl::Init::ShouldIncreaseThreadResourceLimit() {
return GetKernelConfigurationForInit().Get<smc::KernelConfiguration::IncreaseThreadResourceLimit>();
}