mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-23 11:04:44 +08:00
14b864f4b5
On x86 we need to thunk through assembler stubs to call the EFI services for mixed mode, and for runtime services in 64-bit mode. The assembler stubs have limits on how many arguments it handles. Introduce a few macros to check that we do not try to pass too many arguments to the stubs. Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Matthew Garrett <mjg59@google.com> Cc: linux-efi@vger.kernel.org Link: https://lkml.kernel.org/r/20200103113953.9571-16-ardb@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
28 lines
524 B
ArmAsm
28 lines
524 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Function calling ABI conversion from Linux to EFI for x86_64
|
|
*
|
|
* Copyright (C) 2007 Intel Corp
|
|
* Bibo Mao <bibo.mao@intel.com>
|
|
* Huang Ying <ying.huang@intel.com>
|
|
*/
|
|
|
|
#include <linux/linkage.h>
|
|
#include <asm/nospec-branch.h>
|
|
|
|
SYM_FUNC_START(__efi_call)
|
|
pushq %rbp
|
|
movq %rsp, %rbp
|
|
and $~0xf, %rsp
|
|
mov 16(%rbp), %rax
|
|
subq $48, %rsp
|
|
mov %r9, 32(%rsp)
|
|
mov %rax, 40(%rsp)
|
|
mov %r8, %r9
|
|
mov %rcx, %r8
|
|
mov %rsi, %rcx
|
|
CALL_NOSPEC %rdi
|
|
leave
|
|
ret
|
|
SYM_FUNC_END(__efi_call)
|