mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 12:21:18 +00:00
kern: better divide non-secure size, don't waste fatal memory unless necessary
This commit is contained in:
parent
2e7491f605
commit
255a0083a1
4 changed files with 19 additions and 6 deletions
|
@ -367,10 +367,14 @@ namespace ams::kern::board::nintendo::nx {
|
|||
|
||||
size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() {
|
||||
/* Verify that our minimum is at least as large as Nintendo's. */
|
||||
constexpr size_t MinimumSize = ::ams::svc::RequiredNonSecureSystemMemorySize;
|
||||
static_assert(MinimumSize >= 0x2C04000);
|
||||
constexpr size_t MinimumSizeWithFatal = ::ams::svc::RequiredNonSecureSystemMemorySizeWithFatal;
|
||||
static_assert(MinimumSizeWithFatal >= 0x2C04000);
|
||||
|
||||
return MinimumSize;
|
||||
constexpr size_t MinimumSizeWithoutFatal = ::ams::svc::RequiredNonSecureSystemMemorySize;
|
||||
static_assert(MinimumSizeWithoutFatal >= 0x2A00000);
|
||||
|
||||
/* Include fatal in non-seure size on 16.0.0+. */
|
||||
return kern::GetTargetFirmware() >= ams::TargetFirmware_16_0_0 ? MinimumSizeWithFatal : MinimumSizeWithoutFatal;
|
||||
}
|
||||
|
||||
u8 KSystemControl::Init::GetDebugLogUartPort() {
|
||||
|
|
|
@ -74,6 +74,8 @@ namespace ams::hos {
|
|||
Version_14_1_1 = ::ams::TargetFirmware_14_1_1,
|
||||
Version_14_1_2 = ::ams::TargetFirmware_14_1_2,
|
||||
Version_15_0_0 = ::ams::TargetFirmware_15_0_0,
|
||||
Version_15_0_1 = ::ams::TargetFirmware_15_0_1,
|
||||
Version_16_0_0 = ::ams::TargetFirmware_16_0_0,
|
||||
|
||||
Version_Current = ::ams::TargetFirmware_Current,
|
||||
|
||||
|
|
|
@ -72,8 +72,10 @@
|
|||
#define ATMOSPHERE_TARGET_FIRMWARE_14_1_1 ATMOSPHERE_TARGET_FIRMWARE(14, 1, 1)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_14_1_2 ATMOSPHERE_TARGET_FIRMWARE(14, 1, 2)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_15_0_0 ATMOSPHERE_TARGET_FIRMWARE(15, 0, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_15_0_1 ATMOSPHERE_TARGET_FIRMWARE(15, 0, 1)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_16_0_0 ATMOSPHERE_TARGET_FIRMWARE(16, 0, 0)
|
||||
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_15_0_0
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_16_0_0
|
||||
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT
|
||||
|
@ -138,6 +140,8 @@ namespace ams {
|
|||
TargetFirmware_14_1_1 = ATMOSPHERE_TARGET_FIRMWARE_14_1_1,
|
||||
TargetFirmware_14_1_2 = ATMOSPHERE_TARGET_FIRMWARE_14_1_2,
|
||||
TargetFirmware_15_0_0 = ATMOSPHERE_TARGET_FIRMWARE_15_0_0,
|
||||
TargetFirmware_15_0_1 = ATMOSPHERE_TARGET_FIRMWARE_15_0_1,
|
||||
TargetFirmware_16_0_0 = ATMOSPHERE_TARGET_FIRMWARE_16_0_0,
|
||||
|
||||
TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT,
|
||||
|
||||
|
|
|
@ -64,8 +64,9 @@ namespace ams::svc::board::nintendo::nx {
|
|||
|
||||
namespace impl {
|
||||
|
||||
constexpr inline const size_t RequiredNonSecureSystemMemorySizeVi = 0x2400 * 4_KB;
|
||||
constexpr inline const size_t RequiredNonSecureSystemMemorySizeNvservices = 0x784 * 4_KB;
|
||||
constexpr inline const size_t RequiredNonSecureSystemMemorySizeVi = 0x2280 * 4_KB;
|
||||
constexpr inline const size_t RequiredNonSecureSystemMemorySizeViFatal = 0x200 * 4_KB;
|
||||
constexpr inline const size_t RequiredNonSecureSystemMemorySizeNvservices = 0x704 * 4_KB;
|
||||
constexpr inline const size_t RequiredNonSecureSystemMemorySizeMisc = 0x80 * 4_KB;
|
||||
|
||||
}
|
||||
|
@ -74,4 +75,6 @@ namespace ams::svc::board::nintendo::nx {
|
|||
impl::RequiredNonSecureSystemMemorySizeNvservices +
|
||||
impl::RequiredNonSecureSystemMemorySizeMisc;
|
||||
|
||||
constexpr inline const size_t RequiredNonSecureSystemMemorySizeWithFatal = RequiredNonSecureSystemMemorySize + impl::RequiredNonSecureSystemMemorySizeViFatal;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue