|
4 | 4 | #define _DRIVERS_FIRMWARE_EFI_EFISTUB_H |
5 | 5 |
|
6 | 6 | #include <linux/compiler.h> |
| 7 | +#include <linux/cleanup.h> |
7 | 8 | #include <linux/efi.h> |
8 | 9 | #include <linux/kernel.h> |
9 | 10 | #include <linux/kern_levels.h> |
@@ -122,11 +123,10 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, |
122 | 123 | #define efi_get_handle_num(size) \ |
123 | 124 | ((size) / (efi_is_native() ? sizeof(efi_handle_t) : sizeof(u32))) |
124 | 125 |
|
125 | | -#define for_each_efi_handle(handle, array, size, i) \ |
126 | | - for (i = 0; \ |
127 | | - i < efi_get_handle_num(size) && \ |
128 | | - ((handle = efi_get_handle_at((array), i)) || true); \ |
129 | | - i++) |
| 126 | +#define for_each_efi_handle(handle, array, num) \ |
| 127 | + for (int __i = 0; __i < (num) && \ |
| 128 | + ((handle = efi_get_handle_at((array), __i)) || true); \ |
| 129 | + __i++) |
130 | 130 |
|
131 | 131 | static inline |
132 | 132 | void efi_set_u64_split(u64 data, u32 *lo, u32 *hi) |
@@ -171,7 +171,7 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi) |
171 | 171 | * the EFI memory map. Other related structures, e.g. x86 e820ext, need |
172 | 172 | * to factor in this headroom requirement as well. |
173 | 173 | */ |
174 | | -#define EFI_MMAP_NR_SLACK_SLOTS 8 |
| 174 | +#define EFI_MMAP_NR_SLACK_SLOTS 32 |
175 | 175 |
|
176 | 176 | typedef struct efi_generic_dev_path efi_device_path_protocol_t; |
177 | 177 |
|
@@ -314,7 +314,9 @@ union efi_boot_services { |
314 | 314 | void *close_protocol; |
315 | 315 | void *open_protocol_information; |
316 | 316 | void *protocols_per_handle; |
317 | | - void *locate_handle_buffer; |
| 317 | + efi_status_t (__efiapi *locate_handle_buffer)(int, efi_guid_t *, |
| 318 | + void *, unsigned long *, |
| 319 | + efi_handle_t **); |
318 | 320 | efi_status_t (__efiapi *locate_protocol)(efi_guid_t *, void *, |
319 | 321 | void **); |
320 | 322 | efi_status_t (__efiapi *install_multiple_protocol_interfaces)(efi_handle_t *, ...); |
@@ -1053,6 +1055,7 @@ void efi_puts(const char *str); |
1053 | 1055 | __printf(1, 2) int efi_printk(char const *fmt, ...); |
1054 | 1056 |
|
1055 | 1057 | void efi_free(unsigned long size, unsigned long addr); |
| 1058 | +DEFINE_FREE(efi_pool, void *, if (_T) efi_bs_call(free_pool, _T)); |
1056 | 1059 |
|
1057 | 1060 | void efi_apply_loadoptions_quirk(const void **load_options, u32 *load_options_size); |
1058 | 1061 |
|
@@ -1082,8 +1085,7 @@ efi_status_t efi_parse_options(char const *cmdline); |
1082 | 1085 |
|
1083 | 1086 | void efi_parse_option_graphics(char *option); |
1084 | 1087 |
|
1085 | | -efi_status_t efi_setup_gop(struct screen_info *si, efi_guid_t *proto, |
1086 | | - unsigned long size); |
| 1088 | +efi_status_t efi_setup_gop(struct screen_info *si); |
1087 | 1089 |
|
1088 | 1090 | efi_status_t handle_cmdline_files(efi_loaded_image_t *image, |
1089 | 1091 | const efi_char16_t *optstr, |
|
0 commit comments