diff options
Diffstat (limited to 'Ryujinx.Memory')
| -rw-r--r-- | Ryujinx.Memory/AddressSpaceManager.cs | 8 | ||||
| -rw-r--r-- | Ryujinx.Memory/IVirtualMemoryManager.cs | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/Ryujinx.Memory/AddressSpaceManager.cs b/Ryujinx.Memory/AddressSpaceManager.cs index 45f3225e..ffe880bf 100644 --- a/Ryujinx.Memory/AddressSpaceManager.cs +++ b/Ryujinx.Memory/AddressSpaceManager.cs @@ -137,6 +137,14 @@ namespace Ryujinx.Memory } /// <inheritdoc/> + public bool WriteWithRedundancyCheck(ulong va, ReadOnlySpan<byte> data) + { + Write(va, data); + + return true; + } + + /// <inheritdoc/> public ReadOnlySpan<byte> GetSpan(ulong va, int size, bool tracked = false) { if (size == 0) diff --git a/Ryujinx.Memory/IVirtualMemoryManager.cs b/Ryujinx.Memory/IVirtualMemoryManager.cs index f97cb0b5..c8a74f66 100644 --- a/Ryujinx.Memory/IVirtualMemoryManager.cs +++ b/Ryujinx.Memory/IVirtualMemoryManager.cs @@ -58,6 +58,17 @@ namespace Ryujinx.Memory /// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception> void Write(ulong va, ReadOnlySpan<byte> data); + /// <summary> + /// Writes data to the application process, returning false if the data was not changed. + /// This triggers read memory tracking, as a redundancy check would be useless if the data is not up to date. + /// </summary> + /// <remarks>The memory manager can return that memory has changed when it hasn't to avoid expensive data copies.</remarks> + /// <param name="va">Virtual address to write the data into</param> + /// <param name="data">Data to be written</param> + /// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception> + /// <returns>True if the data was changed, false otherwise</returns> + bool WriteWithRedundancyCheck(ulong va, ReadOnlySpan<byte> data); + void Fill(ulong va, ulong size, byte value) { const int MaxChunkSize = 1 << 24; |
