diff options
| author | FernandoS27 <fsahmkow27@gmail.com> | 2021-06-06 09:57:24 +0200 |
|---|---|---|
| committer | Markus Wick <markus@selfnet.de> | 2021-06-11 17:27:17 +0200 |
| commit | 3147b9e34ce33747a57a1508ec9edd3ee9fa2eef (patch) | |
| tree | 1c388684ccc0ef52b124145cf3dfe98d5d427980 /src/core/memory.cpp | |
| parent | 8d2a08553e33af1222669ec8992bdd43ae531e18 (diff) | |
General: Add settings for fastmem and disabling adress space check.
Diffstat (limited to 'src/core/memory.cpp')
| -rw-r--r-- | src/core/memory.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 79468e4dc7..f285c6f639 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -47,7 +47,9 @@ struct Memory::Impl { "Out of bounds target: {:016X}", target); MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, Common::PageType::Memory); - system.DeviceMemory().buffer.Map(base, target - DramMemoryMap::Base, size); + if (Settings::IsFastmemEnabled()) { + system.DeviceMemory().buffer.Map(base, target - DramMemoryMap::Base, size); + } } void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) { @@ -55,7 +57,9 @@ struct Memory::Impl { ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base); MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped); - system.DeviceMemory().buffer.Unmap(base, size); + if (Settings::IsFastmemEnabled()) { + system.DeviceMemory().buffer.Unmap(base, size); + } } bool IsValidVirtualAddress(const Kernel::KProcess& process, const VAddr vaddr) const { @@ -475,8 +479,10 @@ struct Memory::Impl { return; } - const bool is_read_enable = Settings::IsGPULevelHigh() || !cached; - system.DeviceMemory().buffer.Protect(vaddr, size, is_read_enable, !cached); + if (Settings::IsFastmemEnabled()) { + const bool is_read_enable = Settings::IsGPULevelHigh() || !cached; + system.DeviceMemory().buffer.Protect(vaddr, size, is_read_enable, !cached); + } // Iterate over a contiguous CPU address space, which corresponds to the specified GPU // address space, marking the region as un/cached. The region is marked un/cached at a |
