diff options
| author | 2021-03-23 18:47:16 -0700 | |
|---|---|---|
| committer | 2021-03-23 18:47:16 -0700 | |
| commit | 10d6e9f32bcc102d2fb12ba3e489c9a03d7f220f (patch) | |
| tree | 32e7512e8c19151be76acfeee5da07f96192ab75 /src/core/hle/kernel/kernel.cpp | |
| parent | hle: kernel: k_memory_region_type: Minor code cleanup. (diff) | |
| download | yuzu-10d6e9f32bcc102d2fb12ba3e489c9a03d7f220f.tar.gz yuzu-10d6e9f32bcc102d2fb12ba3e489c9a03d7f220f.tar.xz yuzu-10d6e9f32bcc102d2fb12ba3e489c9a03d7f220f.zip | |
hle: kernel: Breakup InitializeMemoryLayout.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index e994e8bed..557e63ea0 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -269,9 +269,7 @@ struct KernelCore::Impl { | |||
| 269 | return schedulers[thread_id]->GetCurrentThread(); | 269 | return schedulers[thread_id]->GetCurrentThread(); |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | void InitializeMemoryLayout() { | 272 | void DeriveInitialMemoryLayout(KMemoryLayout& memory_layout) { |
| 273 | KMemoryLayout memory_layout; | ||
| 274 | |||
| 275 | // Insert the root region for the virtual memory tree, from which all other regions will | 273 | // Insert the root region for the virtual memory tree, from which all other regions will |
| 276 | // derive. | 274 | // derive. |
| 277 | memory_layout.GetVirtualMemoryRegionTree().InsertDirectly( | 275 | memory_layout.GetVirtualMemoryRegionTree().InsertDirectly( |
| @@ -531,6 +529,12 @@ struct KernelCore::Impl { | |||
| 531 | // Cache all linear regions in their own trees for faster access, later. | 529 | // Cache all linear regions in their own trees for faster access, later. |
| 532 | memory_layout.InitializeLinearMemoryRegionTrees(aligned_linear_phys_start, | 530 | memory_layout.InitializeLinearMemoryRegionTrees(aligned_linear_phys_start, |
| 533 | linear_region_start); | 531 | linear_region_start); |
| 532 | } | ||
| 533 | |||
| 534 | void InitializeMemoryLayout() { | ||
| 535 | // Derive the initial memory layout from the emulated board | ||
| 536 | KMemoryLayout memory_layout; | ||
| 537 | DeriveInitialMemoryLayout(memory_layout); | ||
| 534 | 538 | ||
| 535 | const auto system_pool = memory_layout.GetKernelSystemPoolRegionPhysicalExtents(); | 539 | const auto system_pool = memory_layout.GetKernelSystemPoolRegionPhysicalExtents(); |
| 536 | const auto applet_pool = memory_layout.GetKernelAppletPoolRegionPhysicalExtents(); | 540 | const auto applet_pool = memory_layout.GetKernelAppletPoolRegionPhysicalExtents(); |