Skip to content

Commit 6e7c5d9

Browse files
authored
[libcpu/aarch64] fix cache invalidate operation (#7363)
1 parent c34608b commit 6e7c5d9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

components/mm/mm_page.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ static void _install_page(rt_page_t mpr_head, rt_region_t region, void *insert_h
679679
shadow.start = region.start & ~shadow_mask;
680680
shadow.end = FLOOR(region.end, shadow_mask + 1);
681681

682-
if (shadow.end > UINT32_MAX)
682+
if (shadow.end + PV_OFFSET > UINT32_MAX)
683683
_high_page_configured = 1;
684684

685685
rt_page_t shad_head = addr_to_page(mpr_head, (void *)shadow.start);

libcpu/aarch64/common/cache.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ void rt_hw_cpu_dcache_invalidate(void *start_addr, unsigned long size);
2323

2424
static inline void rt_hw_icache_invalidate_all(void)
2525
{
26-
/* wait for any modification complete */
26+
/* wait for previous modification to complete */
2727
__asm__ volatile ("dsb ishst");
28-
__asm__ volatile ("ic iallu");
28+
29+
__asm__ volatile ("ic ialluis");
30+
/* wait for ic to retire */
31+
__asm__ volatile ("dsb nsh");
32+
/* flush instruction pipeline */
2933
__asm__ volatile ("isb");
3034
}
3135

0 commit comments

Comments
 (0)