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/page_types.h>
14 SYM_FUNC_START(efi_call_svam)
21 * Switch to the flat mapped alias of this routine, by jumping to the
22 * address of label '1' after subtracting PAGE_OFFSET from it.
25 subl $__PAGE_OFFSET, %edx
31 andl $0x7fffffff, %edx
34 /* convert the stack pointer to a flat mapped address */
35 subl $__PAGE_OFFSET, %esp
37 /* call the EFI routine */
40 /* convert ESP back to a kernel VA, and pop the outgoing args */
41 addl $__PAGE_OFFSET + 16, %esp
43 /* re-enable paging */
49 SYM_FUNC_END(efi_call_svam)