diff options
| author | 2023-10-20 17:08:00 +0200 | |
|---|---|---|
| committer | 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.gz yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.tar.xz yuzu-2e760a98333520f3de1fa7c7a1f9298fd7241ceb.zip | |
Merge pull request #11748 from liamwhite/kern_1700
kernel: update for 17.0.0
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 | |||
| 76 | } // namespace | 76 | } // namespace |
| 77 | 77 | ||
| 78 | Result SetMemoryPermission(Core::System& system, u64 address, u64 size, MemoryPermission perm) { | 78 | Result SetMemoryPermission(Core::System& system, u64 address, u64 size, MemoryPermission perm) { |
| 79 | LOG_DEBUG(Kernel_SVC, "called, address=0x{:016X}, size=0x{:X}, perm=0x{:08X", address, size, | 79 | LOG_DEBUG(Kernel_SVC, "called, address=0x{:016X}, size=0x{:X}, perm=0x{:08X}", address, size, |
| 80 | perm); | 80 | perm); |
| 81 | 81 | ||
| 82 | // Validate address / size. | 82 | // Validate address / size. |
| @@ -108,10 +108,16 @@ Result SetMemoryAttribute(Core::System& system, u64 address, u64 size, u32 mask, | |||
| 108 | R_UNLESS((address < address + size), ResultInvalidCurrentMemory); | 108 | R_UNLESS((address < address + size), ResultInvalidCurrentMemory); |
| 109 | 109 | ||
| 110 | // Validate the attribute and mask. | 110 | // Validate the attribute and mask. |
| 111 | constexpr u32 SupportedMask = static_cast<u32>(MemoryAttribute::Uncached); | 111 | constexpr u32 SupportedMask = |
| 112 | static_cast<u32>(MemoryAttribute::Uncached | MemoryAttribute::PermissionLocked); | ||
| 112 | R_UNLESS((mask | attr) == mask, ResultInvalidCombination); | 113 | R_UNLESS((mask | attr) == mask, ResultInvalidCombination); |
| 113 | R_UNLESS((mask | attr | SupportedMask) == SupportedMask, ResultInvalidCombination); | 114 | R_UNLESS((mask | attr | SupportedMask) == SupportedMask, ResultInvalidCombination); |
| 114 | 115 | ||
| 116 | // Check that permission locked is either being set or not masked. | ||
| 117 | R_UNLESS((static_cast<Svc::MemoryAttribute>(mask) & Svc::MemoryAttribute::PermissionLocked) == | ||
| 118 | (static_cast<Svc::MemoryAttribute>(attr) & Svc::MemoryAttribute::PermissionLocked), | ||
| 119 | ResultInvalidCombination); | ||
| 120 | |||
| 115 | // Validate that the region is in range for the current process. | 121 | // Validate that the region is in range for the current process. |
| 116 | auto& page_table{GetCurrentProcess(system.Kernel()).GetPageTable()}; | 122 | auto& page_table{GetCurrentProcess(system.Kernel()).GetPageTable()}; |
| 117 | R_UNLESS(page_table.Contains(address, size), ResultInvalidCurrentMemory); | 123 | R_UNLESS(page_table.Contains(address, size), ResultInvalidCurrentMemory); |