Late map bridge too

This commit is contained in:
Gabriel A 2024-03-15 01:53:20 -03:00
commit c56a24e83b

View file

@ -208,6 +208,7 @@ namespace Ryujinx.Cpu.Jit
private ulong _cachedFirstPagePa; private ulong _cachedFirstPagePa;
private ulong _cachedLastPagePa; private ulong _cachedLastPagePa;
private MemoryBlock _firstPageMemoryForUnmap; private MemoryBlock _firstPageMemoryForUnmap;
private ulong _firstPageOffsetForLateMap;
public ulong Address { get; } public ulong Address { get; }
public ulong Size { get; } public ulong Size { get; }
@ -331,6 +332,7 @@ namespace Ryujinx.Cpu.Jit
_baseMemory.MapView(firstPageMemory, firstPageOffset, Size, _hostPageSize); _baseMemory.MapView(firstPageMemory, firstPageOffset, Size, _hostPageSize);
_firstPageMemoryForUnmap = firstPageMemory; _firstPageMemoryForUnmap = firstPageMemory;
_firstPageOffsetForLateMap = firstPageOffset;
} }
else else
{ {
@ -603,6 +605,14 @@ namespace Ryujinx.Cpu.Jit
_baseMemory.LateMapView(map.PrivateAllocation.Memory, map.PrivateAllocation.Offset, map.Address - Address, map.Size); _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) public PrivateRange GetFirstPrivateAllocation(ulong va, ulong size, out ulong nextVa)