mirror of https://github.com/acidanthera/audk.git
Use rsp instead of esp to save 64-bit stack pointer.
Signed-off-by: Elvin Li <elvin.li@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14812 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d1edec0a33
commit
a93b0e3f68
|
@ -146,8 +146,8 @@ L_64Eip: .space 4
|
||||||
L_SavedCs: .space 2
|
L_SavedCs: .space 2
|
||||||
L_64BitCode:
|
L_64BitCode:
|
||||||
.byte 0x90
|
.byte 0x90
|
||||||
.byte 0x67,0xbc # mov esp, imm32
|
.byte 0x48,0xbc # mov rsp, imm64
|
||||||
L_SavedSp: .space 4 # restore stack
|
L_SavedSp: .space 8 # restore stack
|
||||||
nop
|
nop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ ASM_PFX(InternalAsmThunk16):
|
||||||
pushq %r8
|
pushq %r8
|
||||||
movl %cs, %r8d
|
movl %cs, %r8d
|
||||||
movw %r8w, (L_SavedCs - L_SavedCr4)(%rcx)
|
movw %r8w, (L_SavedCs - L_SavedCr4)(%rcx)
|
||||||
movl %esp, (L_SavedSp - L_SavedCr4)(%rcx)
|
movq %rsp, (L_SavedSp - L_SavedCr4)(%rcx)
|
||||||
.byte 0xff, 0x69 # jmp (_EntryPoint - L_SavedCr4)(%rcx)
|
.byte 0xff, 0x69 # jmp (_EntryPoint - L_SavedCr4)(%rcx)
|
||||||
.set Ltemp1, _EntryPoint - L_SavedCr4
|
.set Ltemp1, _EntryPoint - L_SavedCr4
|
||||||
.byte Ltemp1
|
.byte Ltemp1
|
||||||
|
|
|
@ -142,8 +142,8 @@ SavedCr0 DD ?
|
||||||
SavedCs DW ?
|
SavedCs DW ?
|
||||||
@64BitCode:
|
@64BitCode:
|
||||||
db 090h
|
db 090h
|
||||||
db 067h, 0bch ; mov esp, imm32
|
db 048h, 0bch ; mov rsp, imm64
|
||||||
SavedSp DD ? ; restore stack
|
SavedSp DQ ? ; restore stack
|
||||||
nop
|
nop
|
||||||
ret
|
ret
|
||||||
_BackFromUserCode ENDP
|
_BackFromUserCode ENDP
|
||||||
|
@ -294,7 +294,7 @@ InternalAsmThunk16 PROC USES rbp rbx rsi rdi
|
||||||
push r8
|
push r8
|
||||||
mov r8d, cs
|
mov r8d, cs
|
||||||
mov [rcx + (SavedCs - SavedCr4)], r8w
|
mov [rcx + (SavedCs - SavedCr4)], r8w
|
||||||
mov [rcx + (SavedSp - SavedCr4)], esp
|
mov [rcx + (SavedSp - SavedCr4)], rsp
|
||||||
jmp fword ptr [rcx + (_EntryPoint - SavedCr4)]
|
jmp fword ptr [rcx + (_EntryPoint - SavedCr4)]
|
||||||
@RetFromRealMode:
|
@RetFromRealMode:
|
||||||
popfq
|
popfq
|
||||||
|
|
Loading…
Reference in New Issue