diff options
| author | Shell <[email protected]> | 2023-04-26 17:17:42 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-26 17:17:42 +0800 |
| commit | 6e7c5d9bc9f9b5491bd9edd702d20867a92b5ec5 (patch) | |
| tree | 791723824196a832734e9d5619121ecfb48d3850 /libcpu | |
| parent | c34608b4a93256d57bf55f0bef6190e3a871fe7f (diff) | |
[libcpu/aarch64] fix cache invalidate operation (#7363)
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/aarch64/common/cache.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libcpu/aarch64/common/cache.h b/libcpu/aarch64/common/cache.h index 06a2805c48..ef7b235d0e 100644 --- a/libcpu/aarch64/common/cache.h +++ b/libcpu/aarch64/common/cache.h @@ -23,9 +23,13 @@ void rt_hw_cpu_dcache_invalidate(void *start_addr, unsigned long size); static inline void rt_hw_icache_invalidate_all(void) { - /* wait for any modification complete */ + /* wait for previous modification to complete */ __asm__ volatile ("dsb ishst"); - __asm__ volatile ("ic iallu"); + + __asm__ volatile ("ic ialluis"); + /* wait for ic to retire */ + __asm__ volatile ("dsb nsh"); + /* flush instruction pipeline */ __asm__ volatile ("isb"); } |
