1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Function calling ABI conversion from Linux to EFI for x86_64
4 *
5 * Copyright (C) 2007 Intel Corp
6 * Bibo Mao <bibo.mao@intel.com>
7 * Huang Ying <ying.huang@intel.com>
8 */
9
10#include <linux/linkage.h>
11#include <asm/nospec-branch.h>
12
13SYM_FUNC_START(__efi_call)
14 /*
15 * The EFI code doesn't have any CFI, annotate away the CFI violation.
16 */
17 ANNOTATE_NOCFI_SYM
18 pushq %rbp
19 movq %rsp, %rbp
20 and $~0xf, %rsp
21 mov 16(%rbp), %rax
22 subq $48, %rsp
23 mov %r9, 32(%rsp)
24 mov %rax, 40(%rsp)
25 mov %r8, %r9
26 mov %rcx, %r8
27 mov %rsi, %rcx
28 CALL_NOSPEC rdi
29 leave
30 RET
31SYM_FUNC_END(__efi_call)
32