diff options
| -rw-r--r-- | arch/x86/boot/compressed/Makefile | 3 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/eboot.c | 8 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/eboot.h | 16 | ||||
| -rw-r--r-- | arch/x86/include/asm/efi.h | 24 | ||||
| -rw-r--r-- | drivers/firmware/efi/Makefile | 2 |
5 files changed, 31 insertions, 22 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 704f58aa79cd..20db5b3609de 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
| @@ -35,7 +35,8 @@ vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o | |||
| 35 | 35 | ||
| 36 | $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone | 36 | $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone |
| 37 | 37 | ||
| 38 | vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o | 38 | vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o \ |
| 39 | $(objtree)/drivers/firmware/efi/libstub/lib.a | ||
| 39 | 40 | ||
| 40 | $(obj)/vmlinux: $(vmlinux-objs-y) FORCE | 41 | $(obj)/vmlinux: $(vmlinux-objs-y) FORCE |
| 41 | $(call if_changed,ld) | 42 | $(call if_changed,ld) |
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index 1acf605a646d..92b9a5f2aed6 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
| @@ -21,8 +21,10 @@ static efi_system_table_t *sys_table; | |||
| 21 | 21 | ||
| 22 | static struct efi_config *efi_early; | 22 | static struct efi_config *efi_early; |
| 23 | 23 | ||
| 24 | #define efi_call_early(f, ...) \ | 24 | __pure const struct efi_config *__efi_early(void) |
| 25 | efi_early->call(efi_early->f, __VA_ARGS__); | 25 | { |
| 26 | return efi_early; | ||
| 27 | } | ||
| 26 | 28 | ||
| 27 | #define BOOT_SERVICES(bits) \ | 29 | #define BOOT_SERVICES(bits) \ |
| 28 | static void setup_boot_services##bits(struct efi_config *c) \ | 30 | static void setup_boot_services##bits(struct efi_config *c) \ |
| @@ -285,8 +287,6 @@ void efi_char16_printk(efi_system_table_t *table, efi_char16_t *str) | |||
| 285 | } | 287 | } |
| 286 | } | 288 | } |
| 287 | 289 | ||
| 288 | #include "../../../../drivers/firmware/efi/libstub/efi-stub-helper.c" | ||
| 289 | |||
| 290 | static void find_bits(unsigned long mask, u8 *pos, u8 *size) | 290 | static void find_bits(unsigned long mask, u8 *pos, u8 *size) |
| 291 | { | 291 | { |
| 292 | u8 first, len; | 292 | u8 first, len; |
diff --git a/arch/x86/boot/compressed/eboot.h b/arch/x86/boot/compressed/eboot.h index c88c31ecad12..d487e727f1ec 100644 --- a/arch/x86/boot/compressed/eboot.h +++ b/arch/x86/boot/compressed/eboot.h | |||
| @@ -103,20 +103,4 @@ struct efi_uga_draw_protocol { | |||
| 103 | void *blt; | 103 | void *blt; |
| 104 | }; | 104 | }; |
| 105 | 105 | ||
| 106 | struct efi_config { | ||
| 107 | u64 image_handle; | ||
| 108 | u64 table; | ||
| 109 | u64 allocate_pool; | ||
| 110 | u64 allocate_pages; | ||
| 111 | u64 get_memory_map; | ||
| 112 | u64 free_pool; | ||
| 113 | u64 free_pages; | ||
| 114 | u64 locate_handle; | ||
| 115 | u64 handle_protocol; | ||
| 116 | u64 exit_boot_services; | ||
| 117 | u64 text_output; | ||
| 118 | efi_status_t (*call)(unsigned long, ...); | ||
| 119 | bool is64; | ||
| 120 | } __packed; | ||
| 121 | |||
| 122 | #endif /* BOOT_COMPRESSED_EBOOT_H */ | 106 | #endif /* BOOT_COMPRESSED_EBOOT_H */ |
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 9b11757975d0..25bce45c6fc4 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
| @@ -158,6 +158,30 @@ static inline efi_status_t efi_thunk_set_virtual_address_map( | |||
| 158 | } | 158 | } |
| 159 | #endif /* CONFIG_EFI_MIXED */ | 159 | #endif /* CONFIG_EFI_MIXED */ |
| 160 | 160 | ||
| 161 | |||
| 162 | /* arch specific definitions used by the stub code */ | ||
| 163 | |||
| 164 | struct efi_config { | ||
| 165 | u64 image_handle; | ||
| 166 | u64 table; | ||
| 167 | u64 allocate_pool; | ||
| 168 | u64 allocate_pages; | ||
| 169 | u64 get_memory_map; | ||
| 170 | u64 free_pool; | ||
| 171 | u64 free_pages; | ||
| 172 | u64 locate_handle; | ||
| 173 | u64 handle_protocol; | ||
| 174 | u64 exit_boot_services; | ||
| 175 | u64 text_output; | ||
| 176 | efi_status_t (*call)(unsigned long, ...); | ||
| 177 | bool is64; | ||
| 178 | } __packed; | ||
| 179 | |||
| 180 | __pure const struct efi_config *__efi_early(void); | ||
| 181 | |||
| 182 | #define efi_call_early(f, ...) \ | ||
| 183 | __efi_early()->call(__efi_early()->f, __VA_ARGS__); | ||
| 184 | |||
| 161 | extern bool efi_reboot_required(void); | 185 | extern bool efi_reboot_required(void); |
| 162 | 186 | ||
| 163 | #else | 187 | #else |
diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile index aef6a95adef5..d8be608a9f3b 100644 --- a/drivers/firmware/efi/Makefile +++ b/drivers/firmware/efi/Makefile | |||
| @@ -7,4 +7,4 @@ obj-$(CONFIG_EFI_VARS_PSTORE) += efi-pstore.o | |||
| 7 | obj-$(CONFIG_UEFI_CPER) += cper.o | 7 | obj-$(CONFIG_UEFI_CPER) += cper.o |
| 8 | obj-$(CONFIG_EFI_RUNTIME_MAP) += runtime-map.o | 8 | obj-$(CONFIG_EFI_RUNTIME_MAP) += runtime-map.o |
| 9 | obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o | 9 | obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o |
| 10 | obj-$(CONFIG_EFI_ARM_STUB) += libstub/ | 10 | obj-$(CONFIG_EFI_STUB) += libstub/ |
