summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-10-11 18:55:12 +0200
committerLiam <byteslice@airmail.cc>2023-10-20 08:34:15 +0200
commitb456af31e6f1419a01374e9d06f56788d1406fe3 (patch)
tree85c045f4eaa79d2cfbe8bb08d2c4579d93129f3a /src/core/hle/kernel/kernel.cpp
parentk_page_table: implement PermissionLocked (diff)
downloadyuzu-b456af31e6f1419a01374e9d06f56788d1406fe3.tar
yuzu-b456af31e6f1419a01374e9d06f56788d1406fe3.tar.gz
yuzu-b456af31e6f1419a01374e9d06f56788d1406fe3.tar.bz2
yuzu-b456af31e6f1419a01374e9d06f56788d1406fe3.tar.lz
yuzu-b456af31e6f1419a01374e9d06f56788d1406fe3.tar.xz
yuzu-b456af31e6f1419a01374e9d06f56788d1406fe3.tar.zst
yuzu-b456af31e6f1419a01374e9d06f56788d1406fe3.zip
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index cb025c3d6..6f19860a1 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -623,14 +623,33 @@ struct KernelCore::Impl {
ASSERT(memory_layout->GetPhysicalMemoryRegionTree().Insert(
GetInteger(slab_start_phys_addr), slab_region_size, KMemoryRegionType_DramKernelSlab));
+ // Insert a physical region for the secure applet memory.
+ const auto secure_applet_end_phys_addr =
+ slab_end_phys_addr + KSystemControl::SecureAppletMemorySize;
+ if constexpr (KSystemControl::SecureAppletMemorySize > 0) {
+ ASSERT(memory_layout->GetPhysicalMemoryRegionTree().Insert(
+ GetInteger(slab_end_phys_addr), KSystemControl::SecureAppletMemorySize,
+ KMemoryRegionType_DramKernelSecureAppletMemory));
+ }
+
+ // Insert a physical region for the unknown debug2 region.
+ constexpr size_t SecureUnknownRegionSize = 0;
+ const size_t secure_unknown_size = SecureUnknownRegionSize;
+ const auto secure_unknown_end_phys_addr = secure_applet_end_phys_addr + secure_unknown_size;
+ if (secure_unknown_size > 0) {
+ ASSERT(memory_layout->GetPhysicalMemoryRegionTree().Insert(
+ GetInteger(secure_applet_end_phys_addr), secure_unknown_size,
+ KMemoryRegionType_DramKernelSecureUnknown));
+ }
+
// Determine size available for kernel page table heaps, requiring > 8 MB.
const KPhysicalAddress resource_end_phys_addr = slab_start_phys_addr + resource_region_size;
- const size_t page_table_heap_size = resource_end_phys_addr - slab_end_phys_addr;
+ const size_t page_table_heap_size = resource_end_phys_addr - secure_unknown_end_phys_addr;
ASSERT(page_table_heap_size / 4_MiB > 2);
// Insert a physical region for the kernel page table heap region
ASSERT(memory_layout->GetPhysicalMemoryRegionTree().Insert(
- GetInteger(slab_end_phys_addr), page_table_heap_size,
+ GetInteger(secure_unknown_end_phys_addr), page_table_heap_size,
KMemoryRegionType_DramKernelPtHeap));
// All DRAM regions that we haven't tagged by this point will be mapped under the linear