efi_allocate_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– efi_allocate_pages(9) β€” the kernel API manual, bestie edition πŸŽ€

okay so you're reading the efi_allocate_pages(9) page from the Kernel API Manual and honestly? it's giving "short but mighty" ✨ let me walk you through it 🫢


🌸 NAME 🌸

efi_allocate_pages β€” literally just: allocate memory pages πŸ’… that's the whole vibe.


✨ SYNOPSIS ✨

efi_status_t efi_allocate_pages (unsigned long size , unsigned long *addr , unsigned long max );

that's the whole signature, no cap. three args, one efi_status_t coming back at you πŸ”₯


πŸ¦‹ ARGUMENTS πŸ¦‹

  • size β€” the minimum number of bytes you want allocated. minimum, bestie, not a promise of exactly that πŸ‘€
  • addr β€” on return, this is where the address of the first allocated page lands. and listen: that first allocated page has alignment EFI_ALLOC_ALIGN, which is an architecture dependent multiple of the page size 🌈 so yeah, it's aligned, just architecture-dependent about it.
  • max β€” the address that the last allocated memory page shall not exceed. it's the ceiling, the boundary, the "do not pass go" line 🚧

πŸ’œ DESCRIPTION πŸ’œ

so what does it actually do? it allocates pages as EFI_LOADER_DATA πŸ“„ and the allocated pages are aligned according to EFI_ALLOC_ALIGN ✨ meanwhile the last allocated page will not exceed the address you passed in as max β€” that's the hard limit, periodt.


⭐ RETURN ⭐

status code. that's it, that's the return β€” a status code 😌 you check it, you respect it.


πŸŽ€ SEE ALSO πŸŽ€

go read those next, iykyk πŸ“šπŸ’«


ngl the whole thing lives in ./drivers/firmware/efi/libstub and this page is dated October 2026 🌸 so that's the source, the version, and the date all in one cute little sign-off πŸ’– mwah, bye bestie! πŸ‘‘πŸ¦‹

πŸ“¦ where this page comes from