kern: resolve NonSecure definition TODO

This commit is contained in:
Michael Scire 2020-08-17 16:00:55 -07:00 committed by SciresM
parent a75c16226e
commit 79201428b0
2 changed files with 17 additions and 2 deletions

View file

@ -387,8 +387,11 @@ namespace ams::kern::board::nintendo::nx {
}
size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() {
/* TODO: Where does this constant actually come from? */
return 0x29C8000;
/* Verify that our minimum is at least as large as Nintendo's. */
constexpr size_t MinimumSize = ::ams::svc::RequiredNonSecureSystemMemorySize;
static_assert(MinimumSize >= 0x29C8000);
return MinimumSize;
}
void KSystemControl::Init::CpuOn(u64 core_id, uintptr_t entrypoint, uintptr_t arg) {

View file

@ -62,4 +62,16 @@ namespace ams::svc::board::nintendo::nx {
DeviceName_Count,
};
namespace impl {
constexpr inline const size_t RequiredNonSecureSystemMemorySizeVi = 0x2238 * 4_KB;
constexpr inline const size_t RequiredNonSecureSystemMemorySizeNvservices = 0x710 * 4_KB;
constexpr inline const size_t RequiredNonSecureSystemMemorySizeMisc = 0x80 * 4_KB;
}
constexpr inline const size_t RequiredNonSecureSystemMemorySize = impl::RequiredNonSecureSystemMemorySizeVi +
impl::RequiredNonSecureSystemMemorySizeNvservices +
impl::RequiredNonSecureSystemMemorySizeMisc;
}