IVirtualMemoryManagerTracked.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Ryujinx.Cpu.Tracking;
  2. using Ryujinx.Memory;
  3. using Ryujinx.Memory.Tracking;
  4. using System;
  5. using System.Collections.Generic;
  6. namespace Ryujinx.Cpu
  7. {
  8. public interface IVirtualMemoryManagerTracked : IVirtualMemoryManager
  9. {
  10. /// <summary>
  11. /// Reads data from CPU mapped memory, with read tracking
  12. /// </summary>
  13. /// <typeparam name="T">Type of the data being read</typeparam>
  14. /// <param name="va">Virtual address of the data in memory</param>
  15. /// <returns>The data</returns>
  16. T ReadTracked<T>(ulong va) where T : unmanaged;
  17. /// <summary>
  18. /// Writes data to CPU mapped memory, without write tracking.
  19. /// </summary>
  20. /// <param name="va">Virtual address to write the data into</param>
  21. /// <param name="data">Data to be written</param>
  22. void WriteUntracked(ulong va, ReadOnlySpan<byte> data);
  23. /// <summary>
  24. /// Obtains a memory tracking handle for the given virtual region. This should be disposed when finished with.
  25. /// </summary>
  26. /// <param name="address">CPU virtual address of the region</param>
  27. /// <param name="size">Size of the region</param>
  28. /// <param name="id">Handle ID</param>
  29. /// <returns>The memory tracking handle</returns>
  30. CpuRegionHandle BeginTracking(ulong address, ulong size, int id);
  31. /// <summary>
  32. /// Obtains a memory tracking handle for the given virtual region, with a specified granularity. This should be disposed when finished with.
  33. /// </summary>
  34. /// <param name="address">CPU virtual address of the region</param>
  35. /// <param name="size">Size of the region</param>
  36. /// <param name="handles">Handles to inherit state from or reuse. When none are present, provide null</param>
  37. /// <param name="granularity">Desired granularity of write tracking</param>
  38. /// <param name="id">Handle ID</param>
  39. /// <returns>The memory tracking handle</returns>
  40. CpuMultiRegionHandle BeginGranularTracking(ulong address, ulong size, IEnumerable<IRegionHandle> handles, ulong granularity, int id);
  41. /// <summary>
  42. /// Obtains a smart memory tracking handle for the given virtual region, with a specified granularity. This should be disposed when finished with.
  43. /// </summary>
  44. /// <param name="address">CPU virtual address of the region</param>
  45. /// <param name="size">Size of the region</param>
  46. /// <param name="granularity">Desired granularity of write tracking</param>
  47. /// <param name="id">Handle ID</param>
  48. /// <returns>The memory tracking handle</returns>
  49. CpuSmartMultiRegionHandle BeginSmartGranularTracking(ulong address, ulong size, ulong granularity, int id);
  50. }
  51. }