diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-11-07 13:24:10 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 13:24:10 -0300 |
commit | 815819767c5794624e3e7bc2bebcabe8ea4de0f6 (patch) | |
tree | a57b27ee8d43f243e7085dfbba16a388d13f9432 /src/Ryujinx.Cpu/Jit/MemoryManager.cs | |
parent | 623604c39186901fd64c8e04e9aa959d5c825529 (diff) |
Force all exclusive memory accesses to be ordered on AppleHv (#5898)1.1.1072
* 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 <rhy3756547@hotmail.com>
---------
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
Diffstat (limited to 'src/Ryujinx.Cpu/Jit/MemoryManager.cs')
-rw-r--r-- | src/Ryujinx.Cpu/Jit/MemoryManager.cs | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/Ryujinx.Cpu/Jit/MemoryManager.cs b/src/Ryujinx.Cpu/Jit/MemoryManager.cs index 1c27e97f..912e3f7e 100644 --- a/src/Ryujinx.Cpu/Jit/MemoryManager.cs +++ b/src/Ryujinx.Cpu/Jit/MemoryManager.cs @@ -575,22 +575,15 @@ namespace Ryujinx.Cpu.Jit } } -#pragma warning disable IDE0051 // Remove unused private member - private ulong GetPhysicalAddress(ulong va) + private ulong GetPhysicalAddressInternal(ulong va) { - // We return -1L if the virtual address is invalid or unmapped. - if (!ValidateAddress(va) || !IsMapped(va)) - { - return ulong.MaxValue; - } - - return GetPhysicalAddressInternal(va); + return PteToPa(_pageTable.Read<ulong>((va / PageSize) * PteSize) & ~(0xffffUL << 48)) + (va & PageMask); } -#pragma warning restore IDE0051 - private ulong GetPhysicalAddressInternal(ulong va) + /// <inheritdoc/> + public void Reprotect(ulong va, ulong size, MemoryPermission protection) { - return PteToPa(_pageTable.Read<ulong>((va / PageSize) * PteSize) & ~(0xffffUL << 48)) + (va & PageMask); + // TODO } /// <inheritdoc/> @@ -698,9 +691,5 @@ namespace Ryujinx.Cpu.Jit /// Disposes of resources used by the memory manager. /// </summary> protected override void Destroy() => _pageTable.Dispose(); - -#pragma warning disable IDE0051 // Remove unused private member - private static void ThrowInvalidMemoryRegionException(string message) => throw new InvalidMemoryRegionException(message); -#pragma warning restore IDE0051 } } |