blob: d0e5acab547f5423b52e6e8aae950de68cafa898 [file] [log] [blame]
Ard Biesheuvelbd669472014-07-02 14:54:42 +02001
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 Biesheuvel07e83db2016-02-17 12:35:59 +00008/*
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 Biesheuvele3111d52017-04-04 17:09:08 +010018extern int __pure nokaslr(void);
19
Ard Biesheuvelbd669472014-07-02 14:54:42 +020020void efi_char16_printk(efi_system_table_t *, efi_char16_t *);
21
22efi_status_t efi_open_volume(efi_system_table_t *sys_table_arg, void *__image,
23 void **__fh);
24
25efi_status_t efi_file_size(efi_system_table_t *sys_table_arg, void *__fh,
26 efi_char16_t *filename_16, void **handle,
27 u64 *file_sz);
28
29efi_status_t efi_file_read(void *handle, unsigned long *size, void *addr);
30
31efi_status_t efi_file_close(void *handle);
32
33unsigned long get_dram_base(efi_system_table_t *sys_table_arg);
34
Ard Biesheuvelbd669472014-07-02 14:54:42 +020035efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table,
36 void *handle,
37 unsigned long *new_fdt_addr,
38 unsigned long max_addr,
39 u64 initrd_addr, u64 initrd_size,
40 char *cmdline_ptr,
41 unsigned long fdt_addr,
42 unsigned long fdt_size);
43
Ard Biesheuvela6433752015-03-04 13:02:29 +010044void *get_fdt(efi_system_table_t *sys_table, unsigned long *fdt_size);
Ard Biesheuvelbd669472014-07-02 14:54:42 +020045
Ard Biesheuvelf3cdfd22014-10-20 16:27:26 +020046void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size,
47 unsigned long desc_size, efi_memory_desc_t *runtime_map,
48 int *count);
49
Ard Biesheuvele4fbf472016-01-10 11:29:07 +010050efi_status_t efi_get_random_bytes(efi_system_table_t *sys_table,
51 unsigned long size, u8 *out);
52
Ard Biesheuvel2ddbfc82016-01-11 10:43:16 +010053efi_status_t efi_random_alloc(efi_system_table_t *sys_table_arg,
54 unsigned long size, unsigned long align,
55 unsigned long *addr, unsigned long random_seed);
56
Ard Biesheuvelb9d6769b2016-02-17 12:36:03 +000057efi_status_t check_platform_features(efi_system_table_t *sys_table_arg);
58
Ard Biesheuvelbd669472014-07-02 14:54:42 +020059#endif