// SPDX-License-Identifier: GPL-2.0 #include <linux/efi.h> #include <asm/efi.h> #include "efistub.h" /** * efi_get_memory_map() - get memory map * @map: pointer to memory map pointer to which to assign the * newly allocated memory map * @install_cfg_tbl: whether or not to install the boot memory map as a * configuration table * * Retrieve the UEFI memory map. The allocated memory leaves room for * up to EFI_MMAP_NR_SLACK_SLOTS additional memory map entries. * * Return: status code */ efi_status_t efi_get_memory_map(struct efi_boot_memmap **map, bool install_cfg_tbl) { … } /** * efi_allocate_pages() - Allocate memory pages * @size: minimum number of bytes to allocate * @addr: On return the address of the first allocated page. The first * allocated page has alignment EFI_ALLOC_ALIGN which is an * architecture dependent multiple of the page size. * @max: the address that the last allocated memory page shall not * exceed * * Allocate pages as EFI_LOADER_DATA. The allocated pages are aligned according * to EFI_ALLOC_ALIGN. The last allocated page will not exceed the address * given by @max. * * Return: status code */ efi_status_t efi_allocate_pages(unsigned long size, unsigned long *addr, unsigned long max) { … } /** * efi_free() - free memory pages * @size: size of the memory area to free in bytes * @addr: start of the memory area to free (must be EFI_PAGE_SIZE * aligned) * * @size is rounded up to a multiple of EFI_ALLOC_ALIGN which is an * architecture specific multiple of EFI_PAGE_SIZE. So this function should * only be used to return pages allocated with efi_allocate_pages() or * efi_low_alloc_above(). */ void efi_free(unsigned long size, unsigned long addr) { … }