From b9c8e50e2054fc21c2029db309f813d03ccd6082 Mon Sep 17 00:00:00 2001 From: andrewfish Date: Thu, 22 Jul 2010 21:21:38 +0000 Subject: Port UnixPkg to also support X64. Currently only supports Unix x86_64 ABI. In the future we can make Sec support x86_64 ABI and the rest of the code support X64 EFI ABI. This will require assembly gaskets to fix the calling convention differences. I currently have noop gaskets in place for x86_64 ABI. This has only been tested on OS X 10.6. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10685 6f19259b-4bc3-4df7-8a09-765794883524 --- UnixPkg/Sec/Ia32/Gasket.S | 20 ++++++++++++++++++-- UnixPkg/Sec/Ia32/GasketTemplate.c | 9 +++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 'UnixPkg/Sec/Ia32') diff --git a/UnixPkg/Sec/Ia32/Gasket.S b/UnixPkg/Sec/Ia32/Gasket.S index f9a2b53faf..caeabf89eb 100644 --- a/UnixPkg/Sec/Ia32/Gasket.S +++ b/UnixPkg/Sec/Ia32/Gasket.S @@ -16,7 +16,7 @@ # on Leopard and _stat$INDOE64 on Snow Leopard. That is why we pass stat() # into one of these gaskets from C code. # -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -235,7 +235,23 @@ _GasketUintnUint16: call *%eax leave ret - +.globl _ReverseGasketUint64 +_ReverseGasketUint64: + pushl %ebp + movl %esp, %ebp + subl $56, %esp + movl 12(%ebp), %eax + movl %eax, -32(%ebp) + movl 16(%ebp), %eax + movl %eax, -28(%ebp) + movl 8(%ebp), %eax + movl %eax, -12(%ebp) + movl -32(%ebp), %eax + movl %eax, (%esp) + movl -12(%ebp), %eax + call *%eax + leave + ret .subsections_via_symbols #endif diff --git a/UnixPkg/Sec/Ia32/GasketTemplate.c b/UnixPkg/Sec/Ia32/GasketTemplate.c index c9824de6ba..8ff801d72e 100644 --- a/UnixPkg/Sec/Ia32/GasketTemplate.c +++ b/UnixPkg/Sec/Ia32/GasketTemplate.c @@ -138,5 +138,14 @@ GasketUintnUint16 (void *api, UINTN a, UINT16 b) return func (a, b); } +void +ReverseGasketUint64 (void *api, UINT64 a) +{ + GASKET_UINTN func; + + func = (GASKET_UINTN)api; + func (a); + return; +} -- cgit v1.2.3