summaryrefslogtreecommitdiff
path: root/UnixPkg/Sec/X64/SwitchStack.S
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-29 03:24:13 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-29 03:24:13 +0000
commita4902cccdf477e93a55d6211fcb7a071bb48b71c (patch)
treedc61a7914f89038be9cfd4c1465b4bab91ffc7be /UnixPkg/Sec/X64/SwitchStack.S
parent712a5698a6edd14d8247132cbbbe63da1ea69bf0 (diff)
downloadedk2-platforms-a4902cccdf477e93a55d6211fcb7a071bb48b71c.tar.xz
Complete coding to support X64 EFI ABI in UnixPkg. Code is not currently hooked in or tested, but it is code complete. Only missing step from testing is figuring out how to build with two different ABIs for the same platform. Sec needs a different ABI. May need to add a 2nd build step.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10710 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/Sec/X64/SwitchStack.S')
-rw-r--r--UnixPkg/Sec/X64/SwitchStack.S28
1 files changed, 14 insertions, 14 deletions
diff --git a/UnixPkg/Sec/X64/SwitchStack.S b/UnixPkg/Sec/X64/SwitchStack.S
index acc3df232c..9f62e71cef 100644
--- a/UnixPkg/Sec/X64/SwitchStack.S
+++ b/UnixPkg/Sec/X64/SwitchStack.S
@@ -22,35 +22,35 @@
# Routine Description:
#
# Routine for switching stacks with 3 parameters EFI ABI
+# Convert UNIX to EFI ABI
#
# Arguments:
#
-# (rcx) EntryPoint - Entry point with new stack.
-# (rdx) Context1 - Parameter1 for entry point.
-# (r8) Context2 - Parameter2 for entry point.
-# (r9) Context3 - Parameter3 for entry point.
-# (rsp)0x20 NewStack - The pointer to new stack.
+# (rdi) EntryPoint - Entry point with new stack.
+# (rsi) Context1 - Parameter1 for entry point. (rcx)
+# (rdx) Context2 - Parameter2 for entry point. (rdx)
+# (rcx) Context3 - Parameter3 for entry point. (r8)
+# (r8) NewStack - The pointer to new stack.
#
# Returns:
#
# None
#
#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(MsftPeiSwitchStacks)
-ASM_PFX(MsftPeiSwitchStacks):
- mov %rcx, %rax
- mov %rdx, %rcx
- mov %r8, %rdx
- mov %r9, %r8
+ASM_GLOBAL ASM_PFX(GasketPeiSwitchStacks)
+ASM_PFX(GasketPeiSwitchStacks):
+// movq %rdx, %rdx
+ movq %r8, %rsp
- # get new stack from the stack
- mov 0x20(%rsp), %rsp # is this off by 8?
+ movq %rdi, %rax
+ movq %rsi, %rcx
+ movq %rcx, %r8
#
# Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
# in case the callee wishes to spill them.
#
- lea -0x20(%rsp), %rsp
+ subq 40, %rsp // 32-byte shadow space plus alignment pad
call *%rax