efi: libstub: simplify efi_get_memory_map() and struct efi_boot_memmap
authorArd Biesheuvel <ardb@kernel.org>
Fri, 3 Jun 2022 13:29:22 +0000 (15:29 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Mon, 26 Sep 2022 20:30:17 +0000 (22:30 +0200)
commiteab3126571ed1e3e57ce0f066b566af472ebc47a
treed80d86d36b10415ea62beaa1b0db7ecca6f749d6
parentf80d26043af91ceb5036c478101c015edb9e7630
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>
drivers/firmware/efi/libstub/arm64-stub.c
drivers/firmware/efi/libstub/efi-stub-helper.c
drivers/firmware/efi/libstub/efistub.h
drivers/firmware/efi/libstub/fdt.c
drivers/firmware/efi/libstub/mem.c
drivers/firmware/efi/libstub/randomalloc.c
drivers/firmware/efi/libstub/relocate.c
drivers/firmware/efi/libstub/x86-stub.c
include/linux/efi.h