summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Liam2023-02-22 21:33:43 -0500
committerGravatar Liam2023-03-01 10:42:45 -0500
commit4165ac06806017cfcb8da547ae84dee554e465c3 (patch)
tree65abe4a9faf89d5ccfd3c4be0db85defd7a90574 /src
parentkernel: simplify KAbstractSchedulerLock::Lock (diff)
downloadyuzu-4165ac06806017cfcb8da547ae84dee554e465c3.tar.gz
yuzu-4165ac06806017cfcb8da547ae84dee554e465c3.tar.xz
yuzu-4165ac06806017cfcb8da547ae84dee554e465c3.zip
kernel: adjust pool allocations
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp21
-rw-r--r--src/core/hle/kernel/init/init_slab_setup.cpp2
2 files changed, 16 insertions, 7 deletions
diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
index c10b7bf30..5b8a248c8 100644
--- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
+++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
@@ -14,9 +14,12 @@ namespace Kernel::Board::Nintendo::Nx {
14 14
15namespace impl { 15namespace impl {
16 16
17constexpr const std::size_t RequiredNonSecureSystemMemorySizeVi = 0x2238 * 4 * 1024; 17using namespace Common::Literals;
18constexpr const std::size_t RequiredNonSecureSystemMemorySizeNvservices = 0x710 * 4 * 1024; 18
19constexpr const std::size_t RequiredNonSecureSystemMemorySizeMisc = 0x80 * 4 * 1024; 19constexpr const std::size_t RequiredNonSecureSystemMemorySizeVi = 0x2280 * 4_KiB;
20constexpr const std::size_t RequiredNonSecureSystemMemorySizeViFatal = 0x200 * 4_KiB;
21constexpr const std::size_t RequiredNonSecureSystemMemorySizeNvservices = 0x704 * 4_KiB;
22constexpr const std::size_t RequiredNonSecureSystemMemorySizeMisc = 0x80 * 4_KiB;
20 23
21} // namespace impl 24} // namespace impl
22 25
@@ -24,6 +27,9 @@ constexpr const std::size_t RequiredNonSecureSystemMemorySize =
24 impl::RequiredNonSecureSystemMemorySizeVi + impl::RequiredNonSecureSystemMemorySizeNvservices + 27 impl::RequiredNonSecureSystemMemorySizeVi + impl::RequiredNonSecureSystemMemorySizeNvservices +
25 impl::RequiredNonSecureSystemMemorySizeMisc; 28 impl::RequiredNonSecureSystemMemorySizeMisc;
26 29
30constexpr const std::size_t RequiredNonSecureSystemMemorySizeWithFatal =
31 RequiredNonSecureSystemMemorySize + impl::RequiredNonSecureSystemMemorySizeViFatal;
32
27namespace { 33namespace {
28 34
29using namespace Common::Literals; 35using namespace Common::Literals;
@@ -120,10 +126,13 @@ size_t KSystemControl::Init::GetAppletPoolSize() {
120 126
121size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() { 127size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() {
122 // Verify that our minimum is at least as large as Nintendo's. 128 // Verify that our minimum is at least as large as Nintendo's.
123 constexpr size_t MinimumSize = RequiredNonSecureSystemMemorySize; 129 constexpr size_t MinimumSizeWithFatal = RequiredNonSecureSystemMemorySizeWithFatal;
124 static_assert(MinimumSize >= 0x29C8000); 130 static_assert(MinimumSizeWithFatal >= 0x2C04000);
131
132 constexpr size_t MinimumSizeWithoutFatal = RequiredNonSecureSystemMemorySize;
133 static_assert(MinimumSizeWithoutFatal >= 0x2A00000);
125 134
126 return MinimumSize; 135 return MinimumSizeWithFatal;
127} 136}
128 137
129namespace { 138namespace {
diff --git a/src/core/hle/kernel/init/init_slab_setup.cpp b/src/core/hle/kernel/init/init_slab_setup.cpp
index abdb5639f..be52405c6 100644
--- a/src/core/hle/kernel/init/init_slab_setup.cpp
+++ b/src/core/hle/kernel/init/init_slab_setup.cpp
@@ -131,7 +131,7 @@ VAddr InitializeSlabHeap(Core::System& system, KMemoryLayout& memory_layout, VAd
131} 131}
132 132
133size_t CalculateSlabHeapGapSize() { 133size_t CalculateSlabHeapGapSize() {
134 constexpr size_t KernelSlabHeapGapSize = 2_MiB - 320_KiB; 134 constexpr size_t KernelSlabHeapGapSize = 2_MiB - 356_KiB;
135 static_assert(KernelSlabHeapGapSize <= KernelSlabHeapGapsSizeMax); 135 static_assert(KernelSlabHeapGapSize <= KernelSlabHeapGapsSizeMax);
136 return KernelSlabHeapGapSize; 136 return KernelSlabHeapGapSize;
137} 137}