]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Sec/Ia32/SecEntry.nasm
OvmfPkg/Sec/Ia32: seed the temporary RAM with PcdInitValueInTempStack
[mirror_edk2.git] / OvmfPkg / Sec / Ia32 / SecEntry.nasm
index 7fee1c2b2e4ff1f12f016209bc901aa59fcf7cbb..03501969ebcececcfb97e25790f8eb01c1516b4b 100644 (file)
@@ -29,12 +29,30 @@ extern ASM_PFX(SecCoreStartupWithStack)
 ; @param[in]  EAX   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]  EBP   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     eax, FixedPcdGet32 (PcdInitValueInTempStack)      ; dword to store\r
+    mov     edi, FixedPcdGet32 (PcdOvmfSecPeiTempRamBase)     ; base address,\r
+                                                              ;   relative to\r
+                                                              ;   ES\r
+    mov     ecx, FixedPcdGet32 (PcdOvmfSecPeiTempRamSize) / 4 ; dword count\r
+    cld                                                       ; store from base\r
+                                                              ;   up\r
+    rep stosd\r
+\r
     ;\r
     ; Load temporary RAM stack based on PCDs\r
     ;\r