]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Sec/X64/SecEntry.nasm
OvmfPkg/Sec: Fix 64bit SEC build failure
[mirror_edk2.git] / OvmfPkg / Sec / X64 / SecEntry.nasm
index f40427aa8e04f0c896f6b2826c4ae36f9c48c01c..d76adcffd82ea2676c6fbef79034a24ff976f0d6 100644 (file)
@@ -30,12 +30,31 @@ extern ASM_PFX(SecCoreStartupWithStack)
 ; @param[in]  RAX   Initial value of the EAX register (BIST: Built-in Self Test)\r
 ; @param[in]  DI    'BP': boot-strap processor, or 'AP': application processor\r
 ; @param[in]  RBP   Pointer to the start of the Boot Firmware Volume\r
+; @param[in]  DS    Selector allowing flat access to all addresses\r
+; @param[in]  ES    Selector allowing flat access to all addresses\r
+; @param[in]  FS    Selector allowing flat access to all addresses\r
+; @param[in]  GS    Selector allowing flat access to all addresses\r
+; @param[in]  SS    Selector allowing flat access to all addresses\r
 ;\r
 ; @return     None  This routine does not return\r
 ;\r
 global ASM_PFX(_ModuleEntryPoint)\r
 ASM_PFX(_ModuleEntryPoint):\r
 \r
+    ;\r
+    ; Fill the temporary RAM with the initial stack value.\r
+    ; The loop below will seed the heap as well, but that's harmless.\r
+    ;\r
+    mov     rax, (FixedPcdGet32 (PcdInitValueInTempStack) << 32) | FixedPcdGet32 (PcdInitValueInTempStack)\r
+                                                              ; qword to store\r
+    mov     rdi, FixedPcdGet32 (PcdOvmfSecPeiTempRamBase)     ; base address,\r
+                                                              ;   relative to\r
+                                                              ;   ES\r
+    mov     rcx, FixedPcdGet32 (PcdOvmfSecPeiTempRamSize) / 8 ; qword count\r
+    cld                                                       ; store from base\r
+                                                              ;   up\r
+    rep stosq\r
+\r
     ;\r
     ; Load temporary RAM stack based on PCDs\r
     ;\r