[PATCH 3/3] openrisc: implement sync_caches_for_execution
Ahmad Fatoum
a.fatoum at barebox.org
Wed Aug 6 06:24:55 PDT 2025
Implement sync_caches_for_execution to allow future use in generic code.
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
arch/openrisc/cpu/cache.c | 6 ++++++
arch/openrisc/include/asm/cache.h | 3 +++
2 files changed, 9 insertions(+)
diff --git a/arch/openrisc/cpu/cache.c b/arch/openrisc/cpu/cache.c
index a124d6612c69..0246cd36a423 100644
--- a/arch/openrisc/cpu/cache.c
+++ b/arch/openrisc/cpu/cache.c
@@ -149,3 +149,9 @@ static int cache_init(void)
}
core_initcall(cache_init);
+
+void sync_caches_for_execution(void)
+{
+ flush_dcache_range(0, checkdcache());
+ invalidate_icache_range(0, checkicache());
+}
diff --git a/arch/openrisc/include/asm/cache.h b/arch/openrisc/include/asm/cache.h
index 4bba6923b1e8..27b21dce30cb 100644
--- a/arch/openrisc/include/asm/cache.h
+++ b/arch/openrisc/include/asm/cache.h
@@ -30,4 +30,7 @@ void dcache_disable(void);
void icache_enable(void);
void icache_disable(void);
+#define sync_caches_for_execution sync_caches_for_execution
+void sync_caches_for_execution(void);
+
#endif /* __ASM_OPENRISC_CACHE_H_ */
--
2.39.5
More information about the barebox
mailing list