From 98ceb6e43ef2a05d137d06aaaa6ae935ac6038e1 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:22:48 -0500 Subject: [PATCH] Allow overlapping direct memory mappings (#3648) Real hardware allows this, and it worked fine in the past, so allow it here. --- src/core/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index e916356cb..51ae29d92 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -350,7 +350,7 @@ s32 MemoryManager::MapMemory(void** out_addr, VAddr virtual_addr, u64 size, Memo do { auto dmem_area = FindDmemArea(phys_addr + validated_size)->second; // If any requested dmem area is not allocated, return an error. - if (dmem_area.dma_type != DMAType::Allocated) { + if (dmem_area.dma_type != DMAType::Allocated && dmem_area.dma_type != DMAType::Mapped) { LOG_ERROR(Kernel_Vmm, "Unable to map {:#x} bytes at physical address {:#x}", size, phys_addr); return ORBIS_KERNEL_ERROR_ENOMEM;