From 1b95674c5e86af9def33e7d8f5651b53f49e0420 Mon Sep 17 00:00:00 2001 From: TunaCici <36923239+TunaCici@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:28:15 +0300 Subject: [PATCH] arch: Added some MMU cache maintenance functions for ARM64. Signed-off-by: TunaCici <36923239+TunaCici@users.noreply.github.com> --- Kernel/Arch/ARM64/Machine.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Kernel/Arch/ARM64/Machine.h b/Kernel/Arch/ARM64/Machine.h index 3809d59..73e5233 100644 --- a/Kernel/Arch/ARM64/Machine.h +++ b/Kernel/Arch/ARM64/Machine.h @@ -15,11 +15,16 @@ static inline void wfi(void) asm volatile("wfi" ::: "memory"); } -static inline void dsb(void) +static inline void dsb_sy(void) { asm volatile("dsb sy" ::: "memory"); } +static inline void dsb_ish(void) +{ + asm volatile("dsb ish" ::: "memory"); +} + static inline void dsb_ishst(void) { asm volatile("dsb ishst" ::: "memory"); @@ -92,3 +97,18 @@ static inline void fiq_disable(void) asm volatile("msr " reg ",%x0" :: "r" (_v));\ }while(0) +/* + * MMU Cache Maintenance operations + * + * Ref: developer.arm.com/documentation/den0024/a/Caches/Cache-maintenance + */ + +static inline void ic_ialluis() +{ + asm("IC IALLUIS" ::: "memory"); +} + +static inline void tlbi_vmalle1() +{ + asm("TLBI VMALLE1" ::: "memory"); +}