mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 07/30] asm-generic: move sync_caches_for_execution declaration to <asm/cache.h>
Date: Mon, 22 Nov 2021 09:47:09 +0100
Message-ID: <20211122084732.2597109-8-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20211122084732.2597109-1-a.fatoum@pengutronix.de>

We have three architectures defining sync_caches_for_execution(). Have
them all do so in a header of the same name to allow using it in common
code later on, like in an EFI image loading routine.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/include/asm/cache.h                     | 3 +++
 arch/kvx/include/asm/cache.h                     | 3 +++
 arch/riscv/include/asm/barebox-riscv.h           | 3 +--
 arch/riscv/include/asm/{cacheflush.h => cache.h} | 9 +++++++--
 arch/riscv/lib/reloc.c                           | 2 +-
 include/asm-generic/cache.h                      | 9 +++++++++
 6 files changed, 24 insertions(+), 5 deletions(-)
 rename arch/riscv/include/asm/{cacheflush.h => cache.h} (59%)
 create mode 100644 include/asm-generic/cache.h

diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
index bf3a1a0ed291..9ebe80dc89bc 100644
--- a/arch/arm/include/asm/cache.h
+++ b/arch/arm/include/asm/cache.h
@@ -21,6 +21,9 @@ int arm_set_cache_functions(void);
 void arm_early_mmu_cache_flush(void);
 void arm_early_mmu_cache_invalidate(void);
 
+#define sync_caches_for_execution sync_caches_for_execution
 void sync_caches_for_execution(void);
 
+#include <asm-generic/cache.h>
+
 #endif
diff --git a/arch/kvx/include/asm/cache.h b/arch/kvx/include/asm/cache.h
index 0bf3c8f06ef5..72de5d804faa 100644
--- a/arch/kvx/include/asm/cache.h
+++ b/arch/kvx/include/asm/cache.h
@@ -10,6 +10,7 @@
 
 void invalidate_dcache_range(unsigned long addr, unsigned long stop);
 
+#define sync_caches_for_execution sync_caches_for_execution
 static inline void sync_caches_for_execution(void)
 {
 	__builtin_kvx_fence();
@@ -28,4 +29,6 @@ static inline void dcache_inval(void)
 	__builtin_kvx_dinval();
 }
 
+#include <asm-generic/cache.h>
+
 #endif /* __KVX_CACHE_H */
diff --git a/arch/riscv/include/asm/barebox-riscv.h b/arch/riscv/include/asm/barebox-riscv.h
index abb320242769..5c87d37c9eb8 100644
--- a/arch/riscv/include/asm/barebox-riscv.h
+++ b/arch/riscv/include/asm/barebox-riscv.h
@@ -20,6 +20,7 @@
 #include <asm/sections.h>
 #include <asm/barebox-riscv-head.h>
 #include <asm/system.h>
+#include <asm/cache.h>
 
 unsigned long get_runtime_offset(void);
 
@@ -27,8 +28,6 @@ void setup_c(void);
 void relocate_to_current_adr(void);
 void relocate_to_adr(unsigned long target);
 
-void sync_caches_for_execution(void);
-
 void __noreturn __naked barebox_riscv_entry(unsigned long membase, unsigned long memsize,
 					    void *boarddata, unsigned int flags);
 
diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cache.h
similarity index 59%
rename from arch/riscv/include/asm/cacheflush.h
rename to arch/riscv/include/asm/cache.h
index 9ff25740c66b..9a0b9326b22d 100644
--- a/arch/riscv/include/asm/cacheflush.h
+++ b/arch/riscv/include/asm/cache.h
@@ -3,8 +3,8 @@
  * Copyright (C) 2015 Regents of the University of California
  */
 
-#ifndef _ASM_RISCV_CACHEFLUSH_H
-#define _ASM_RISCV_CACHEFLUSH_H
+#ifndef _ASM_RISCV_CACHE_H
+#define _ASM_RISCV_CACHE_H
 
 static inline void local_flush_icache_all(void)
 {
@@ -13,4 +13,9 @@ static inline void local_flush_icache_all(void)
 #endif
 }
 
+#define sync_caches_for_execution sync_caches_for_execution
+void sync_caches_for_execution(void);
+
+#include <asm-generic/cache.h>
+
 #endif /* _ASM_RISCV_CACHEFLUSH_H */
diff --git a/arch/riscv/lib/reloc.c b/arch/riscv/lib/reloc.c
index 479d586afdee..da53c50448d7 100644
--- a/arch/riscv/lib/reloc.c
+++ b/arch/riscv/lib/reloc.c
@@ -5,7 +5,7 @@
 #include <linux/linkage.h>
 #include <asm/sections.h>
 #include <asm/barebox-riscv.h>
-#include <asm/cacheflush.h>
+#include <asm/cache.h>
 #include <debug_ll.h>
 #include <asm-generic/module.h>
 
diff --git a/include/asm-generic/cache.h b/include/asm-generic/cache.h
new file mode 100644
index 000000000000..a766d835fdd7
--- /dev/null
+++ b/include/asm-generic/cache.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __ASM_GENERIC_CACHE_H_
+
+#ifndef sync_caches_for_execution
+#define sync_caches_for_execution() (void)0
+#endif
+
+#endif
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2021-11-22  8:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22  8:47 [PATCH 00/30] efi: refactor for upcoming loader support Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 01/30] fs: remove useless AT_FDCWD references Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 02/30] fs: remove unused struct node_d in struct dir Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 03/30] block : efi: rename driver variable from efi_fs_driver to efi_bio_driver Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 04/30] include: <linux/types.h>: wrap in #ifndef __ASSEMBLY__ Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 05/30] hw_random: stm32: propagate error codes from rng read Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 06/30] efi: align LOAD_FILE_PROTOCOL_GUID's name with other PROTOCOL_GUIDs Ahmad Fatoum
2021-11-22  8:47 ` Ahmad Fatoum [this message]
2021-11-22  8:47 ` [PATCH 08/30] common: move EFI code into new efi/ top level directory Ahmad Fatoum
2021-11-23  8:55   ` Jules Maselbas
2021-11-22  8:47 ` [PATCH 09/30] serial: efi-stdio: move efi-stdio.h header to central location Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 10/30] efi: use SPDX-License-Identifier where appropriate Ahmad Fatoum
2021-11-23  8:52   ` Jules Maselbas
2021-11-22  8:47 ` [PATCH 11/30] drivers: efi: move Kconfig options to new menu Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 12/30] efi: factor out errno translation Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 13/30] efi: rename <efi/efi.h> to <efi/efi-payload.h> Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 14/30] efi: centralize efivarfs_parse_filename Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 15/30] kbuild: force 16-bit wchar_t treewide Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 16/30] include: <linux/nls.h>: remove duplicate wchar_t typedef Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 17/30] lib: wchar: add wctomb and mbtowc Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 18/30] lib: implement wcsnlen Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 19/30] vsprintf: add optional support for %ls format modifier Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 20/30] libfile: null-terminate read_file of wchar_t buffer Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 21/30] commands: echo: add wide file output via wecho alias Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 22/30] efi: make efi_main __noreturn Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 23/30] efi: define and use new EFI_ERROR_MASK macro Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 24/30] common: move CONFIG_ELF into General Settings Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 25/30] efi: don't zero executable buffer before freeing Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 26/30] partitions: efi: move header to central location Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 27/30] efi: print early efi_main string on CONFIG_DEBUG_LL=y Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 28/30] ARM64: board-dt-2nd: remove no longer needed noinline function split Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 29/30] bus: acpi: register bus even if without ACPI EFI table Ahmad Fatoum
2021-11-22  8:47 ` [PATCH 30/30] efi: guid: fix typos Ahmad Fatoum
2021-11-25  7:44 ` [PATCH 00/30] efi: refactor for upcoming loader support 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=20211122084732.2597109-8-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --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

mail archive of the barebox mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.barebox.org/barebox/0 barebox/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 barebox barebox/ https://lore.barebox.org/barebox \
		barebox@lists.infradead.org barebox@lists.infradead.org
	public-inbox-index barebox

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git