]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm
IntelFsp2Pkg: FspSecCore support for X64
[mirror_edk2.git] / IntelFsp2Pkg / Library / BaseFspSwitchStackLib / X64 / Stack.nasm
index bd36fe4b8b867868c015faa4dc10f85b9c351a94..1ea1220608ef51a91c33ad2cc341a48b74e2dd56 100644 (file)
@@ -47,7 +47,8 @@ ASM_PFX(Loader2PeiSwitchStack):
 ;------------------------------------------------------------------------------\r
 global ASM_PFX(FspSwitchStack)\r
 ASM_PFX(FspSwitchStack):\r
-    ; Save current contexts\r
+    ; Save current contexts. The format must align with CONTEXT_STACK_64.\r
+    push    rdx     ; Reserved QWORD for stack alignment\r
     push    rdx     ; ApiParam2\r
     push    rcx     ; ApiParam1\r
     push    rax     ; FspInfoHeader\r
@@ -67,6 +68,6 @@ ASM_PFX(FspSwitchStack):
     add     rsp, 16\r
     POPA_64\r
     popfq\r
-    add     rsp, 24 ; FspInfoHeader + ApiParam[2]\r
+    add     rsp, 32 ; FspInfoHeader + ApiParam[2] + Reserved QWORD\r
     ret\r
 \r