mbox series

[0/3] cmd: avoid duplicate weak functions

Message ID 20240616173105.7430-1-heinrich.schuchardt@canonical.com
Headers show
Series cmd: avoid duplicate weak functions | expand

Message

Heinrich Schuchardt June 16, 2024, 5:31 p.m. UTC
If we have multiple weak implementations of functions, the linker might
choose any of these.

ARM and RISC-V already provide a weak implementation of flush_dcache_all()
but cmd/cache.c provides another implementation. Add an #ifdef to avoid
the duplication.

The EFI sub-systems uses invalidate_icache_all() after loading binaries.
Both the EFI sub-system and cmd/cache.c provide a weak
invalidate_icache_all() function. Remove the EFI instance.

For ARM11 functional implementation of invalidate_icache_all is missing.
Add it.

Heinrich Schuchardt (3):
  cmd: avoid duplicate weak flush_dcache_all()
  arm: implement invalidate_icache_all on ARM11
  efi_loader: avoid duplicate weak invalidate_icache_all()

 arch/arm/cpu/arm11/cpu.c          | 12 ++++++++++++
 cmd/cache.c                       |  3 +++
 lib/efi_loader/efi_image_loader.c | 13 +++++++------
 lib/efi_loader/efi_runtime.c      |  7 ++++++-
 4 files changed, 28 insertions(+), 7 deletions(-)

Comments

Tom Rini July 3, 2024, 11:22 p.m. UTC | #1
On Sun, 16 Jun 2024 19:31:02 +0200, Heinrich Schuchardt wrote:

> If we have multiple weak implementations of functions, the linker might
> choose any of these.
> 
> ARM and RISC-V already provide a weak implementation of flush_dcache_all()
> but cmd/cache.c provides another implementation. Add an #ifdef to avoid
> the duplication.
> 
> [...]

Applied to u-boot/master, thanks!