Ard Biesheuvel | bd66947 | 2014-07-02 14:54:42 +0200 | [diff] [blame] | 1 | |
| 2 | #ifndef _DRIVERS_FIRMWARE_EFI_EFISTUB_H |
| 3 | #define _DRIVERS_FIRMWARE_EFI_EFISTUB_H |
| 4 | |
| 5 | /* error code which can't be mistaken for valid address */ |
| 6 | #define EFI_ERROR (~0UL) |
| 7 | |
Ard Biesheuvel | 07e83db | 2016-02-17 12:35:59 +0000 | [diff] [blame^] | 8 | /* |
| 9 | * __init annotations should not be used in the EFI stub, since the code is |
| 10 | * either included in the decompressor (x86, ARM) where they have no effect, |
| 11 | * or the whole stub is __init annotated at the section level (arm64), by |
| 12 | * renaming the sections, in which case the __init annotation will be |
| 13 | * redundant, and will result in section names like .init.init.text, and our |
| 14 | * linker script does not expect that. |
| 15 | */ |
| 16 | #undef __init |
| 17 | |
Ard Biesheuvel | bd66947 | 2014-07-02 14:54:42 +0200 | [diff] [blame] | 18 | void efi_char16_printk(efi_system_table_t *, efi_char16_t *); |
| 19 | |
| 20 | efi_status_t efi_open_volume(efi_system_table_t *sys_table_arg, void *__image, |
| 21 | void **__fh); |
| 22 | |
| 23 | efi_status_t efi_file_size(efi_system_table_t *sys_table_arg, void *__fh, |
| 24 | efi_char16_t *filename_16, void **handle, |
| 25 | u64 *file_sz); |
| 26 | |
| 27 | efi_status_t efi_file_read(void *handle, unsigned long *size, void *addr); |
| 28 | |
| 29 | efi_status_t efi_file_close(void *handle); |
| 30 | |
| 31 | unsigned long get_dram_base(efi_system_table_t *sys_table_arg); |
| 32 | |
| 33 | efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, |
| 34 | unsigned long orig_fdt_size, |
| 35 | void *fdt, int new_fdt_size, char *cmdline_ptr, |
| 36 | u64 initrd_addr, u64 initrd_size, |
| 37 | efi_memory_desc_t *memory_map, |
| 38 | unsigned long map_size, unsigned long desc_size, |
| 39 | u32 desc_ver); |
| 40 | |
| 41 | efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table, |
| 42 | void *handle, |
| 43 | unsigned long *new_fdt_addr, |
| 44 | unsigned long max_addr, |
| 45 | u64 initrd_addr, u64 initrd_size, |
| 46 | char *cmdline_ptr, |
| 47 | unsigned long fdt_addr, |
| 48 | unsigned long fdt_size); |
| 49 | |
Ard Biesheuvel | a643375 | 2015-03-04 13:02:29 +0100 | [diff] [blame] | 50 | void *get_fdt(efi_system_table_t *sys_table, unsigned long *fdt_size); |
Ard Biesheuvel | bd66947 | 2014-07-02 14:54:42 +0200 | [diff] [blame] | 51 | |
Ard Biesheuvel | f3cdfd2 | 2014-10-20 16:27:26 +0200 | [diff] [blame] | 52 | void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size, |
| 53 | unsigned long desc_size, efi_memory_desc_t *runtime_map, |
| 54 | int *count); |
| 55 | |
Ard Biesheuvel | bd66947 | 2014-07-02 14:54:42 +0200 | [diff] [blame] | 56 | #endif |