summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar GPUCode2023-11-17 22:23:48 +0200
committerGravatar t8952023-11-25 00:46:47 -0500
commit48388376206aaa7d887b41030019035a06203867 (patch)
tree6dc27b3fc69d7ec4a1d4247fd0a00b7542ef72d4 /src/core
parentexternals: Add oaknut submodule (diff)
downloadyuzu-48388376206aaa7d887b41030019035a06203867.tar.gz
yuzu-48388376206aaa7d887b41030019035a06203867.tar.xz
yuzu-48388376206aaa7d887b41030019035a06203867.zip
device_memory: Enable direct mapped addresses for nce
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp3
-rw-r--r--src/core/device_memory.cpp11
-rw-r--r--src/core/device_memory.h2
3 files changed, 11 insertions, 5 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 14d6c8c27..1d557fb43 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -136,7 +136,8 @@ struct System::Impl {
136 } 136 }
137 137
138 void Initialize(System& system) { 138 void Initialize(System& system) {
139 device_memory = std::make_unique<Core::DeviceMemory>(); 139 const bool direct_mapped_address = Settings::IsNceEnabled();
140 device_memory = std::make_unique<Core::DeviceMemory>(direct_mapped_address);
140 141
141 is_multicore = Settings::values.use_multi_core.GetValue(); 142 is_multicore = Settings::values.use_multi_core.GetValue();
142 extended_memory_layout = 143 extended_memory_layout =
diff --git a/src/core/device_memory.cpp b/src/core/device_memory.cpp
index de3f8ef8f..0528a8e3b 100644
--- a/src/core/device_memory.cpp
+++ b/src/core/device_memory.cpp
@@ -6,15 +6,20 @@
6 6
7namespace Core { 7namespace Core {
8 8
9#ifdef ANDROID 9#ifdef ARCHITECTURE_arm64
10constexpr size_t VirtualReserveSize = 1ULL << 38; 10constexpr size_t VirtualReserveSize = 1ULL << 38;
11#else 11#else
12constexpr size_t VirtualReserveSize = 1ULL << 39; 12constexpr size_t VirtualReserveSize = 1ULL << 39;
13#endif 13#endif
14 14
15DeviceMemory::DeviceMemory() 15DeviceMemory::DeviceMemory(bool direct_mapped_address)
16 : buffer{Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize(), 16 : buffer{Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize(),
17 VirtualReserveSize} {} 17 VirtualReserveSize} {
18 if (direct_mapped_address) {
19 buffer.EnableDirectMappedAddress();
20 }
21}
22
18DeviceMemory::~DeviceMemory() = default; 23DeviceMemory::~DeviceMemory() = default;
19 24
20} // namespace Core 25} // namespace Core
diff --git a/src/core/device_memory.h b/src/core/device_memory.h
index 13388b73e..368f19e86 100644
--- a/src/core/device_memory.h
+++ b/src/core/device_memory.h
@@ -18,7 +18,7 @@ enum : u64 {
18 18
19class DeviceMemory { 19class DeviceMemory {
20public: 20public:
21 explicit DeviceMemory(); 21 explicit DeviceMemory(bool direct_mapped_address);
22 ~DeviceMemory(); 22 ~DeviceMemory();
23 23
24 DeviceMemory& operator=(const DeviceMemory&) = delete; 24 DeviceMemory& operator=(const DeviceMemory&) = delete;