mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-30 01:29:48 -06:00
Separate guest/host tracking + unaligned protection (#6486)
* WIP: Separate guest/host tracking + unaligned protection Allow memory manager to define support for single byte guest tracking * Formatting * Improve docs * Properly handle cases where the address space bits are too low * Address feedback
This commit is contained in:
@ -13,10 +13,14 @@ namespace Ryujinx.Memory.Tracking
|
||||
private readonly MemoryTracking _tracking;
|
||||
private MemoryPermission _lastPermission;
|
||||
|
||||
public VirtualRegion(MemoryTracking tracking, ulong address, ulong size, MemoryPermission lastPermission = MemoryPermission.Invalid) : base(address, size)
|
||||
public bool Guest { get; }
|
||||
|
||||
public VirtualRegion(MemoryTracking tracking, ulong address, ulong size, bool guest, MemoryPermission lastPermission = MemoryPermission.Invalid) : base(address, size)
|
||||
{
|
||||
_lastPermission = lastPermission;
|
||||
_tracking = tracking;
|
||||
|
||||
Guest = guest;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@ -103,7 +107,7 @@ namespace Ryujinx.Memory.Tracking
|
||||
|
||||
if (_lastPermission != permission)
|
||||
{
|
||||
_tracking.ProtectVirtualRegion(this, permission);
|
||||
_tracking.ProtectVirtualRegion(this, permission, Guest);
|
||||
_lastPermission = permission;
|
||||
|
||||
return true;
|
||||
@ -131,7 +135,7 @@ namespace Ryujinx.Memory.Tracking
|
||||
|
||||
public override INonOverlappingRange Split(ulong splitAddress)
|
||||
{
|
||||
VirtualRegion newRegion = new(_tracking, splitAddress, EndAddress - splitAddress, _lastPermission);
|
||||
VirtualRegion newRegion = new(_tracking, splitAddress, EndAddress - splitAddress, Guest, _lastPermission);
|
||||
Size = splitAddress - Address;
|
||||
|
||||
// The new region inherits all of our parents.
|
||||
|
Reference in New Issue
Block a user