From 6f50b9bdb0943c350835453e97b02be52ad39bfd Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 3 Jan 2024 20:05:14 -0300 Subject: 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 --- src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/Ryujinx.HLE/HOS/Kernel/SupervisorCall') diff --git a/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs index e4f48da1..b07f5194 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs @@ -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; } -- cgit v1.2.3