Skip to content

Commit 2e0eb48

Browse files
atishp04ardbiesheuvel
authored andcommitted
efi/libstub: Move arm-stub to a common file
Most of the arm-stub code is written in an architecture independent manner. As a result, RISC-V can reuse most of the arm-stub code. Rename the arm-stub.c to efi-stub.c so that ARM, ARM64 and RISC-V can use it. This patch doesn't introduce any functional changes. Signed-off-by: Atish Patra <[email protected]> Reviewed-by: Palmer Dabbelt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent ae83d0b commit 2e0eb48

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ config EFI
19541954
select UCS2_STRING
19551955
select EFI_PARAMS_FROM_FDT
19561956
select EFI_STUB
1957-
select EFI_ARMSTUB
1957+
select EFI_GENERIC_STUB
19581958
select EFI_RUNTIME_WRAPPERS
19591959
---help---
19601960
This option provides support for runtime services provided

arch/arm64/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ config EFI
17851785
select EFI_PARAMS_FROM_FDT
17861786
select EFI_RUNTIME_WRAPPERS
17871787
select EFI_STUB
1788-
select EFI_ARMSTUB
1788+
select EFI_GENERIC_STUB
17891789
default y
17901790
help
17911791
This option provides support for runtime services provided

drivers/firmware/efi/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ config EFI_PARAMS_FROM_FDT
106106
config EFI_RUNTIME_WRAPPERS
107107
bool
108108

109-
config EFI_ARMSTUB
109+
config EFI_GENERIC_STUB
110110
bool
111111

112112
config EFI_ARMSTUB_DTB_LOADER
113113
bool "Enable the DTB loader"
114-
depends on EFI_ARMSTUB
114+
depends on EFI_GENERIC_STUB
115115
default y
116116
help
117117
Select this config option to add support for the dtb= command

drivers/firmware/efi/libstub/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cflags-$(CONFIG_ARM) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \
2323
-fno-builtin -fpic \
2424
$(call cc-option,-mno-single-pic-base)
2525

26-
cflags-$(CONFIG_EFI_ARMSTUB) += -I$(srctree)/scripts/dtc/libfdt
26+
cflags-$(CONFIG_EFI_GENERIC_STUB) += -I$(srctree)/scripts/dtc/libfdt
2727

2828
KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \
2929
-include $(srctree)/drivers/firmware/efi/libstub/hidden.h \
@@ -45,13 +45,13 @@ lib-y := efi-stub-helper.o gop.o secureboot.o tpm.o \
4545
skip_spaces.o lib-cmdline.o lib-ctype.o
4646

4747
# include the stub's generic dependencies from lib/ when building for ARM/arm64
48-
arm-deps-y := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c fdt_empty_tree.c fdt_sw.c
48+
efi-deps-y := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c fdt_empty_tree.c fdt_sw.c
4949

5050
$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
5151
$(call if_changed_rule,cc_o_c)
5252

53-
lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o \
54-
$(patsubst %.c,lib-%.o,$(arm-deps-y))
53+
lib-$(CONFIG_EFI_GENERIC_STUB) += efi-stub.o fdt.o string.o \
54+
$(patsubst %.c,lib-%.o,$(efi-deps-y))
5555

5656
lib-$(CONFIG_ARM) += arm32-stub.o
5757
lib-$(CONFIG_ARM64) += arm64-stub.o
@@ -73,8 +73,8 @@ CFLAGS_arm64-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
7373
# a verification pass to see if any absolute relocations exist in any of the
7474
# object files.
7575
#
76-
extra-$(CONFIG_EFI_ARMSTUB) := $(lib-y)
77-
lib-$(CONFIG_EFI_ARMSTUB) := $(patsubst %.o,%.stub.o,$(lib-y))
76+
extra-$(CONFIG_EFI_GENERIC_STUB) := $(lib-y)
77+
lib-$(CONFIG_EFI_GENERIC_STUB) := $(patsubst %.o,%.stub.o,$(lib-y))
7878

7979
STUBCOPY_FLAGS-$(CONFIG_ARM64) += --prefix-alloc-sections=.init \
8080
--prefix-symbols=__efistub_

0 commit comments

Comments
 (0)