efi_allocate_pages_aligned(9)
π 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 alignmentEFI_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms