1 /* SPDX-License-Identifier: GPL-2.0 */
3 * EFI call stub for IA32.
5 * This stub allows us to make EFI calls in physical mode with interrupts
9 #include <linux/linkage.h>
10 #include <linux/init.h>
11 #include <asm/asm-offsets.h>
12 #include <asm/page_types.h>
15 SYM_FUNC_START(efi_call_svam)
24 movl %eax, %ebx // &systab_phys->runtime
27 * Switch to the flat mapped alias of this routine, by jumping to the
28 * address of label '1' after subtracting PAGE_OFFSET from it.
31 subl $__PAGE_OFFSET, %edx
37 andl $0x7fffffff, %edx
40 /* convert the stack pointer to a flat mapped address */
41 subl $__PAGE_OFFSET, %esp
43 /* call the EFI routine */
47 /* grab the virtually remapped EFI runtime services table pointer */
49 movl 36(%esp), %edx // &efi.runtime
52 /* re-enable paging */
60 SYM_FUNC_END(efi_call_svam)