relocator
head = &relocator->rel_chunk_head;
chunk = &relocator->rel_chunklist[i++];
chunk = &relocator->rel_chunklist[i++];
chunk = &relocator->rel_chunklist[i++];
trampoline = (void *)(uintptr_t)relocator + EFI_PAGE_SIZE;
relocator->rel_copy = (uintptr_t)trampoline + EFI_PAGE_SIZE;
memmove((void *)relocator->rel_copy, efi_copy_finish, EFI_PAGE_SIZE);
relocator->rel_memmove = (uintptr_t)relocator->rel_copy + EFI_PAGE_SIZE;
memmove((void *)relocator->rel_memmove, memmove, EFI_PAGE_SIZE);
relocator->rel_stack = relocator->rel_memmove + EFI_PAGE_SIZE - 8;
trampoline(MULTIBOOT2_BOOTLOADER_MAGIC, relocator, entry_addr);
free(relocator);
static void (*trampoline)(uint32_t, struct relocator *, uint64_t);
struct relocator *relocator = NULL;
if ((relocator = malloc(EFI_PAGE_SIZE * 5)) == NULL) {
if (overlaps((uintptr_t)relocator, EFI_PAGE_SIZE * 5,
num = (EFI_PAGE_SIZE - offsetof(struct relocator, rel_chunklist)) /
efi_copy_finish(struct relocator *relocator)
move = (void *)relocator->rel_memmove;
head = &relocator->rel_chunk_head;
multiboot2_info_header_t *efi_copy_finish(struct relocator *);
void multiboot_tramp(uint32_t, struct relocator *, uint64_t);