diff options
author | Fernando S <fsahmkow27@gmail.com> | 2023-10-20 17:08:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-20 17:08:00 +0200 |
commit | 2e760a98333520f3de1fa7c7a1f9298fd7241ceb (patch) | |
tree | 90e8a1aa75a91659c0b553f3746ea4febc0bf273 /src/core/hle/kernel/svc | |
parent | Merge pull request #11825 from liamwhite/system-resource (diff) | |
parent | gdbstub: add PermissionLocked to mappings table (diff) | |
download | yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.tar yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.tar.gz yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.tar.bz2 yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.tar.lz yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.tar.xz yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.tar.zst yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.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); |