MockVirtualMemoryManager.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. namespace Ryujinx.Memory.Tests
  3. {
  4. class MockVirtualMemoryManager : IVirtualMemoryManager
  5. {
  6. public bool NoMappings;
  7. public MockVirtualMemoryManager(ulong size, int pageSize)
  8. {
  9. }
  10. public void Map(ulong va, ulong pa, ulong size)
  11. {
  12. throw new NotImplementedException();
  13. }
  14. public void Unmap(ulong va, ulong size)
  15. {
  16. throw new NotImplementedException();
  17. }
  18. public T Read<T>(ulong va) where T : unmanaged
  19. {
  20. throw new NotImplementedException();
  21. }
  22. public void Read(ulong va, Span<byte> data)
  23. {
  24. throw new NotImplementedException();
  25. }
  26. public void Write<T>(ulong va, T value) where T : unmanaged
  27. {
  28. throw new NotImplementedException();
  29. }
  30. public void Write(ulong va, ReadOnlySpan<byte> data)
  31. {
  32. throw new NotImplementedException();
  33. }
  34. public ReadOnlySpan<byte> GetSpan(ulong va, int size, bool tracked = false)
  35. {
  36. throw new NotImplementedException();
  37. }
  38. public WritableRegion GetWritableRegion(ulong va, int size)
  39. {
  40. throw new NotImplementedException();
  41. }
  42. public ref T GetRef<T>(ulong va) where T : unmanaged
  43. {
  44. throw new NotImplementedException();
  45. }
  46. public (ulong address, ulong size)[] GetPhysicalRegions(ulong va, ulong size)
  47. {
  48. return NoMappings ? new (ulong address, ulong size)[0] : new (ulong address, ulong size)[] { (va, size) };
  49. }
  50. public bool IsMapped(ulong va)
  51. {
  52. return true;
  53. }
  54. public bool IsRangeMapped(ulong va, ulong size)
  55. {
  56. return true;
  57. }
  58. public ulong GetPhysicalAddress(ulong va)
  59. {
  60. throw new NotImplementedException();
  61. }
  62. public void SignalMemoryTracking(ulong va, ulong size, bool write)
  63. {
  64. throw new NotImplementedException();
  65. }
  66. public void TrackingReprotect(ulong va, ulong size, MemoryPermission protection)
  67. {
  68. }
  69. }
  70. }