mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 3/3] openrisc: implement sync_caches_for_execution
Date: Wed,  6 Aug 2025 15:24:55 +0200	[thread overview]
Message-ID: <20250806132455.2827813-3-a.fatoum@barebox.org> (raw)
In-Reply-To: <20250806132455.2827813-1-a.fatoum@barebox.org>

Implement sync_caches_for_execution to allow future use in generic code.

Signed-off-by: Ahmad Fatoum <a.fatoum@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




  parent reply	other threads:[~2025-08-06 13:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 13:24 [PATCH 1/3] ppc: " Ahmad Fatoum
2025-08-06 13:24 ` [PATCH 2/3] MIPS: " Ahmad Fatoum
2025-08-06 13:24 ` Ahmad Fatoum [this message]
2025-08-07  7:28 ` [PATCH 1/3] ppc: " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250806132455.2827813-3-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox