]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/X64/Thunk16.S
Use rsp instead of esp to save 64-bit stack pointer.
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / Thunk16.S
index a521aff31b3bcf34bcb5a142ce0dd00f69e225d6..f592a2868c261dc4bdc90dc1b1ebcc6d6864bfc7 100644 (file)
@@ -146,8 +146,8 @@ L_64Eip:    .space      4
 L_SavedCs:  .space      2\r
 L_64BitCode:\r
     .byte   0x90\r
-    .byte   0x67,0xbc                  # mov esp, imm32\r
-L_SavedSp:  .space      4              # restore stack\r
+    .byte   0x48,0xbc                  # mov rsp, imm64\r
+L_SavedSp:  .space      8              # restore stack\r
     nop\r
     ret\r
 \r
@@ -307,7 +307,7 @@ ASM_PFX(InternalAsmThunk16):
     pushq   %r8\r
     movl    %cs, %r8d\r
     movw    %r8w, (L_SavedCs - L_SavedCr4)(%rcx)\r
-    movl    %esp, (L_SavedSp - L_SavedCr4)(%rcx)\r
+    movq    %rsp, (L_SavedSp - L_SavedCr4)(%rcx)\r
     .byte   0xff, 0x69                  #  jmp (_EntryPoint - L_SavedCr4)(%rcx)\r
     .set    Ltemp1, _EntryPoint - L_SavedCr4\r
     .byte   Ltemp1\r