efi_relocate_kernel(9)
π NAME π
okay so this is the efi_relocate_kernel(9) page from the Kernel API Manual, and the name section is literally efi_relocate_kernel β copy memory area. thatβs the whole name, bestie, no extra lore π«Ά
β¨ SYNOPSIS β¨
efi_status_t efi_relocate_kernel (unsigned long *image_addr , unsigned
long image_size , unsigned long alloc_size , unsigned long
preferred_addr , unsigned long alignment , unsigned long min_addr );
π ARGUMENTS π
image_addrβ pointer to the address of the memory area to copy. yes, a pointer-to-address situation, stay with me πimage_sizeβ size of the memory area to copy.alloc_sizeβ minimum size of memory to allocate. it must be greater or equal toimage_sizeβ this is a hard requirement, not a suggestion πpreferred_addrβ the preferred target address.alignmentβ minimum alignment of the allocated memory area. it should be a power of two.min_addrβ minimum target address.
πΈ DESCRIPTION πΈ
So what it does: copy a memory area to a newly allocated memory area thatβs aligned according to alignment, but at least EFI_ALLOC_ALIGN β yes, EFI_ALLOC_ALIGN is the floor, bestie. If the preferred address is not available, the allocated address will not be below min_addr. On exit, image_addr is updated to the target copy address that was used. literally it hands you the new address through that pointer π
This function is used to copy the Linux kernel verbatim. It does not apply any relocation changes. read that again: verbatim, no relocation changes, periodt. no cap, donβt expect it to fix up addresses for you π₯
π¦ RETURN π¦
status code β yep, thatβs the return: a status code. short and iconic, ngl π
π SEE ALSO π
- Kernel file
./drivers/firmware/efi/libstub/loongarch-stub.cβ go peek if you want the source-side vibe π
okay thatβs the whole page, bestie π this oneβs sourced from ./drivers/firmware/efi/libstub and dated October 2026. mwah, go copy some memory responsibly πβ¨
π¦ 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