Index: head/stand/efi/boot1/Makefile =================================================================== --- head/stand/efi/boot1/Makefile +++ head/stand/efi/boot1/Makefile @@ -6,6 +6,7 @@ INTERNALPROG= WARNS?= 6 +CFLAGS+= -DEFI_BOOT1 # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead Index: head/stand/efi/loader/arch/arm64/start.S =================================================================== --- head/stand/efi/loader/arch/arm64/start.S +++ head/stand/efi/loader/arch/arm64/start.S @@ -160,6 +160,23 @@ ldp x0, x1, [sp], #16 +#ifndef EFI_BOOT1 + /* + * Load the stack to use. The default stack may be too small for + * the lua loader. + */ + adr x2, initstack_end + mov sp, x2 +#endif + bl efi_main 1: b 1b + +#ifndef EFI_BOOT1 +.bss + .align 4 +initstack: + .space (64 * 1024) +initstack_end: +#endif