diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2014-07-02 08:54:42 -0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-07-07 15:29:48 -0400 |
commit | bd669475d14e3279a7f96ed917a82df5da6ad52d (patch) | |
tree | b13bbe4cb23774acfea30e98d60fcfb4da029c2a /arch/arm64 | |
parent | a13b00778e89c405cb224ef0926be6d71682d2a2 (diff) |
efi: efistub: Refactor stub components
In order to move from the #include "../../../xxxxx.c" anti-pattern used
by both the x86 and arm64 versions of the stub to a static library
linked into either the kernel proper (arm64) or a separate boot
executable (x86), there is some prepatory work required.
This patch does the following:
- move forward declarations of functions shared between the arch
specific and the generic parts of the stub to include/linux/efi.h
- move forward declarations of functions shared between various .c files
of the generic stub code to a new local header file called "efistub.h"
- add #includes to all .c files which were formerly relying on the
#includor to include the correct header files
- remove all static modifiers from functions which will need to be
externally visible once we move to a static library
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kernel/efi-stub.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c index 23cbde4324b1..e4999021b07d 100644 --- a/arch/arm64/kernel/efi-stub.c +++ b/arch/arm64/kernel/efi-stub.c | |||
@@ -11,36 +11,21 @@ | |||
11 | */ | 11 | */ |
12 | #include <linux/efi.h> | 12 | #include <linux/efi.h> |
13 | #include <asm/efi.h> | 13 | #include <asm/efi.h> |
14 | #include <linux/libfdt.h> | ||
15 | #include <asm/sections.h> | 14 | #include <asm/sections.h> |
16 | 15 | ||
17 | static void efi_char16_printk(efi_system_table_t *sys_table_arg, | ||
18 | efi_char16_t *str); | ||
19 | |||
20 | static efi_status_t efi_open_volume(efi_system_table_t *sys_table, | ||
21 | void *__image, void **__fh); | ||
22 | static efi_status_t efi_file_close(void *handle); | ||
23 | |||
24 | static efi_status_t | ||
25 | efi_file_read(void *handle, unsigned long *size, void *addr); | ||
26 | |||
27 | static efi_status_t | ||
28 | efi_file_size(efi_system_table_t *sys_table, void *__fh, | ||
29 | efi_char16_t *filename_16, void **handle, u64 *file_sz); | ||
30 | |||
31 | /* Include shared EFI stub code */ | 16 | /* Include shared EFI stub code */ |
32 | #include "../../../drivers/firmware/efi/efi-stub-helper.c" | 17 | #include "../../../drivers/firmware/efi/efi-stub-helper.c" |
33 | #include "../../../drivers/firmware/efi/fdt.c" | 18 | #include "../../../drivers/firmware/efi/fdt.c" |
34 | #include "../../../drivers/firmware/efi/arm-stub.c" | 19 | #include "../../../drivers/firmware/efi/arm-stub.c" |
35 | 20 | ||
36 | 21 | ||
37 | static efi_status_t handle_kernel_image(efi_system_table_t *sys_table, | 22 | efi_status_t handle_kernel_image(efi_system_table_t *sys_table, |
38 | unsigned long *image_addr, | 23 | unsigned long *image_addr, |
39 | unsigned long *image_size, | 24 | unsigned long *image_size, |
40 | unsigned long *reserve_addr, | 25 | unsigned long *reserve_addr, |
41 | unsigned long *reserve_size, | 26 | unsigned long *reserve_size, |
42 | unsigned long dram_base, | 27 | unsigned long dram_base, |
43 | efi_loaded_image_t *image) | 28 | efi_loaded_image_t *image) |
44 | { | 29 | { |
45 | efi_status_t status; | 30 | efi_status_t status; |
46 | unsigned long kernel_size, kernel_memsize = 0; | 31 | unsigned long kernel_size, kernel_memsize = 0; |