From dc1313ea3cde87a069ba95ad89acbb20b5c4617c Mon Sep 17 00:00:00 2001 From: Stephen Miller Date: Mon, 2 Sep 2024 09:43:27 -0500 Subject: [PATCH] Always assign memory_type and offset The memory_type default is based on fpPS4 behavior. I'm not entirely sure how the offset should be handled, but since the value we use defaults to 0 anyway, that should be better than leaving random data in that area. --- src/core/memory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 7a53c8341..640751477 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -308,6 +308,7 @@ int MemoryManager::VirtualQuery(VAddr addr, int flags, const auto& vma = it->second; info->start = vma.base; info->end = vma.base + vma.size; + info->offset = vma.phys_base; info->protection = static_cast(vma.prot); info->is_flexible.Assign(vma.type == VMAType::Flexible); info->is_direct.Assign(vma.type == VMAType::Direct); @@ -318,8 +319,9 @@ int MemoryManager::VirtualQuery(VAddr addr, int flags, if (vma.type == VMAType::Direct) { const auto dmem_it = FindDmemArea(vma.phys_base); ASSERT(dmem_it != dmem_map.end()); - info->offset = vma.phys_base; info->memory_type = dmem_it->second.memory_type; + } else { + info->memory_type = ::Libraries::Kernel::SCE_KERNEL_WB_ONION; } return ORBIS_OK;