diff options
| author | TSR Berry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-08 01:22:00 +0200 |
|---|---|---|
| committer | Mary <thog@protonmail.com> | 2023-04-27 23:51:14 +0200 |
| commit | cee712105850ac3385cd0091a923438167433f9f (patch) | |
| tree | 4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /src/Ryujinx.Memory/Tracking/IMultiRegionHandle.cs | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'src/Ryujinx.Memory/Tracking/IMultiRegionHandle.cs')
| -rw-r--r-- | src/Ryujinx.Memory/Tracking/IMultiRegionHandle.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/Ryujinx.Memory/Tracking/IMultiRegionHandle.cs b/src/Ryujinx.Memory/Tracking/IMultiRegionHandle.cs new file mode 100644 index 00000000..71bd602f --- /dev/null +++ b/src/Ryujinx.Memory/Tracking/IMultiRegionHandle.cs @@ -0,0 +1,55 @@ +using System; + +namespace Ryujinx.Memory.Tracking +{ + public interface IMultiRegionHandle : IDisposable + { + /// <summary> + /// True if any write has occurred to the whole region since the last use of QueryModified (with no subregion specified). + /// </summary> + bool Dirty { get; } + + /// <summary> + /// Force the range of handles to be dirty, without reprotecting. + /// </summary> + /// <param name="address">Start address of the range</param> + /// <param name="size">Size of the range</param> + public void ForceDirty(ulong address, ulong size); + + /// <summary> + /// Check if any part of the region has been modified, and perform an action for each. + /// Contiguous modified regions are combined. + /// </summary> + /// <param name="modifiedAction">Action to perform for modified regions</param> + void QueryModified(Action<ulong, ulong> modifiedAction); + + + /// <summary> + /// Check if part of the region has been modified within a given range, and perform an action for each. + /// The range is aligned to the level of granularity of the contained handles. + /// Contiguous modified regions are combined. + /// </summary> + /// <param name="address">Start address of the range</param> + /// <param name="size">Size of the range</param> + /// <param name="modifiedAction">Action to perform for modified regions</param> + void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction); + + /// <summary> + /// Check if part of the region has been modified within a given range, and perform an action for each. + /// The sequence number provided is compared with each handle's saved sequence number. + /// If it is equal, then the handle's dirty flag is ignored. Otherwise, the sequence number is saved. + /// The range is aligned to the level of granularity of the contained handles. + /// Contiguous modified regions are combined. + /// </summary> + /// <param name="address">Start address of the range</param> + /// <param name="size">Size of the range</param> + /// <param name="modifiedAction">Action to perform for modified regions</param> + /// <param name="sequenceNumber">Current sequence number</param> + void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction, int sequenceNumber); + + /// <summary> + /// Signal that one of the subregions of this multi-region has been modified. This sets the overall dirty flag. + /// </summary> + void SignalWrite(); + } +} |
