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 /include/linux | |
| 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 'include/linux')
| -rw-r--r-- | include/linux/efi.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index 0ceb816bdfc2..3a64f2f85821 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -1163,4 +1163,46 @@ static inline void | |||
| 1163 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} | 1163 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} |
| 1164 | #endif | 1164 | #endif |
| 1165 | 1165 | ||
| 1166 | /* prototypes shared between arch specific and generic stub code */ | ||
| 1167 | |||
| 1168 | #define pr_efi(sys_table, msg) efi_printk(sys_table, "EFI stub: "msg) | ||
| 1169 | #define pr_efi_err(sys_table, msg) efi_printk(sys_table, "EFI stub: ERROR: "msg) | ||
| 1170 | |||
| 1171 | void efi_printk(efi_system_table_t *sys_table_arg, char *str); | ||
| 1172 | |||
| 1173 | void efi_free(efi_system_table_t *sys_table_arg, unsigned long size, | ||
| 1174 | unsigned long addr); | ||
| 1175 | |||
| 1176 | char *efi_convert_cmdline(efi_system_table_t *sys_table_arg, | ||
| 1177 | efi_loaded_image_t *image, int *cmd_line_len); | ||
| 1178 | |||
| 1179 | efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, | ||
| 1180 | efi_memory_desc_t **map, | ||
| 1181 | unsigned long *map_size, | ||
| 1182 | unsigned long *desc_size, | ||
| 1183 | u32 *desc_ver, | ||
| 1184 | unsigned long *key_ptr); | ||
| 1185 | |||
| 1186 | efi_status_t efi_low_alloc(efi_system_table_t *sys_table_arg, | ||
| 1187 | unsigned long size, unsigned long align, | ||
| 1188 | unsigned long *addr); | ||
| 1189 | |||
| 1190 | efi_status_t efi_high_alloc(efi_system_table_t *sys_table_arg, | ||
| 1191 | unsigned long size, unsigned long align, | ||
| 1192 | unsigned long *addr, unsigned long max); | ||
| 1193 | |||
| 1194 | efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg, | ||
| 1195 | unsigned long *image_addr, | ||
| 1196 | unsigned long image_size, | ||
| 1197 | unsigned long alloc_size, | ||
| 1198 | unsigned long preferred_addr, | ||
| 1199 | unsigned long alignment); | ||
| 1200 | |||
| 1201 | efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, | ||
| 1202 | efi_loaded_image_t *image, | ||
| 1203 | char *cmd_line, char *option_string, | ||
| 1204 | unsigned long max_addr, | ||
| 1205 | unsigned long *load_addr, | ||
| 1206 | unsigned long *load_size); | ||
| 1207 | |||
| 1166 | #endif /* _LINUX_EFI_H */ | 1208 | #endif /* _LINUX_EFI_H */ |
