diff --git a/.gitignore b/.gitignore index af9bf749c4..418bdfaebf 100644 --- a/.gitignore +++ b/.gitignore @@ -275,6 +275,7 @@ xen/arch/x86/efi/mkreloc xen/arch/x86/include/asm/asm-macros.h xen/arch/*/xen.lds xen/arch/*/efi/boot.c +xen/arch/*/efi/common-stub.c xen/arch/*/efi/compat.c xen/arch/*/efi/ebmalloc.c xen/arch/*/efi/efi.h diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile index bd954a3b2d..2459cbae3a 100644 --- a/xen/arch/arm/efi/Makefile +++ b/xen/arch/arm/efi/Makefile @@ -4,11 +4,7 @@ ifeq ($(CONFIG_ARM_EFI),y) obj-y += $(EFIOBJ-y) obj-$(CONFIG_ACPI) += efi-dom0.init.o else -# Add stub.o to EFIOBJ-y to re-use the clean-files in -# efi-common.mk. Otherwise the link of stub.c in arm/efi -# will not be cleaned in "make clean". -EFIOBJ-y += stub.o -obj-y += stub.o +obj-y += common-stub.o $(obj)/stub.o: CFLAGS-y += -fno-short-wchar diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile index 034ec87895..24dfecfad1 100644 --- a/xen/arch/x86/efi/Makefile +++ b/xen/arch/x86/efi/Makefile @@ -11,7 +11,7 @@ $(obj)/boot.init.o: $(obj)/buildid.o $(call cc-option-add,cflags-stack-boundary,CC,-mpreferred-stack-boundary=4) $(addprefix $(obj)/,$(EFIOBJ-y)): CFLAGS_stack_boundary := $(cflags-stack-boundary) -obj-y := stub.o +obj-y := common-stub.o stub.o obj-$(XEN_BUILD_EFI) := $(filter-out %.init.o,$(EFIOBJ-y)) obj-bin-$(XEN_BUILD_EFI) := $(filter %.init.o,$(EFIOBJ-y)) extra-$(XEN_BUILD_EFI) += buildid.o relocs-dummy.o diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub.c index f2365bc041..2cd5c8d4dc 100644 --- a/xen/arch/x86/efi/stub.c +++ b/xen/arch/x86/efi/stub.c @@ -8,7 +8,6 @@ #include #include #include -#include "../../../common/efi/stub.c" /* * Here we are in EFI stub. EFI calls are not supported due to lack @@ -55,9 +54,3 @@ bool efi_boot_mem_unused(unsigned long *start, unsigned long *end) } void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { } - -int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *) - __attribute__((__alias__("efi_get_info"))); - -int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *) - __attribute__((__alias__("efi_runtime_call"))); diff --git a/xen/common/efi/stub.c b/xen/common/efi/common-stub.c similarity index 64% rename from xen/common/efi/stub.c rename to xen/common/efi/common-stub.c index 15694632c2..5a91fe28cc 100644 --- a/xen/common/efi/stub.c +++ b/xen/common/efi/common-stub.c @@ -30,3 +30,13 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op) { return -ENOSYS; } + +#ifdef CONFIG_COMPAT + +int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *) + __attribute__((__alias__("efi_get_info"))); + +int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *) + __attribute__((__alias__("efi_runtime_call"))); + +#endif diff --git a/xen/common/efi/efi-common.mk b/xen/common/efi/efi-common.mk index ec2c34f198..53fdb81583 100644 --- a/xen/common/efi/efi-common.mk +++ b/xen/common/efi/efi-common.mk @@ -9,9 +9,9 @@ CFLAGS-y += -iquote $(srcdir) # e.g.: It transforms "dir/foo/bar" into successively # "dir foo bar", ".. .. ..", "../../.." $(obj)/%.c: $(srctree)/common/efi/%.c FORCE - $(Q)test -f $@ || \ - ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, ,$(obj))))/source/common/efi/$(