diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/k_page_table.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp index 73d96de42..fab55a057 100644 --- a/src/core/hle/kernel/k_page_table.cpp +++ b/src/core/hle/kernel/k_page_table.cpp | |||
| @@ -79,10 +79,6 @@ public: | |||
| 79 | } | 79 | } |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | } // namespace | ||
| 83 | |||
| 84 | namespace { | ||
| 85 | |||
| 86 | using namespace Common::Literals; | 82 | using namespace Common::Literals; |
| 87 | 83 | ||
| 88 | constexpr size_t GetAddressSpaceWidthFromType(FileSys::ProgramAddressSpaceType as_type) { | 84 | constexpr size_t GetAddressSpaceWidthFromType(FileSys::ProgramAddressSpaceType as_type) { |
| @@ -784,10 +780,9 @@ Result KPageTable::SetupForIpcClient(PageLinkedList* page_list, size_t* out_bloc | |||
| 784 | R_UNLESS(this->Contains(address, size), ResultInvalidCurrentMemory); | 780 | R_UNLESS(this->Contains(address, size), ResultInvalidCurrentMemory); |
| 785 | 781 | ||
| 786 | // Get the source permission. | 782 | // Get the source permission. |
| 787 | const auto src_perm = static_cast<KMemoryPermission>( | 783 | const auto src_perm = (test_perm == KMemoryPermission::UserReadWrite) |
| 788 | (test_perm == KMemoryPermission::UserReadWrite) | 784 | ? KMemoryPermission::KernelReadWrite | KMemoryPermission::NotMapped |
| 789 | ? KMemoryPermission::KernelReadWrite | KMemoryPermission::NotMapped | 785 | : KMemoryPermission::UserRead; |
| 790 | : KMemoryPermission::UserRead); | ||
| 791 | 786 | ||
| 792 | // Get aligned extents. | 787 | // Get aligned extents. |
| 793 | const VAddr aligned_src_start = Common::AlignDown((address), PageSize); | 788 | const VAddr aligned_src_start = Common::AlignDown((address), PageSize); |
| @@ -1162,10 +1157,9 @@ Result KPageTable::SetupForIpc(VAddr* out_dst_addr, size_t size, VAddr src_addr, | |||
| 1162 | const size_t src_map_size = src_map_end - src_map_start; | 1157 | const size_t src_map_size = src_map_end - src_map_start; |
| 1163 | 1158 | ||
| 1164 | // Ensure that we clean up appropriately if we fail after this. | 1159 | // Ensure that we clean up appropriately if we fail after this. |
| 1165 | const auto src_perm = static_cast<KMemoryPermission>( | 1160 | const auto src_perm = (test_perm == KMemoryPermission::UserReadWrite) |
| 1166 | (test_perm == KMemoryPermission::UserReadWrite) | 1161 | ? KMemoryPermission::KernelReadWrite | KMemoryPermission::NotMapped |
| 1167 | ? KMemoryPermission::KernelReadWrite | KMemoryPermission::NotMapped | 1162 | : KMemoryPermission::UserRead; |
| 1168 | : KMemoryPermission::UserRead); | ||
| 1169 | ON_RESULT_FAILURE { | 1163 | ON_RESULT_FAILURE { |
| 1170 | if (src_map_end > src_map_start) { | 1164 | if (src_map_end > src_map_start) { |
| 1171 | src_page_table.CleanupForIpcClientOnServerSetupFailure( | 1165 | src_page_table.CleanupForIpcClientOnServerSetupFailure( |
| @@ -2735,8 +2729,7 @@ Result KPageTable::LockForIpcUserBuffer(PAddr* out, VAddr address, size_t size) | |||
| 2735 | nullptr, out, address, size, KMemoryState::FlagCanIpcUserBuffer, | 2729 | nullptr, out, address, size, KMemoryState::FlagCanIpcUserBuffer, |
| 2736 | KMemoryState::FlagCanIpcUserBuffer, KMemoryPermission::All, | 2730 | KMemoryState::FlagCanIpcUserBuffer, KMemoryPermission::All, |
| 2737 | KMemoryPermission::UserReadWrite, KMemoryAttribute::All, KMemoryAttribute::None, | 2731 | KMemoryPermission::UserReadWrite, KMemoryAttribute::All, KMemoryAttribute::None, |
| 2738 | static_cast<KMemoryPermission>(KMemoryPermission::NotMapped | | 2732 | KMemoryPermission::NotMapped | KMemoryPermission::KernelReadWrite, |
| 2739 | KMemoryPermission::KernelReadWrite), | ||
| 2740 | KMemoryAttribute::Locked)); | 2733 | KMemoryAttribute::Locked)); |
| 2741 | } | 2734 | } |
| 2742 | 2735 | ||
| @@ -2752,9 +2745,7 @@ Result KPageTable::LockForCodeMemory(KPageGroup* out, VAddr addr, size_t size) { | |||
| 2752 | R_RETURN(this->LockMemoryAndOpen( | 2745 | R_RETURN(this->LockMemoryAndOpen( |
| 2753 | out, nullptr, addr, size, KMemoryState::FlagCanCodeMemory, KMemoryState::FlagCanCodeMemory, | 2746 | out, nullptr, addr, size, KMemoryState::FlagCanCodeMemory, KMemoryState::FlagCanCodeMemory, |
| 2754 | KMemoryPermission::All, KMemoryPermission::UserReadWrite, KMemoryAttribute::All, | 2747 | KMemoryPermission::All, KMemoryPermission::UserReadWrite, KMemoryAttribute::All, |
| 2755 | KMemoryAttribute::None, | 2748 | KMemoryAttribute::None, KMemoryPermission::NotMapped | KMemoryPermission::KernelReadWrite, |
| 2756 | static_cast<KMemoryPermission>(KMemoryPermission::NotMapped | | ||
| 2757 | KMemoryPermission::KernelReadWrite), | ||
| 2758 | KMemoryAttribute::Locked)); | 2749 | KMemoryAttribute::Locked)); |
| 2759 | } | 2750 | } |
| 2760 | 2751 | ||