Fix bug that home addresses for register parameters must be allocated for calling C function from X64 assembly code to follow x64 calling convention.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9303 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
rsun3 2009-09-22 09:19:59 +00:00
parent 60bd4ccd45
commit 82dae5efb3
3 changed files with 4 additions and 0 deletions

View File

@ -31,7 +31,9 @@ EXTERNDEF InternalX86GetApicBase:PROC
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
CpuInitLocalApicTimer PROC CpuInitLocalApicTimer PROC
sub rsp, 28h ;Reserve home addresses and make RSP 16-byte aligned
call InternalX86GetApicBase call InternalX86GetApicBase
add rsp, 28h
mov dword ptr [rax + 3e0h], 0ah mov dword ptr [rax + 3e0h], 0ah
bts dword ptr [rax + 320h], 17 bts dword ptr [rax + 320h], 17
mov dword ptr [rax + 380h], -1 mov dword ptr [rax + 380h], -1

View File

@ -55,5 +55,6 @@ ASM_PFX(_ModuleEntryPoint):
movq %rsi, %rdx movq %rsi, %rdx
movq %rdi, %r8 movq %rdi, %r8
movq %rsp, %r9 movq %rsp, %r9
subq $0x20, %rsp
call ASM_PFX(SecCoreStartupWithStack) call ASM_PFX(SecCoreStartupWithStack)

View File

@ -54,6 +54,7 @@ _ModuleEntryPoint PROC PUBLIC
mov rdx, rsi mov rdx, rsi
mov r8, rdi mov r8, rdi
mov r9, rsp mov r9, rsp
sub rsp, 20h
call SecCoreStartupWithStack call SecCoreStartupWithStack
_ModuleEntryPoint ENDP _ModuleEntryPoint ENDP