diff options
| author | 2021-05-23 16:28:40 -0700 | |
|---|---|---|
| committer | 2021-05-23 16:28:40 -0700 | |
| commit | 3ead4a34940c952f980b1214968c09f59e04947f (patch) | |
| tree | aa559314c5332dc8dfc1e2303266592abc52ed48 /src/core/hle/kernel/init | |
| parent | Merge pull request #6248 from A-w-x/intelmesa (diff) | |
| parent | hle: kernel: service_thread: Take reference to KServerSession on service requ... (diff) | |
| download | yuzu-3ead4a34940c952f980b1214968c09f59e04947f.tar.gz yuzu-3ead4a34940c952f980b1214968c09f59e04947f.tar.xz yuzu-3ead4a34940c952f980b1214968c09f59e04947f.zip | |
Merge pull request #6347 from bunnei/ipc-improvements-next-2
Various improvements to IPC and session management (Part 2)
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; | |||
| 70 | template <typename T> | 70 | template <typename T> |
| 71 | VAddr InitializeSlabHeap(Core::System& system, KMemoryLayout& memory_layout, VAddr address, | 71 | VAddr InitializeSlabHeap(Core::System& system, KMemoryLayout& memory_layout, VAddr address, |
| 72 | size_t num_objects) { | 72 | size_t num_objects) { |
| 73 | // TODO(bunnei): This is just a place holder. We should initialize the appropriate KSlabHeap for | ||
| 74 | // kernel object type T with the backing kernel memory pointer once we emulate kernel memory. | ||
| 75 | |||
| 73 | const size_t size = Common::AlignUp(sizeof(T) * num_objects, alignof(void*)); | 76 | const size_t size = Common::AlignUp(sizeof(T) * num_objects, alignof(void*)); |
| 74 | VAddr start = Common::AlignUp(address, alignof(T)); | 77 | VAddr start = Common::AlignUp(address, alignof(T)); |
| 75 | 78 | ||
| 79 | // This is intentionally empty. Once KSlabHeap is fully implemented, we can replace this with | ||
| 80 | // the pointer to emulated memory to pass along. Until then, KSlabHeap will just allocate/free | ||
| 81 | // host memory. | ||
| 82 | void* backing_kernel_memory{}; | ||
| 83 | |||
| 76 | if (size > 0) { | 84 | if (size > 0) { |
| 77 | const KMemoryRegion* region = memory_layout.FindVirtual(start + size - 1); | 85 | const KMemoryRegion* region = memory_layout.FindVirtual(start + size - 1); |
| 78 | ASSERT(region != nullptr); | 86 | ASSERT(region != nullptr); |
| 79 | ASSERT(region->IsDerivedFrom(KMemoryRegionType_KernelSlab)); | 87 | ASSERT(region->IsDerivedFrom(KMemoryRegionType_KernelSlab)); |
| 80 | T::InitializeSlabHeap(system.Kernel(), system.Memory().GetKernelBuffer(start, size), size); | 88 | T::InitializeSlabHeap(system.Kernel(), backing_kernel_memory, size); |
| 81 | } | 89 | } |
| 82 | 90 | ||
| 83 | return start + size; | 91 | return start + size; |