From 3ec9a9e59fe161ba9f1082cb5964b1476d58cae4 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 3 Aug 2020 18:52:51 -0700 Subject: [PATCH] kern: rename CacheHelper operation for accuracy --- .../libmesosphere/source/arch/arm64/kern_cpu.cpp | 14 +++++++------- .../source/kern_k_page_table_base.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp b/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp index 8b53899c0..dd39f3b84 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp @@ -88,7 +88,7 @@ namespace ams::kern::arch::arm64::cpu { public: enum class Operation { Idle, - InvalidateInstructionCache, + InstructionMemoryBarrier, StoreDataCache, FlushDataCache, }; @@ -160,7 +160,7 @@ namespace ams::kern::arch::arm64::cpu { constexpr u64 AllCoresMask = (1ul << cpu::NumCores) - 1ul; const u64 other_cores_mask = AllCoresMask & ~(1ul << GetCurrentCoreId()); - if ((op == Operation::InvalidateInstructionCache) || (Kernel::GetState() == Kernel::State::Initializing)) { + if ((op == Operation::InstructionMemoryBarrier) || (Kernel::GetState() == Kernel::State::Initializing)) { /* Check that there's no on-going operation. */ MESOSPHERE_ABORT_UNLESS(this->operation == Operation::Idle); MESOSPHERE_ABORT_UNLESS(this->target_cores == 0); @@ -286,7 +286,7 @@ namespace ams::kern::arch::arm64::cpu { switch (this->operation) { case Operation::Idle: break; - case Operation::InvalidateInstructionCache: + case Operation::InstructionMemoryBarrier: InstructionMemoryBarrier(); break; case Operation::StoreDataCache: @@ -423,8 +423,8 @@ namespace ams::kern::arch::arm64::cpu { R_TRY(InvalidateInstructionCacheRange(start, end)); - /* Request the interrupt helper to invalidate, too. */ - g_cache_operation_handler.RequestOperation(KCacheHelperInterruptHandler::Operation::InvalidateInstructionCache); + /* Request the interrupt helper to perform an instruction memory barrier. */ + g_cache_operation_handler.RequestOperation(KCacheHelperInterruptHandler::Operation::InstructionMemoryBarrier); return ResultSuccess(); } @@ -436,8 +436,8 @@ namespace ams::kern::arch::arm64::cpu { InvalidateEntireInstructionCacheGlobalImpl(); EnsureInstructionConsistency(); - /* Request the interrupt helper to invalidate, too. */ - g_cache_operation_handler.RequestOperation(KCacheHelperInterruptHandler::Operation::InvalidateInstructionCache); + /* Request the interrupt helper to perform an instruction memory barrier. */ + g_cache_operation_handler.RequestOperation(KCacheHelperInterruptHandler::Operation::InstructionMemoryBarrier); } void InitializeInterruptThreads(s32 core_id) { diff --git a/libraries/libmesosphere/source/kern_k_page_table_base.cpp b/libraries/libmesosphere/source/kern_k_page_table_base.cpp index 75e11a70e..fbf60dd66 100644 --- a/libraries/libmesosphere/source/kern_k_page_table_base.cpp +++ b/libraries/libmesosphere/source/kern_k_page_table_base.cpp @@ -2167,7 +2167,7 @@ namespace ams::kern { /* Copy remaining data. */ if (cur_size > 0) { R_UNLESS(UserspaceAccess::CopyMemoryFromUser(GetVoidPointer(GetLinearMappedVirtualAddress(cur_addr)), buffer, cur_size), svc::ResultInvalidCurrentMemory()); - cpu::StoreDataCache(GetVoidPointer(GetLinearMappedVirtualAddress(cur_addr)), copy_size); + cpu::StoreDataCache(GetVoidPointer(GetLinearMappedVirtualAddress(cur_addr)), cur_size); } return ResultSuccess();