diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-05 06:35:42 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:54 +0200 |
commit | b805ee653f3d178ed2b4b2e0a403bb0ab61dad8b (patch) | |
tree | fd54235441ff4c2a0986e106bf57c501c2c9982b /src/core/hle/kernel/kernel.cpp | |
parent | fixup! hle: kernel: Migrate KSharedMemory to KAutoObject. (diff) | |
download | yuzu-b805ee653f3d178ed2b4b2e0a403bb0ab61dad8b.tar yuzu-b805ee653f3d178ed2b4b2e0a403bb0ab61dad8b.tar.gz yuzu-b805ee653f3d178ed2b4b2e0a403bb0ab61dad8b.tar.bz2 yuzu-b805ee653f3d178ed2b4b2e0a403bb0ab61dad8b.tar.lz yuzu-b805ee653f3d178ed2b4b2e0a403bb0ab61dad8b.tar.xz yuzu-b805ee653f3d178ed2b4b2e0a403bb0ab61dad8b.tar.zst yuzu-b805ee653f3d178ed2b4b2e0a403bb0ab61dad8b.zip |
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 5ebd47e49..32bbf2d9b 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -69,6 +69,7 @@ struct KernelCore::Impl { InitializePhysicalCores(); // Derive the initial memory layout from the emulated board + Init::InitializeSlabResourceCounts(kernel); KMemoryLayout memory_layout; DeriveInitialMemoryLayout(memory_layout); Init::InitializeSlabHeaps(system, memory_layout); @@ -395,7 +396,7 @@ struct KernelCore::Impl { // Determine the size of the slab region. const size_t slab_region_size = - Common::AlignUp(Init::CalculateTotalSlabHeapSize(), PageSize); + Common::AlignUp(Init::CalculateTotalSlabHeapSize(system.Kernel()), PageSize); ASSERT(slab_region_size <= resource_region_size); // Setup the slab region. @@ -642,6 +643,7 @@ struct KernelCore::Impl { std::unique_ptr<Kernel::GlobalSchedulerContext> global_scheduler_context; Kernel::TimeManager time_manager; + Init::KSlabResourceCounts slab_resource_counts{}; KResourceLimit* system_resource_limit{}; std::shared_ptr<Core::Timing::EventType> preemption_event; @@ -995,6 +997,14 @@ void KernelCore::ReleaseServiceThread(std::weak_ptr<Kernel::ServiceThread> servi }); } +Init::KSlabResourceCounts& KernelCore::SlabResourceCounts() { + return impl->slab_resource_counts; +} + +const Init::KSlabResourceCounts& KernelCore::SlabResourceCounts() const { + return impl->slab_resource_counts; +} + bool KernelCore::IsPhantomModeForSingleCore() const { return impl->IsPhantomModeForSingleCore(); } |