[PATCH v2] arm: Select the TLB invalidate based on the core's Id variant.

chrisj at rtems.org chrisj at rtems.org
Sat Jun 29 22:36:53 UTC 2019


From: Chris Johns <chrisj at rtems.org>

Closes #3760
---
 bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c b/bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c
index c2be0f566e..8eb4772603 100644
--- a/bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c
+++ b/bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c
@@ -65,12 +65,16 @@ static uint32_t set_translation_table_entries(
 
   for ( i = istart; i != iend; i = (i + 1U) & index_mask ) {
     void *mva = (void *) (i << ARM_MMU_SECT_BASE_SHIFT);
-    #if defined(__ARM_ARCH_7A__)
-    arm_cp15_tlb_invalidate_entry_all_asids(mva);
-    #else
-    arm_cp15_tlb_instruction_invalidate_entry(mva);
-    arm_cp15_tlb_data_invalidate_entry(mva);
-    #endif
+#if defined(__ARM_ARCH_7A__)
+    if (arm_cp15_get_multiprocessor_affinity() & (1 << 30) == 0) {
+      arm_cp15_tlb_invalidate_entry_all_asids(mva);
+    }
+    else
+#endif
+    {
+      arm_cp15_tlb_instruction_invalidate_entry(mva);
+      arm_cp15_tlb_data_invalidate_entry(mva);
+    }
   }
 
   _ARM_Data_synchronization_barrier();
-- 
2.20.1 (Apple Git-117)



More information about the devel mailing list