mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-16 01:36:57 +00: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:
parent
ce607db944
commit
fdd3263e31
18 changed files with 774 additions and 763 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue