diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-21 03:15:59 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-21 06:41:52 +0200 |
commit | b4fc2e52a2d51f8958b77fbe4fb76c854cd4593b (patch) | |
tree | 64efafb1dfba8ba239d84d35fd78a584a6f4cb3a /src/core/hle/kernel/init | |
parent | Revert "WORKAROUND: Do not use slab heap while we track down issues with resource management." (diff) | |
download | yuzu-b4fc2e52a2d51f8958b77fbe4fb76c854cd4593b.tar yuzu-b4fc2e52a2d51f8958b77fbe4fb76c854cd4593b.tar.gz yuzu-b4fc2e52a2d51f8958b77fbe4fb76c854cd4593b.tar.bz2 yuzu-b4fc2e52a2d51f8958b77fbe4fb76c854cd4593b.tar.lz yuzu-b4fc2e52a2d51f8958b77fbe4fb76c854cd4593b.tar.xz yuzu-b4fc2e52a2d51f8958b77fbe4fb76c854cd4593b.tar.zst yuzu-b4fc2e52a2d51f8958b77fbe4fb76c854cd4593b.zip |
Diffstat (limited to 'src/core/hle/kernel/init')
-rw-r--r-- | src/core/hle/kernel/init/init_slab_setup.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/hle/kernel/init/init_slab_setup.cpp b/src/core/hle/kernel/init/init_slab_setup.cpp index 69ae405e6..10edede17 100644 --- a/src/core/hle/kernel/init/init_slab_setup.cpp +++ b/src/core/hle/kernel/init/init_slab_setup.cpp @@ -70,14 +70,22 @@ constexpr size_t SlabCountExtraKThread = 160; template <typename T> VAddr InitializeSlabHeap(Core::System& system, KMemoryLayout& memory_layout, VAddr address, size_t num_objects) { + // TODO(bunnei): This is just a place holder. We should initialize the appropriate KSlabHeap for + // kernel object type T with the backing kernel memory pointer once we emulate kernel memory. + const size_t size = Common::AlignUp(sizeof(T) * num_objects, alignof(void*)); VAddr start = Common::AlignUp(address, alignof(T)); + // This is intentionally empty. Once KSlabHeap is fully implemented, we can replace this with + // the pointer to emulated memory to pass along. Until then, KSlabHeap will just allocate/free + // host memory. + void* backing_kernel_memory{}; + if (size > 0) { const KMemoryRegion* region = memory_layout.FindVirtual(start + size - 1); ASSERT(region != nullptr); ASSERT(region->IsDerivedFrom(KMemoryRegionType_KernelSlab)); - T::InitializeSlabHeap(system.Kernel(), system.Memory().GetKernelBuffer(start, size), size); + T::InitializeSlabHeap(system.Kernel(), backing_kernel_memory, size); } return start + size; |