mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-19 21:32:02 +00:00
efi/libstub: Simplify efi_high_alloc() and rename to efi_allocate_pages()
The implementation of efi_high_alloc() uses a complicated way of traversing the memory map to find an available region that is located as close as possible to the provided upper limit, and calls AllocatePages subsequently to create the allocation at that exact address. This is precisely what the EFI_ALLOCATE_MAX_ADDRESS allocation type argument to AllocatePages() does, and considering that EFI_ALLOC_ALIGN only exceeds EFI_PAGE_SIZE on arm64, let's use AllocatePages() directly and implement the alignment using code that the compiler can remove if it does not exceed EFI_PAGE_SIZE. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
f57db62c67
commit
a7495c28c8
4 changed files with 23 additions and 91 deletions
|
@ -1508,8 +1508,8 @@ efi_status_t efi_low_alloc(unsigned long size, unsigned long align,
|
|||
return efi_low_alloc_above(size, align, addr, 0x8);
|
||||
}
|
||||
|
||||
efi_status_t efi_high_alloc(unsigned long size, unsigned long align,
|
||||
unsigned long *addr, unsigned long max);
|
||||
efi_status_t efi_allocate_pages(unsigned long size, unsigned long *addr,
|
||||
unsigned long max);
|
||||
|
||||
efi_status_t efi_relocate_kernel(unsigned long *image_addr,
|
||||
unsigned long image_size,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue