All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 0/4] x86: use EFI calling convention for efi_main on x86_64
@ 2018-06-12 17:51 Ivan Gorinov
  2018-06-12 17:52 ` [U-Boot] [PATCH v4 1/4] " Ivan Gorinov
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Ivan Gorinov @ 2018-06-12 17:51 UTC (permalink / raw)
  To: u-boot

UEFI specifies the calling convention used in Microsoft compilers;
first arguments of a function are passed in (%rcx, %rdx, %r8, %r9).

All other compilers use System V ABI by default, passing first integer
arguments of a function in (%rdi, %rsi, %rdx, %rcx, %r8, %r9).

These ABI also specify different sets of registers that must be preserved
across function calls (callee-saved).

GCC allows using the Microsoft calling convention by adding the ms_abi
attribute to a function declaration.

Current EFI implementation in U-Boot specifies EFIAPI for efi_main()
in the test apps but uses default calling convention in lib/efi.
The arguments of efi_main() are also passed as unused arguments to the
_relocate() function.

Save efi_main() arguments in the startup code on x86_64;
use EFI calling convention for _relocate() on x86_64;
remove unused _relocate() arguments;
consistently use EFI calling convention for efi_main() everywhere.

v4:
  Keeping .exit label in x86_64 startup code;
  Also removed the unused _relocate() arguments for arm, x86, riscv.

v3:
  Updated patch description.

v2:
  Added EFIABI to _relocate() declaration.

Ivan Gorinov (4):
  x86: use EFI calling convention for efi_main on x86_64
  arm: Remove unused _relocate arguments
  x86: Remove unused _relocate arguments
  riscv: Remove unused _relocate arguments

 arch/arm/lib/crt0_aarch64_efi.S  |  2 --
 arch/arm/lib/crt0_arm_efi.S      |  2 --
 arch/arm/lib/reloc_aarch64_efi.c |  3 +--
 arch/arm/lib/reloc_arm_efi.c     |  3 +--
 arch/riscv/lib/reloc_riscv_efi.c |  3 +--
 arch/x86/lib/crt0_x86_64_efi.S   | 21 ++++++++++-----------
 arch/x86/lib/reloc_ia32_efi.c    |  3 +--
 arch/x86/lib/reloc_x86_64_efi.c  |  3 +--
 lib/efi/efi_app.c                |  3 ++-
 lib/efi/efi_stub.c               |  3 ++-
 10 files changed, 19 insertions(+), 27 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-06-22  1:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 17:51 [U-Boot] [PATCH v4 0/4] x86: use EFI calling convention for efi_main on x86_64 Ivan Gorinov
2018-06-12 17:52 ` [U-Boot] [PATCH v4 1/4] " Ivan Gorinov
2018-06-13  1:36   ` Bin Meng
2018-06-22  1:44     ` Bin Meng
2018-06-12 17:52 ` [U-Boot] [PATCH v4 2/4] arm: Remove unused _relocate arguments Ivan Gorinov
2018-06-13  1:38   ` Bin Meng
2018-06-12 17:52 ` [U-Boot] [PATCH v4 3/4] x86: " Ivan Gorinov
2018-06-12 17:52 ` [U-Boot] [PATCH v4 4/4] riscv: " Ivan Gorinov
2018-06-13  1:38   ` Bin Meng
2018-06-12 18:56 ` [U-Boot] [PATCH v4 0/4] x86: use EFI calling convention for efi_main on x86_64 Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.