Add support for PermissionLocked attribute added on firmware 17.0.0 (#6072)

* Update MemoryState enum and add new flags

* Add support for new PermissionLocked attribute added on firmware 17.0.0

* Format whitespace
This commit is contained in:
gdkchan 2024-01-03 20:05:14 -03:00 committed by GitHub
parent f11d663df7
commit 6f50b9bdb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 172 additions and 35 deletions

View file

@ -949,8 +949,16 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
MemoryAttribute attributes = attributeMask | attributeValue;
const MemoryAttribute SupportedAttributes = MemoryAttribute.Uncached | MemoryAttribute.PermissionLocked;
if (attributes != attributeMask ||
(attributes | MemoryAttribute.Uncached) != MemoryAttribute.Uncached)
(attributes | SupportedAttributes) != SupportedAttributes)
{
return KernelResult.InvalidCombination;
}
// The permission locked attribute can't be unset.
if ((attributeMask & MemoryAttribute.PermissionLocked) != (attributeValue & MemoryAttribute.PermissionLocked))
{
return KernelResult.InvalidCombination;
}