diff options
author | Liam <byteslice@airmail.cc> | 2023-03-18 02:26:04 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-03-22 14:35:16 +0100 |
commit | fb49ec19c1fb6030fcc960077e82c998290d0ab8 (patch) | |
tree | aa5f53cbbfc2b255923bcf362ee0009938ed8187 /src/core/hle/kernel/board/nintendo/nx | |
parent | Merge pull request #9955 from liamwhite/color-blend-equation (diff) | |
download | yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.gz yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.bz2 yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.lz yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.xz yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.zst yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.zip |
Diffstat (limited to 'src/core/hle/kernel/board/nintendo/nx')
4 files changed, 12 insertions, 10 deletions
diff --git a/src/core/hle/kernel/board/nintendo/nx/k_memory_layout.cpp b/src/core/hle/kernel/board/nintendo/nx/k_memory_layout.cpp index 098ba6eac..24eb3f886 100644 --- a/src/core/hle/kernel/board/nintendo/nx/k_memory_layout.cpp +++ b/src/core/hle/kernel/board/nintendo/nx/k_memory_layout.cpp @@ -76,22 +76,24 @@ void SetupDevicePhysicalMemoryRegions(KMemoryLayout& memory_layout) { void SetupDramPhysicalMemoryRegions(KMemoryLayout& memory_layout) { const size_t intended_memory_size = KSystemControl::Init::GetIntendedMemorySize(); - const PAddr physical_memory_base_address = + const KPhysicalAddress physical_memory_base_address = KSystemControl::Init::GetKernelPhysicalBaseAddress(DramPhysicalAddress); // Insert blocks into the tree. ASSERT(memory_layout.GetPhysicalMemoryRegionTree().Insert( - physical_memory_base_address, intended_memory_size, KMemoryRegionType_Dram)); + GetInteger(physical_memory_base_address), intended_memory_size, KMemoryRegionType_Dram)); ASSERT(memory_layout.GetPhysicalMemoryRegionTree().Insert( - physical_memory_base_address, ReservedEarlyDramSize, KMemoryRegionType_DramReservedEarly)); + GetInteger(physical_memory_base_address), ReservedEarlyDramSize, + KMemoryRegionType_DramReservedEarly)); // Insert the KTrace block at the end of Dram, if KTrace is enabled. static_assert(!IsKTraceEnabled || KTraceBufferSize > 0); if constexpr (IsKTraceEnabled) { - const PAddr ktrace_buffer_phys_addr = + const KPhysicalAddress ktrace_buffer_phys_addr = physical_memory_base_address + intended_memory_size - KTraceBufferSize; ASSERT(memory_layout.GetPhysicalMemoryRegionTree().Insert( - ktrace_buffer_phys_addr, KTraceBufferSize, KMemoryRegionType_KernelTraceBuffer)); + GetInteger(ktrace_buffer_phys_addr), KTraceBufferSize, + KMemoryRegionType_KernelTraceBuffer)); } } diff --git a/src/core/hle/kernel/board/nintendo/nx/k_memory_layout.h b/src/core/hle/kernel/board/nintendo/nx/k_memory_layout.h index d02ee61c3..f8fee4f5b 100644 --- a/src/core/hle/kernel/board/nintendo/nx/k_memory_layout.h +++ b/src/core/hle/kernel/board/nintendo/nx/k_memory_layout.h @@ -3,10 +3,10 @@ #pragma once -#include "common/common_types.h" +#include "core/hle/kernel/k_typed_address.h" namespace Kernel { -constexpr inline PAddr MainMemoryAddress = 0x80000000; +constexpr inline KPhysicalAddress MainMemoryAddress = 0x80000000; } // namespace Kernel diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp index 5b8a248c8..42d1fcc28 100644 --- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp +++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp @@ -61,7 +61,7 @@ size_t KSystemControl::Init::GetIntendedMemorySize() { } } -PAddr KSystemControl::Init::GetKernelPhysicalBaseAddress(u64 base_address) { +KPhysicalAddress KSystemControl::Init::GetKernelPhysicalBaseAddress(KPhysicalAddress base_address) { const size_t real_dram_size = KSystemControl::Init::GetRealMemorySize(); const size_t intended_dram_size = KSystemControl::Init::GetIntendedMemorySize(); if (intended_dram_size * 2 < real_dram_size) { diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.h b/src/core/hle/kernel/board/nintendo/nx/k_system_control.h index 4b717d091..b477e8193 100644 --- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.h +++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.h @@ -3,7 +3,7 @@ #pragma once -#include "common/common_types.h" +#include "core/hle/kernel/k_typed_address.h" namespace Kernel::Board::Nintendo::Nx { @@ -18,7 +18,7 @@ public: // Initialization. static std::size_t GetRealMemorySize(); static std::size_t GetIntendedMemorySize(); - static PAddr GetKernelPhysicalBaseAddress(u64 base_address); + static KPhysicalAddress GetKernelPhysicalBaseAddress(KPhysicalAddress base_address); static bool ShouldIncreaseThreadResourceLimit(); static std::size_t GetApplicationPoolSize(); static std::size_t GetAppletPoolSize(); |