kern: SvcChangeKernelTraceState

This commit is contained in:
Michael Scire authored and SciresM committed 2020-08-18 15:17:40 -07:00
1 parent 89f1c0ce33
commit f9d68db3f6
10 files changed
+279 -45

No files matched your search

@@ -227,7 +227,9 @@ namespace ams::kern {
void SetupPoolPartitionMemoryRegions() {
/* Start by identifying the extents of the DRAM memory region. */
const auto dram_extents = KMemoryLayout::GetPhysicalMemoryRegionTree().GetDerivedRegionExtents(KMemoryRegionType_Dram);
const auto dram_extents = KMemoryLayout::GetMainMemoryPhysicalExtents();
const uintptr_t pool_end = dram_extents.GetEndAddress() - KTraceBufferSize;
/* Get Application and Applet pool sizes. */
const size_t application_pool_size = KSystemControl::Init::GetApplicationPoolSize();
@@ -242,7 +244,7 @@ namespace ams::kern {
const uintptr_t pool_partitions_start = KMemoryLayout::GetPhysicalMemoryRegionTree().FindFirstRegionByTypeAttr(KMemoryRegionType_DramPoolPartition)->GetAddress();
/* Decide on starting addresses for our pools. */
const uintptr_t application_pool_start = dram_extents.GetEndAddress() - application_pool_size;
const uintptr_t application_pool_start = pool_end - application_pool_size;
const uintptr_t applet_pool_start = application_pool_start - applet_pool_size;
const uintptr_t unsafe_system_pool_start = std::min(kernel_dram_start + CarveoutSizeMax, util::AlignDown(applet_pool_start - unsafe_system_pool_min_size, CarveoutAlignment));
const size_t unsafe_system_pool_size = applet_pool_start - unsafe_system_pool_start;