summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/libstub/efistub.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2022-06-03 15:29:22 +0200
committerArd Biesheuvel <ardb@kernel.org>2022-09-26 22:30:17 +0200
commiteab3126571ed1e3e57ce0f066b566af472ebc47a (patch)
treed80d86d36b10415ea62beaa1b0db7ecca6f749d6 /drivers/firmware/efi/libstub/efistub.h
parentf80d26043af91ceb5036c478101c015edb9e7630 (diff)
efi: libstub: simplify efi_get_memory_map() and struct efi_boot_memmap
Currently, struct efi_boot_memmap is a struct that is passed around between callers of efi_get_memory_map() and the users of the resulting data, and which carries pointers to various variables whose values are provided by the EFI GetMemoryMap() boot service. This is overly complex, and it is much easier to carry these values in the struct itself. So turn the struct into one that carries these data items directly, including a flex array for the variable number of EFI memory descriptors that the boot service may return. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/efistub.h')
-rw-r--r--drivers/firmware/efi/libstub/efistub.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index e9d466822b67..ed32055f0340 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -160,15 +160,6 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
*/
#define EFI_MMAP_NR_SLACK_SLOTS 8
-struct efi_boot_memmap {
- efi_memory_desc_t **map;
- unsigned long *map_size;
- unsigned long *desc_size;
- u32 *desc_ver;
- unsigned long *key_ptr;
- unsigned long *buff_size;
-};
-
typedef struct efi_generic_dev_path efi_device_path_protocol_t;
typedef void *efi_event_t;
@@ -850,9 +841,7 @@ typedef efi_status_t (*efi_exit_boot_map_processing)(
struct efi_boot_memmap *map,
void *priv);
-efi_status_t efi_exit_boot_services(void *handle,
- struct efi_boot_memmap *map,
- void *priv,
+efi_status_t efi_exit_boot_services(void *handle, void *priv,
efi_exit_boot_map_processing priv_func);
efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
@@ -891,7 +880,7 @@ void efi_apply_loadoptions_quirk(const void **load_options, int *load_options_si
char *efi_convert_cmdline(efi_loaded_image_t *image, int *cmd_line_len);
-efi_status_t efi_get_memory_map(struct efi_boot_memmap *map);
+efi_status_t efi_get_memory_map(struct efi_boot_memmap **map);
efi_status_t efi_allocate_pages(unsigned long size, unsigned long *addr,
unsigned long max);