From d22159ce97c880a18bfb707b49f6eead0d05f1af 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 54c6c2c0e..45f2ce4dc 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp @@ -85,7 +85,7 @@ namespace ams::kern::arch::arm64::cpu { public: enum class Operation { Idle, - InvalidateInstructionCache, + InstructionMemoryBarrier, StoreDataCache, FlushDataCache, }; @@ -156,7 +156,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); @@ -282,7 +282,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: @@ -419,8 +419,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(); } @@ -432,8 +432,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 4d7a1c677..20e49c872 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();