diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-02-13 01:05:24 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-02-13 01:05:24 +0100 |
commit | ec9b6641b12aa04ae3d7782b0423037dbc1400ac (patch) | |
tree | fc563f28673dfe851cfaf665951423e0ad759025 /src/core/hle/kernel/kernel.cpp | |
parent | kernel: KScopedReservation implementation (diff) | |
download | yuzu-ec9b6641b12aa04ae3d7782b0423037dbc1400ac.tar yuzu-ec9b6641b12aa04ae3d7782b0423037dbc1400ac.tar.gz yuzu-ec9b6641b12aa04ae3d7782b0423037dbc1400ac.tar.bz2 yuzu-ec9b6641b12aa04ae3d7782b0423037dbc1400ac.tar.lz yuzu-ec9b6641b12aa04ae3d7782b0423037dbc1400ac.tar.xz yuzu-ec9b6641b12aa04ae3d7782b0423037dbc1400ac.tar.zst yuzu-ec9b6641b12aa04ae3d7782b0423037dbc1400ac.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 8da5a5c86..b6e6f115e 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -141,11 +141,17 @@ struct KernelCore::Impl { ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Events, 700).IsSuccess()); ASSERT(system_resource_limit->SetLimitValue(LimitableResource::TransferMemory, 200) .IsSuccess()); - ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Sessions, 900).IsSuccess()); + ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Sessions, 933).IsSuccess()); - if (!system_resource_limit->Reserve(LimitableResource::PhysicalMemory, 0x60000)) { + // Derived from recent software updates. The kernel reserves 27MB + constexpr u64 kernel_size{0x1b00000}; + if (!system_resource_limit->Reserve(LimitableResource::PhysicalMemory, kernel_size)) { UNREACHABLE(); } + // Reserve secure applet memory, introduced in firmware 5.0.0 + constexpr u64 secure_applet_memory_size{0x400000}; + ASSERT(system_resource_limit->Reserve(LimitableResource::PhysicalMemory, + secure_applet_memory_size)); } void InitializePreemption(KernelCore& kernel) { @@ -302,8 +308,11 @@ struct KernelCore::Impl { // Allocate slab heaps user_slab_heap_pages = std::make_unique<Memory::SlabHeap<Memory::Page>>(); + constexpr u64 user_slab_heap_size{0x1ef000}; + // Reserve slab heaps + ASSERT( + system_resource_limit->Reserve(LimitableResource::PhysicalMemory, user_slab_heap_size)); // Initialize slab heaps - constexpr u64 user_slab_heap_size{0x3de000}; user_slab_heap_pages->Initialize( system.DeviceMemory().GetPointer(Core::DramMemoryMap::SlabHeapBase), user_slab_heap_size); |