diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu.hpp index c8b898f1b..689859f99 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu.hpp @@ -152,7 +152,6 @@ namespace ams::kern::arch::arm64::cpu { ALWAYS_INLINE bool CanAccessAtomic(KProcessAddress addr, bool privileged = false) { const uintptr_t va = GetInteger(addr); - u64 phys_addr; if (privileged) { __asm__ __volatile__("at s1e1w, %[va]" :: [va]"r"(va) : "memory"); } else { @@ -166,7 +165,7 @@ namespace ams::kern::arch::arm64::cpu { return false; } - return (par >> BITSIZEOF(par) - BITSIZEOF(u8)) == 0xFF; + return (par >> (BITSIZEOF(par) - BITSIZEOF(u8))) == 0xFF; } /* Synchronization helpers. */ diff --git a/libraries/libmesosphere/source/kern_k_page_table_base.cpp b/libraries/libmesosphere/source/kern_k_page_table_base.cpp index 13fb231d8..8062ce54a 100644 --- a/libraries/libmesosphere/source/kern_k_page_table_base.cpp +++ b/libraries/libmesosphere/source/kern_k_page_table_base.cpp @@ -2322,7 +2322,7 @@ namespace ams::kern { } /* Get the implementation. */ - auto &impl = this->GetImpl(); + auto &src_impl = src_page_table.GetImpl(); /* Get the page properties for any mapping we'll be doing. */ const KPageProperties dst_map_properties = { test_perm, false, false, false }; @@ -2333,7 +2333,7 @@ namespace ams::kern { /* Begin traversal. */ TraversalContext context; TraversalEntry next_entry; - bool traverse_valid = impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), aligned_src_start); + bool traverse_valid = src_impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), aligned_src_start); MESOSPHERE_ASSERT(traverse_valid); /* Prepare tracking variables. */ @@ -2374,7 +2374,7 @@ namespace ams::kern { /* If the block's size was one page, we may need to continue traversal. */ if (cur_block_size == 0 && aligned_src_size > PageSize) { - traverse_valid = impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); + traverse_valid = src_impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); MESOSPHERE_ASSERT(traverse_valid); cur_block_addr = next_entry.phys_addr; @@ -2386,7 +2386,7 @@ namespace ams::kern { /* Map the remaining pages. */ while (aligned_src_start + tot_block_size < mapping_src_end) { /* Continue the traversal. */ - traverse_valid = impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); + traverse_valid = src_impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); MESOSPHERE_ASSERT(traverse_valid); /* Process the block. */ @@ -2415,7 +2415,7 @@ namespace ams::kern { cur_mapped_addr += last_block_size; cur_block_addr += last_block_size; if (mapped_block_end + cur_block_size < aligned_src_end && cur_block_size == last_block_size) { - traverse_valid = impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); + traverse_valid = src_impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); MESOSPHERE_ASSERT(traverse_valid); cur_block_addr = next_entry.phys_addr;