From c56a24e83bbdcdac3eadfab0366dec142ac808ca Mon Sep 17 00:00:00 2001 From: Gabriel A Date: Fri, 15 Mar 2024 01:53:20 -0300 Subject: [PATCH] Late map bridge too --- src/Ryujinx.Cpu/Jit/AddressSpacePartition.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Ryujinx.Cpu/Jit/AddressSpacePartition.cs b/src/Ryujinx.Cpu/Jit/AddressSpacePartition.cs index 732de44a36..80460fa4fd 100644 --- a/src/Ryujinx.Cpu/Jit/AddressSpacePartition.cs +++ b/src/Ryujinx.Cpu/Jit/AddressSpacePartition.cs @@ -208,6 +208,7 @@ namespace Ryujinx.Cpu.Jit private ulong _cachedFirstPagePa; private ulong _cachedLastPagePa; private MemoryBlock _firstPageMemoryForUnmap; + private ulong _firstPageOffsetForLateMap; public ulong Address { get; } public ulong Size { get; } @@ -331,6 +332,7 @@ namespace Ryujinx.Cpu.Jit _baseMemory.MapView(firstPageMemory, firstPageOffset, Size, _hostPageSize); _firstPageMemoryForUnmap = firstPageMemory; + _firstPageOffsetForLateMap = firstPageOffset; } else { @@ -603,6 +605,14 @@ namespace Ryujinx.Cpu.Jit _baseMemory.LateMapView(map.PrivateAllocation.Memory, map.PrivateAllocation.Offset, map.Address - Address, map.Size); } } + + MemoryBlock firstPageMemory = _firstPageMemoryForUnmap; + ulong firstPageOffset = _firstPageOffsetForLateMap; + + if (firstPageMemory != null) + { + _baseMemory.LateMapView(firstPageMemory, firstPageOffset, Size, _hostPageSize); + } } public PrivateRange GetFirstPrivateAllocation(ulong va, ulong size, out ulong nextVa)