diff options
author | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-08-18 20:24:08 +0000 |
---|---|---|
committer | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-08-18 20:24:08 +0000 |
commit | bb111c2346bef02c18b30acced3f7b0311bbfe21 (patch) | |
tree | 496916a37849ea45a4083848501de061a2b98732 /UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S | |
parent | 6989af71680fc69024e68a0ab6d8284f0c4909fc (diff) | |
download | edk2-platforms-bb111c2346bef02c18b30acced3f7b0311bbfe21.tar.xz |
Added support for an EFI X64 ABI compatible UnixPkg. With an internal only compiler I've been able to run checked in X64 EFI shell binary! We are hoping to get the open source LLVM compiler working for this... Since the SEC has to be UNIX ABI to make the POSIX calls it is compiled using a different compiler and the rest of the UnixPkg is compiled with UNIXPKG tool. You just need to point UNIXPKG at your EFI X64 ABI compiler of choice, it should work like MYTOOLS. Some one may want to port this to Linux at some point. To build cd into UnixPkg and ./build64.sh
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10806 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S')
-rw-r--r-- | UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S b/UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S index b6dff5ed77..3a84b0d22f 100644 --- a/UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S +++ b/UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S @@ -35,45 +35,17 @@ # None
#
#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(EfiInternalSwitchStack)
-ASM_PFX(EfiInternalSwitchStack):
- mov %rcx, %rax
- mov %rdx, %rcx
- mov %r8, %rdx
- #
- # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
- # in case the callee wishes to spill them.
- #
- lea -0x20(%r9), %rsp
- call *%rax
-
-
-
-#------------------------------------------------------------------------------
-# Routine Description:
-#
-# Routine for switching stacks with 2 parameters (Unix ABI)
-#
-# Arguments:
-#
-# (rdi) EntryPoint - Entry point with new stack.
-# (rsi) Context1 - Parameter1 for entry point.
-# (rdx) Context2 - Parameter2 for entry point.
-# (rcx) NewStack - The pointer to new stack.
-#
-# Returns:
-#
-# None
-#
-#------------------------------------------------------------------------------
ASM_GLOBAL ASM_PFX(InternalSwitchStack)
ASM_PFX(InternalSwitchStack):
- mov %rdi, %rax
- mov %rsi, %rdi
- mov %rdx, %rsi
+ movq %rcx, %rax
+ movq %rdx, %rcx
+ movq %r8, %rdx
+ movq %r9, %rsp
+
#
# Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
# in case the callee wishes to spill them.
#
- lea -0x20(%rcx), %rsp
+ subq $40, %rsp // 32-byte shadow space plus alignment pad
+
call *%rax
|