using Ryujinx.Memory;
using Ryujinx.Memory.Tracking;
using System;
using System.Collections.Generic;
namespace Ryujinx.Cpu
{
public interface IVirtualMemoryManagerTracked : IVirtualMemoryManager
{
///
/// Reads data from CPU mapped memory, with read tracking
///
/// Type of the data being read
/// Virtual address of the data in memory
/// The data
T ReadTracked(ulong va) where T : unmanaged;
///
/// Writes data to CPU mapped memory, without write tracking.
///
/// Virtual address to write the data into
/// Data to be written
void WriteUntracked(ulong va, ReadOnlySpan data);
///
/// Obtains a memory tracking handle for the given virtual region. This should be disposed when finished with.
///
/// CPU virtual address of the region
/// Size of the region
/// Handle ID
/// Region flags
/// The memory tracking handle
RegionHandle BeginTracking(ulong address, ulong size, int id, RegionFlags flags = RegionFlags.None);
///
/// Obtains a memory tracking handle for the given virtual region, with a specified granularity. This should be disposed when finished with.
///
/// CPU virtual address of the region
/// Size of the region
/// Handles to inherit state from or reuse. When none are present, provide null
/// Desired granularity of write tracking
/// Handle ID
/// Region flags
/// The memory tracking handle
MultiRegionHandle BeginGranularTracking(ulong address, ulong size, IEnumerable handles, ulong granularity, int id, RegionFlags flags = RegionFlags.None);
///
/// Obtains a smart memory tracking handle for the given virtual region, with a specified granularity. This should be disposed when finished with.
///
/// CPU virtual address of the region
/// Size of the region
/// Desired granularity of write tracking
/// Handle ID
/// The memory tracking handle
SmartMultiRegionHandle BeginSmartGranularTracking(ulong address, ulong size, ulong granularity, int id);
}
}