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
This commit is contained in:
andrewfish
2010-07-29 03:24:13 +00:00
parent 712a5698a6
commit a4902cccdf
10 changed files with 761 additions and 7967 deletions

View File

@@ -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