diff options
author | Franco M <francomaro@gmail.com> | 2023-10-21 07:25:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-21 07:25:27 +0200 |
commit | b76a1d987ff83b831a19a0c19f9fcd96c504c077 (patch) | |
tree | 4b08482cc3d34e341d7d8620182854c248f899b5 /src/core/hle/kernel/svc | |
parent | Reverted dirty code in main. (diff) | |
parent | Merge pull request #11748 from liamwhite/kern_1700 (diff) | |
download | yuzu-b76a1d987ff83b831a19a0c19f9fcd96c504c077.tar yuzu-b76a1d987ff83b831a19a0c19f9fcd96c504c077.tar.gz yuzu-b76a1d987ff83b831a19a0c19f9fcd96c504c077.tar.bz2 yuzu-b76a1d987ff83b831a19a0c19f9fcd96c504c077.tar.lz yuzu-b76a1d987ff83b831a19a0c19f9fcd96c504c077.tar.xz yuzu-b76a1d987ff83b831a19a0c19f9fcd96c504c077.tar.zst yuzu-b76a1d987ff83b831a19a0c19f9fcd96c504c077.zip |
Diffstat (limited to 'src/core/hle/kernel/svc')
-rw-r--r-- | src/core/hle/kernel/svc/svc_memory.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/kernel/svc/svc_memory.cpp b/src/core/hle/kernel/svc/svc_memory.cpp index 2cab74127..97f1210de 100644 --- a/src/core/hle/kernel/svc/svc_memory.cpp +++ b/src/core/hle/kernel/svc/svc_memory.cpp @@ -76,7 +76,7 @@ Result MapUnmapMemorySanityChecks(const KPageTable& manager, u64 dst_addr, u64 s } // namespace Result SetMemoryPermission(Core::System& system, u64 address, u64 size, MemoryPermission perm) { - LOG_DEBUG(Kernel_SVC, "called, address=0x{:016X}, size=0x{:X}, perm=0x{:08X", address, size, + LOG_DEBUG(Kernel_SVC, "called, address=0x{:016X}, size=0x{:X}, perm=0x{:08X}", address, size, perm); // Validate address / size. @@ -108,10 +108,16 @@ Result SetMemoryAttribute(Core::System& system, u64 address, u64 size, u32 mask, R_UNLESS((address < address + size), ResultInvalidCurrentMemory); // Validate the attribute and mask. - constexpr u32 SupportedMask = static_cast<u32>(MemoryAttribute::Uncached); + constexpr u32 SupportedMask = + static_cast<u32>(MemoryAttribute::Uncached | MemoryAttribute::PermissionLocked); R_UNLESS((mask | attr) == mask, ResultInvalidCombination); R_UNLESS((mask | attr | SupportedMask) == SupportedMask, ResultInvalidCombination); + // Check that permission locked is either being set or not masked. + R_UNLESS((static_cast<Svc::MemoryAttribute>(mask) & Svc::MemoryAttribute::PermissionLocked) == + (static_cast<Svc::MemoryAttribute>(attr) & Svc::MemoryAttribute::PermissionLocked), + ResultInvalidCombination); + // Validate that the region is in range for the current process. auto& page_table{GetCurrentProcess(system.Kernel()).GetPageTable()}; R_UNLESS(page_table.Contains(address, size), ResultInvalidCurrentMemory); |