mirror of
https://github.com/Ryujinx/ChocolArm64.git
synced 2024-12-23 04:55:29 +00:00
Implement SvcSetMemoryAttribute
This commit is contained in:
parent
068754fec5
commit
0371553a27
|
@ -234,6 +234,36 @@ namespace ChocolArm64.Memory
|
||||||
BaseEntry.Perm);
|
BaseEntry.Perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearAttrBit(long Position, long Size, int Bit)
|
||||||
|
{
|
||||||
|
while (Size > 0)
|
||||||
|
{
|
||||||
|
PTEntry Entry = GetPTEntry(Position);
|
||||||
|
|
||||||
|
Entry.Attr &= ~(1 << Bit);
|
||||||
|
|
||||||
|
SetPTEntry(Position, Entry);
|
||||||
|
|
||||||
|
Position += PageSize;
|
||||||
|
Size -= PageSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetAttrBit(long Position, long Size, int Bit)
|
||||||
|
{
|
||||||
|
while (Size > 0)
|
||||||
|
{
|
||||||
|
PTEntry Entry = GetPTEntry(Position);
|
||||||
|
|
||||||
|
Entry.Attr |= (1 << Bit);
|
||||||
|
|
||||||
|
SetPTEntry(Position, Entry);
|
||||||
|
|
||||||
|
Position += PageSize;
|
||||||
|
Size -= PageSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool HasPermission(long Position, AMemoryPerm Perm)
|
public bool HasPermission(long Position, AMemoryPerm Perm)
|
||||||
{
|
{
|
||||||
return GetPTEntry(Position).Perm.HasFlag(Perm);
|
return GetPTEntry(Position).Perm.HasFlag(Perm);
|
||||||
|
|
Loading…
Reference in a new issue