summaryrefslogtreecommitdiff
path: root/UnixPkg/Sec/Ia32
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-22 21:21:38 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-22 21:21:38 +0000
commitb9c8e50e2054fc21c2029db309f813d03ccd6082 (patch)
tree63828888a832dc738d34a430be7e592baf4ee65d /UnixPkg/Sec/Ia32
parent92a4f6f3c7898c4d4bc54cdd0fa6734b1a352269 (diff)
downloadedk2-platforms-b9c8e50e2054fc21c2029db309f813d03ccd6082.tar.xz
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
Diffstat (limited to 'UnixPkg/Sec/Ia32')
-rw-r--r--UnixPkg/Sec/Ia32/Gasket.S20
-rw-r--r--UnixPkg/Sec/Ia32/GasketTemplate.c9
2 files changed, 27 insertions, 2 deletions
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.<BR>
+# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
# 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;
+}