diff options
| author | 2023-02-22 21:33:43 -0500 | |
|---|---|---|
| committer | 2023-03-01 10:42:45 -0500 | |
| commit | 4165ac06806017cfcb8da547ae84dee554e465c3 (patch) | |
| tree | 65abe4a9faf89d5ccfd3c4be0db85defd7a90574 /src | |
| parent | kernel: simplify KAbstractSchedulerLock::Lock (diff) | |
| download | yuzu-4165ac06806017cfcb8da547ae84dee554e465c3.tar.gz yuzu-4165ac06806017cfcb8da547ae84dee554e465c3.tar.xz yuzu-4165ac06806017cfcb8da547ae84dee554e465c3.zip | |
kernel: adjust pool allocations
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp | 21 | ||||
| -rw-r--r-- | src/core/hle/kernel/init/init_slab_setup.cpp | 2 |
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 | ||
| 15 | namespace impl { | 15 | namespace impl { |
| 16 | 16 | ||
| 17 | constexpr const std::size_t RequiredNonSecureSystemMemorySizeVi = 0x2238 * 4 * 1024; | 17 | using namespace Common::Literals; |
| 18 | constexpr const std::size_t RequiredNonSecureSystemMemorySizeNvservices = 0x710 * 4 * 1024; | 18 | |
| 19 | constexpr const std::size_t RequiredNonSecureSystemMemorySizeMisc = 0x80 * 4 * 1024; | 19 | constexpr const std::size_t RequiredNonSecureSystemMemorySizeVi = 0x2280 * 4_KiB; |
| 20 | constexpr const std::size_t RequiredNonSecureSystemMemorySizeViFatal = 0x200 * 4_KiB; | ||
| 21 | constexpr const std::size_t RequiredNonSecureSystemMemorySizeNvservices = 0x704 * 4_KiB; | ||
| 22 | constexpr 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 | ||
| 30 | constexpr const std::size_t RequiredNonSecureSystemMemorySizeWithFatal = | ||
| 31 | RequiredNonSecureSystemMemorySize + impl::RequiredNonSecureSystemMemorySizeViFatal; | ||
| 32 | |||
| 27 | namespace { | 33 | namespace { |
| 28 | 34 | ||
| 29 | using namespace Common::Literals; | 35 | using namespace Common::Literals; |
| @@ -120,10 +126,13 @@ size_t KSystemControl::Init::GetAppletPoolSize() { | |||
| 120 | 126 | ||
| 121 | size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() { | 127 | size_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 | ||
| 129 | namespace { | 138 | namespace { |
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 | ||
| 133 | size_t CalculateSlabHeapGapSize() { | 133 | size_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 | } |