efi_allocate_pages_aligned(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

efi_allocate_pages_aligned β€” Allocate memory pages ✨

okay bestie, this is the Kernel API Manual page for efi_allocate_pages_aligned(9), and it’s giving β€œlet’s grab some aligned memory pages” energy, fr fr 🫢

✨ SYNOPSIS ✨

efi_status_t efi_allocate_pages_aligned (unsigned long size , unsigned
long *addr , unsigned long max , unsigned long align , int memory_type
);

πŸŽ€ ARGUMENTS πŸŽ€

  • size β€” the minimum number of bytes to allocate, bestie. Like the smallest bag you’re willing to carry πŸ’…
  • addr β€” on return, this is the address of the first allocated page. And listen: that 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. So it’s the β€œdo not pass go” boundary, no cap 🚧
  • align β€” the minimum alignment of the base of the allocation. Alignment queen behavior ✨
  • memory_type β€” the type of memory to allocate. Gotta know the vibe of the memory you’re requesting 🧚

πŸ¦‹ DESCRIPTION πŸ¦‹

So this function allocates pages as EFI_LOADER_DATA 🌈. The allocated pages are aligned according to align, which should be >= EFI_ALLOC_ALIGN β€” that’s the rule, bestie, don’t skip it. The last allocated page will not exceed the address given by max πŸ™…β€β™€οΈ. That’s literally the whole plot: allocate pages, keep them aligned, and stay under max.

πŸ’… RETURN πŸ’…

The return value is a status code 😌. That’s your vibe check after the call β€” it tells you how things went, periodt.

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/firmware/efi/libstub/alignedmem.c β€” go peek if you’re obsessed like me πŸ’–


and that’s the page, bestie! source/version: ./drivers/firmware/efi/libstub, date: October 2026, and yeah it’s the efi_allocate_pages_aligned(9) page 🫢✨

πŸ“¦ where this page comes from