1
/* callwrap.S - wrapper for x86_64 efi calls */
3
* GRUB -- GRand Unified Bootloader
4
* Copyright (C) 2006,2007,2009 Free Software Foundation, Inc.
6
* GRUB is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* GRUB is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
21
#include <grub/symbol.h>
22
#include <grub/boot.h>
25
* x86_64 uses registry to pass parameters. Unfortunately, gcc and efi use
26
* different call conversion, so we need to do some conversion.
29
* %rdi, %esi, %rdx, %rcx, %r8, %r9, 8(%rsp), 16(%rsp), ...
32
* %rcx, %rdx, %r8, %r9, 32(%rsp), 40(%rsp), 48(%rsp), ...
100
mov 88+40(%rsp), %rax
102
mov 88+32(%rsp), %rax
104
mov 88+24(%rsp), %rax
106
mov 88+16(%rsp), %rax