IMultiRegionHandle.cs 2.3 KB

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