IMultiRegionHandle.cs
1 using System; 2 3 namespace Ryujinx.Memory.Tracking 4 { 5 public interface IMultiRegionHandle : IDisposable 6 { 7 /// <summary> 8 /// True if any write has occurred to the whole region since the last use of QueryModified (with no subregion specified). 9 /// </summary> 10 bool Dirty { get; } 11 12 /// <summary> 13 /// Force the range of handles to be dirty, without reprotecting. 14 /// </summary> 15 /// <param name="address">Start address of the range</param> 16 /// <param name="size">Size of the range</param> 17 public void ForceDirty(ulong address, ulong size); 18 19 /// <summary> 20 /// Check if any part of the region has been modified, and perform an action for each. 21 /// Contiguous modified regions are combined. 22 /// </summary> 23 /// <param name="modifiedAction">Action to perform for modified regions</param> 24 void QueryModified(Action<ulong, ulong> modifiedAction); 25 26 27 /// <summary> 28 /// Check if part of the region has been modified within a given range, and perform an action for each. 29 /// The range is aligned to the level of granularity of the contained handles. 30 /// Contiguous modified regions are combined. 31 /// </summary> 32 /// <param name="address">Start address of the range</param> 33 /// <param name="size">Size of the range</param> 34 /// <param name="modifiedAction">Action to perform for modified regions</param> 35 void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction); 36 37 /// <summary> 38 /// Check if part of the region has been modified within a given range, and perform an action for each. 39 /// The sequence number provided is compared with each handle's saved sequence number. 40 /// If it is equal, then the handle's dirty flag is ignored. Otherwise, the sequence number is saved. 41 /// The range is aligned to the level of granularity of the contained handles. 42 /// Contiguous modified regions are combined. 43 /// </summary> 44 /// <param name="address">Start address of the range</param> 45 /// <param name="size">Size of the range</param> 46 /// <param name="modifiedAction">Action to perform for modified regions</param> 47 /// <param name="sequenceNumber">Current sequence number</param> 48 void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction, int sequenceNumber); 49 50 /// <summary> 51 /// Signal that one of the subregions of this multi-region has been modified. This sets the overall dirty flag. 52 /// </summary> 53 void SignalWrite(); 54 } 55 }