/* SPDX-License-Identifier: GPL-2.0 */1/*2* EFI call stub for IA32.3*4* This stub allows us to make EFI calls in physical mode with interrupts5* turned off.6*/78#include <linux/linkage.h>9#include <linux/init.h>10#include <asm/asm-offsets.h>11#include <asm/page_types.h>1213__INIT14SYM_FUNC_START(efi_call_svam)15push %ebp16movl %esp, %ebp17push %ebx1819push 16(%esp)20push 16(%esp)21push %ecx22push %edx23movl %eax, %ebx // &systab_phys->runtime2425/*26* Switch to the flat mapped alias of this routine, by jumping to the27* address of label '1' after subtracting PAGE_OFFSET from it.28*/29movl $1f, %edx30subl $__PAGE_OFFSET, %edx31jmp *%edx321:3334/* disable paging */35movl %cr0, %edx36andl $0x7fffffff, %edx37movl %edx, %cr03839/* convert the stack pointer to a flat mapped address */40subl $__PAGE_OFFSET, %esp4142/* call the EFI routine */43movl (%eax), %eax44call *EFI_svam(%eax)4546/* grab the virtually remapped EFI runtime services table pointer */47movl (%ebx), %ecx48movl 36(%esp), %edx // &efi.runtime49movl %ecx, (%edx)5051/* re-enable paging */52movl %cr0, %edx53orl $0x80000000, %edx54movl %edx, %cr05556movl 16(%esp), %ebx57leave58RET59SYM_FUNC_END(efi_call_svam)606162