diff options
Diffstat (limited to 'Ryujinx.Memory.Tests')
| -rw-r--r-- | Ryujinx.Memory.Tests/MockVirtualMemoryManager.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Memory.Tests/MultiRegionTrackingTests.cs | 16 | ||||
| -rw-r--r-- | Ryujinx.Memory.Tests/TrackingTests.cs | 24 |
3 files changed, 21 insertions, 21 deletions
diff --git a/Ryujinx.Memory.Tests/MockVirtualMemoryManager.cs b/Ryujinx.Memory.Tests/MockVirtualMemoryManager.cs index 06eb4729..6729f4a3 100644 --- a/Ryujinx.Memory.Tests/MockVirtualMemoryManager.cs +++ b/Ryujinx.Memory.Tests/MockVirtualMemoryManager.cs @@ -96,7 +96,7 @@ namespace Ryujinx.Memory.Tests throw new NotImplementedException(); } - public void SignalMemoryTracking(ulong va, ulong size, bool write, bool precise = false) + public void SignalMemoryTracking(ulong va, ulong size, bool write, bool precise = false, int? exemptId = null) { throw new NotImplementedException(); } diff --git a/Ryujinx.Memory.Tests/MultiRegionTrackingTests.cs b/Ryujinx.Memory.Tests/MultiRegionTrackingTests.cs index c607464d..38cb4921 100644 --- a/Ryujinx.Memory.Tests/MultiRegionTrackingTests.cs +++ b/Ryujinx.Memory.Tests/MultiRegionTrackingTests.cs @@ -34,8 +34,8 @@ namespace Ryujinx.Memory.Tests private IMultiRegionHandle GetGranular(bool smart, ulong address, ulong size, ulong granularity) { return smart ? - _tracking.BeginSmartGranularTracking(address, size, granularity) : - (IMultiRegionHandle)_tracking.BeginGranularTracking(address, size, null, granularity); + _tracking.BeginSmartGranularTracking(address, size, granularity, 0) : + (IMultiRegionHandle)_tracking.BeginGranularTracking(address, size, null, granularity, 0); } private void RandomOrder(Random random, List<int> indices, Action<int> action) @@ -216,7 +216,7 @@ namespace Ryujinx.Memory.Tests { int region = regionSizes[i]; handle.QueryModified(address, (ulong)(PageSize * region), (address, size) => { }); - + // There should be a gap between regions, // So that they don't combine and we can see the full effects. address += (ulong)(PageSize * (region + 1)); @@ -294,7 +294,7 @@ namespace Ryujinx.Memory.Tests bool[] actionsTriggered = new bool[3]; - MultiRegionHandle granular = _tracking.BeginGranularTracking(PageSize * 3, PageSize * 3, null, PageSize); + MultiRegionHandle granular = _tracking.BeginGranularTracking(PageSize * 3, PageSize * 3, null, PageSize, 0); PreparePages(granular, 3, PageSize * 3); // Write to the second handle in the multiregion. @@ -307,7 +307,7 @@ namespace Ryujinx.Memory.Tests for (int i = 0; i < 3; i++) { - singlePages[i] = _tracking.BeginTracking(PageSize * (8 + (ulong)i), PageSize); + singlePages[i] = _tracking.BeginTracking(PageSize * (8 + (ulong)i), PageSize, 0); singlePages[i].Reprotect(); } @@ -321,7 +321,7 @@ namespace Ryujinx.Memory.Tests for (int i = 0; i < 3; i++) { - doublePages[i] = _tracking.BeginTracking(PageSize * (11 + (ulong)i * 2), PageSize * 2); + doublePages[i] = _tracking.BeginTracking(PageSize * (11 + (ulong)i * 2), PageSize * 2, 0); doublePages[i].Reprotect(); } @@ -340,7 +340,7 @@ namespace Ryujinx.Memory.Tests doublePages }; - MultiRegionHandle combined = _tracking.BeginGranularTracking(0, PageSize * 18, handleGroups.SelectMany((handles) => handles), PageSize); + MultiRegionHandle combined = _tracking.BeginGranularTracking(0, PageSize * 18, handleGroups.SelectMany((handles) => handles), PageSize, 0); bool[] expectedDirty = new bool[] { @@ -405,7 +405,7 @@ namespace Ryujinx.Memory.Tests { bool actionTriggered = false; - MultiRegionHandle granular = _tracking.BeginGranularTracking(PageSize * 3, PageSize * 3, null, PageSize); + MultiRegionHandle granular = _tracking.BeginGranularTracking(PageSize * 3, PageSize * 3, null, PageSize, 0); PreparePages(granular, 3, PageSize * 3); // Add a precise action to the second and third handle in the multiregion. diff --git a/Ryujinx.Memory.Tests/TrackingTests.cs b/Ryujinx.Memory.Tests/TrackingTests.cs index b0c39ab0..eb679804 100644 --- a/Ryujinx.Memory.Tests/TrackingTests.cs +++ b/Ryujinx.Memory.Tests/TrackingTests.cs @@ -44,7 +44,7 @@ namespace Ryujinx.Memory.Tests [Test] public void SingleRegion() { - RegionHandle handle = _tracking.BeginTracking(0, PageSize); + RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0); (ulong address, ulong size)? readTrackingTriggered = null; handle.RegisterAction((address, size) => { @@ -97,7 +97,7 @@ namespace Ryujinx.Memory.Tests [Test] public void OverlappingRegions() { - RegionHandle allHandle = _tracking.BeginTracking(0, PageSize * 16); + RegionHandle allHandle = _tracking.BeginTracking(0, PageSize * 16, 0); allHandle.Reprotect(); (ulong address, ulong size)? readTrackingTriggeredAll = null; @@ -116,7 +116,7 @@ namespace Ryujinx.Memory.Tests for (int i = 0; i < 16; i++) { - containedHandles[i] = _tracking.BeginTracking((ulong)i * PageSize, PageSize); + containedHandles[i] = _tracking.BeginTracking((ulong)i * PageSize, PageSize, 0); containedHandles[i].Reprotect(); } @@ -163,7 +163,7 @@ namespace Ryujinx.Memory.Tests ulong alignedEnd = ((address + size + PageSize - 1) / PageSize) * PageSize; ulong alignedSize = alignedEnd - alignedStart; - RegionHandle handle = _tracking.BeginTracking(address, size); + RegionHandle handle = _tracking.BeginTracking(address, size, 0); // Anywhere inside the pages the region is contained on should trigger. @@ -207,7 +207,7 @@ namespace Ryujinx.Memory.Tests for (int i = 0; i < handles.Length; i++) { - handles[i] = _tracking.BeginTracking((ulong)i * PageSize, PageSize); + handles[i] = _tracking.BeginTracking((ulong)i * PageSize, PageSize, 0); handles[i].Reprotect(); } @@ -263,7 +263,7 @@ namespace Ryujinx.Memory.Tests Random random = new Random(randSeed + 512); while (Stopwatch.GetTimestamp() < finishedTime) { - RegionHandle handle = _tracking.BeginTracking((ulong)random.Next(maxAddress), (ulong)random.Next(65536)); + RegionHandle handle = _tracking.BeginTracking((ulong)random.Next(maxAddress), (ulong)random.Next(65536), 0); handle.Dispose(); @@ -295,7 +295,7 @@ namespace Ryujinx.Memory.Tests // Read actions should only be triggered once for each registration. // The implementation should use an interlocked exchange to make sure other threads can't get the action. - RegionHandle handle = _tracking.BeginTracking(0, PageSize); + RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0); int triggeredCount = 0; int registeredCount = 0; @@ -359,7 +359,7 @@ namespace Ryujinx.Memory.Tests { // Ensure that disposed handles correctly remove their virtual and physical regions. - RegionHandle handle = _tracking.BeginTracking(0, PageSize); + RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0); handle.Reprotect(); Assert.AreEqual(1, _tracking.GetRegionCount()); @@ -372,8 +372,8 @@ namespace Ryujinx.Memory.Tests // We expect there to be three regions after creating both, one for the small region and two covering the big one around it. // Regions are always split to avoid overlapping, which is why there are three instead of two. - RegionHandle handleSmall = _tracking.BeginTracking(PageSize, PageSize); - RegionHandle handleBig = _tracking.BeginTracking(0, PageSize * 4); + RegionHandle handleSmall = _tracking.BeginTracking(PageSize, PageSize, 0); + RegionHandle handleBig = _tracking.BeginTracking(0, PageSize * 4, 0); Assert.AreEqual(3, _tracking.GetRegionCount()); @@ -398,7 +398,7 @@ namespace Ryujinx.Memory.Tests protection = newProtection; }; - RegionHandle handle = _tracking.BeginTracking(0, PageSize); + RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0); // After creating the handle, there is no protection yet. Assert.AreEqual(MemoryPermission.ReadAndWrite, protection); @@ -453,7 +453,7 @@ namespace Ryujinx.Memory.Tests [Test] public void PreciseAction() { - RegionHandle handle = _tracking.BeginTracking(0, PageSize); + RegionHandle handle = _tracking.BeginTracking(0, PageSize, 0); (ulong address, ulong size, bool write)? preciseTriggered = null; handle.RegisterPreciseAction((address, size, write) => |
