diff options
Diffstat (limited to 'MdePkg/Library')
-rw-r--r-- | MdePkg/Library/BaseLib/X64/Thunk16.S | 6 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/X64/Thunk16.asm | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.S b/MdePkg/Library/BaseLib/X64/Thunk16.S index a521aff31b..f592a2868c 100644 --- a/MdePkg/Library/BaseLib/X64/Thunk16.S +++ b/MdePkg/Library/BaseLib/X64/Thunk16.S @@ -146,8 +146,8 @@ L_64Eip: .space 4 L_SavedCs: .space 2
L_64BitCode:
.byte 0x90
- .byte 0x67,0xbc # mov esp, imm32
-L_SavedSp: .space 4 # restore stack
+ .byte 0x48,0xbc # mov rsp, imm64
+L_SavedSp: .space 8 # restore stack
nop
ret
@@ -307,7 +307,7 @@ ASM_PFX(InternalAsmThunk16): pushq %r8
movl %cs, %r8d
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)
.set Ltemp1, _EntryPoint - L_SavedCr4
.byte Ltemp1
diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.asm b/MdePkg/Library/BaseLib/X64/Thunk16.asm index 01051341f6..e01de272d2 100644 --- a/MdePkg/Library/BaseLib/X64/Thunk16.asm +++ b/MdePkg/Library/BaseLib/X64/Thunk16.asm @@ -142,8 +142,8 @@ SavedCr0 DD ? SavedCs DW ?
@64BitCode:
db 090h
- db 067h, 0bch ; mov esp, imm32
-SavedSp DD ? ; restore stack
+ db 048h, 0bch ; mov rsp, imm64
+SavedSp DQ ? ; restore stack
nop
ret
_BackFromUserCode ENDP
@@ -294,7 +294,7 @@ InternalAsmThunk16 PROC USES rbp rbx rsi rdi push r8
mov r8d, cs
mov [rcx + (SavedCs - SavedCr4)], r8w
- mov [rcx + (SavedSp - SavedCr4)], esp
+ mov [rcx + (SavedSp - SavedCr4)], rsp
jmp fword ptr [rcx + (_EntryPoint - SavedCr4)]
@RetFromRealMode:
popfq
|