]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/Sec/X64/SwitchStack.S
Adding Simple Pointer, GOP, SimpleTextInEx, and Networking protocols to the emulator...
[mirror_edk2.git] / UnixPkg / Sec / X64 / SwitchStack.S
index dfb618b39572bc504bc1010d6ef74fcfba484a7b..e964e4d178b950bb521b4fa4ca60eb5cbd1d303e 100644 (file)
@@ -39,7 +39,9 @@
 #------------------------------------------------------------------------------\r
 ASM_GLOBAL ASM_PFX(PeiSwitchStacks)\r
 ASM_PFX(PeiSwitchStacks):\r
-//  movq    %rdx, %rdx   \r
+         pushq   %rbp            // stack frame is for the debugger\r
+       movq    %rsp, %rbp\r
+\r
     movq    %r8,  %rsp\r
     \r
     movq    %rdi, %rax\r
@@ -50,7 +52,7 @@ ASM_PFX(PeiSwitchStacks):
     # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,\r
     # in case the callee wishes to spill them.\r
     #\r
-         subq    $40, %rsp  // 32-byte shadow space plus alignment pad\r
+         subq    $32, %rsp  // 32-byte shadow space plus alignment pad\r
     call    *%rax\r
 \r
 \r
@@ -74,6 +76,9 @@ ASM_PFX(PeiSwitchStacks):
 #------------------------------------------------------------------------------\r
 ASM_GLOBAL ASM_PFX(UnixPeiSwitchStacks)\r
 ASM_PFX(UnixPeiSwitchStacks):\r
+         pushq   %rbp            // stack frame is for the debugger\r
+       movq    %rsp, %rbp\r
+\r
     mov     %rdi, %rax\r
     mov     %rsi, %rdi\r
     mov     %rdx, %rsi\r
@@ -100,12 +105,16 @@ ASM_PFX(UnixPeiSwitchStacks):
 #------------------------------------------------------------------------------    \r
 ASM_GLOBAL ASM_PFX(SecSwitchStack)\r
 ASM_PFX(SecSwitchStack):\r
+       pushq   %rbp            // stack frame is for the debugger\r
+  movq    %rsp, %rbp\r
 \r
   mov     %rsp, %rax\r
   sub     %rdi, %rax\r
   add     %rsi, %rax\r
   mov    (%rip), %r10\r
   mov    %r10, (%rax) \r
+  \r
+  popq   %rbp\r
   ret\r
   \r
   
\ No newline at end of file