]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/firmware/efi/libstub/efistub.h
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-artful-kernel.git] / drivers / firmware / efi / libstub / efistub.h
CommitLineData
bd669475
AB
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
07e83dbb
AB
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
a6a14469
AB
18/*
19 * Allow the platform to override the allocation granularity: this allows
20 * systems that have the capability to run with a larger page size to deal
21 * with the allocations for initrd and fdt more efficiently.
22 */
23#ifndef EFI_ALLOC_ALIGN
24#define EFI_ALLOC_ALIGN EFI_PAGE_SIZE
25#endif
26
60f38de7 27extern int __pure nokaslr(void);
eeff7d63
AB
28extern int __pure is_quiet(void);
29
30#define pr_efi(sys_table, msg) do { \
31 if (!is_quiet()) efi_printk(sys_table, "EFI stub: "msg); \
32} while (0)
33
34#define pr_efi_err(sys_table, msg) efi_printk(sys_table, "EFI stub: ERROR: "msg)
60f38de7 35
bd669475
AB
36void efi_char16_printk(efi_system_table_t *, efi_char16_t *);
37
38efi_status_t efi_open_volume(efi_system_table_t *sys_table_arg, void *__image,
39 void **__fh);
40
bd669475
AB
41unsigned long get_dram_base(efi_system_table_t *sys_table_arg);
42
bd669475
AB
43efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table,
44 void *handle,
45 unsigned long *new_fdt_addr,
46 unsigned long max_addr,
47 u64 initrd_addr, u64 initrd_size,
48 char *cmdline_ptr,
49 unsigned long fdt_addr,
50 unsigned long fdt_size);
51
a643375f 52void *get_fdt(efi_system_table_t *sys_table, unsigned long *fdt_size);
bd669475 53
f3cdfd23
AB
54void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size,
55 unsigned long desc_size, efi_memory_desc_t *runtime_map,
56 int *count);
57
e4fbf476
AB
58efi_status_t efi_get_random_bytes(efi_system_table_t *sys_table,
59 unsigned long size, u8 *out);
60
2ddbfc81
AB
61efi_status_t efi_random_alloc(efi_system_table_t *sys_table_arg,
62 unsigned long size, unsigned long align,
63 unsigned long *addr, unsigned long random_seed);
64
b9d6769b
AB
65efi_status_t check_platform_features(efi_system_table_t *sys_table_arg);
66
568bc4e8
AB
67efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg);
68
bd669475 69#endif