From 815819767c5794624e3e7bc2bebcabe8ea4de0f6 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 7 Nov 2023 13:24:10 -0300 Subject: Force all exclusive memory accesses to be ordered on AppleHv (#5898) * Implement reprotect method on virtual memory manager (currently stubbed) * Force all exclusive memory accesses to be ordered on AppleHv * Format whitespace * Fix test build * Fix comment copy/paste * Fix wrong bit for isLoad * Update src/Ryujinx.Cpu/AppleHv/HvMemoryManager.cs Co-authored-by: riperiperi --------- Co-authored-by: riperiperi --- src/Ryujinx.Memory/IVirtualMemoryManager.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Ryujinx.Memory/IVirtualMemoryManager.cs') diff --git a/src/Ryujinx.Memory/IVirtualMemoryManager.cs b/src/Ryujinx.Memory/IVirtualMemoryManager.cs index edbfc885..8c9ca168 100644 --- a/src/Ryujinx.Memory/IVirtualMemoryManager.cs +++ b/src/Ryujinx.Memory/IVirtualMemoryManager.cs @@ -104,6 +104,12 @@ namespace Ryujinx.Memory /// True if the data was changed, false otherwise bool WriteWithRedundancyCheck(ulong va, ReadOnlySpan data); + /// + /// Fills the specified memory region with the value specified in . + /// + /// Virtual address to fill the value into + /// Size of the memory region to fill + /// Value to fill with void Fill(ulong va, ulong size, byte value) { const int MaxChunkSize = 1 << 24; @@ -194,6 +200,14 @@ namespace Ryujinx.Memory /// Optional ID of the handles that should not be signalled void SignalMemoryTracking(ulong va, ulong size, bool write, bool precise = false, int? exemptId = null); + /// + /// Reprotect a region of virtual memory for guest access. + /// + /// Virtual address base + /// Size of the region to protect + /// Memory protection to set + void Reprotect(ulong va, ulong size, MemoryPermission protection); + /// /// Reprotect a region of virtual memory for tracking. /// -- cgit v1.2.3