if (install_cfg_tbl) { /* * Installing a configuration table might allocate memory, and * this may modify the memory map. This means we should install * the configuration table first, and re-install or delete it * as needed.
*/
status = efi_bs_call(install_configuration_table, &tbl_guid, m); if (status != EFI_SUCCESS) return status;
}
m->buff_size = m->map_size = size;
status = efi_bs_call(get_memory_map, &m->map_size, m->map, &m->map_key,
&m->desc_size, &m->desc_ver); if (status != EFI_SUCCESS) { if (install_cfg_tbl)
efi_bs_call(install_configuration_table, &tbl_guid, NULL); return status;
}
*map = no_free_ptr(m); return EFI_SUCCESS;
}
/** * 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(unsignedlong size, unsignedlong *addr, unsignedlong max)
{
efi_physical_addr_t alloc_addr;
efi_status_t status;
max = min(max, EFI_ALLOC_LIMIT);
if (EFI_ALLOC_ALIGN > EFI_PAGE_SIZE) return efi_allocate_pages_aligned(size, addr, max,
EFI_ALLOC_ALIGN,
EFI_LOADER_DATA);
/** * 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(unsignedlong size, unsignedlong addr)
{ unsignedlong nr_pages;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.