1 ;------------------------------------------------------------------------------
3 ;* Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
4 ;* SPDX-License-Identifier: BSD-2-Clause-Patent
10 ;------------------------------------------------------------------------------
17 extern ASM_PFX(SecCoreStartupWithStack)
22 ; Processor is in flat protected mode
24 ; @param[in] RAX Initial value of the EAX register (BIST: Built-in Self Test)
25 ; @param[in] DI 'BP': boot-strap processor, or 'AP': application processor
26 ; @param[in] RBP Pointer to the start of the Boot Firmware Volume
27 ; @param[in] DS Selector allowing flat access to all addresses
28 ; @param[in] ES Selector allowing flat access to all addresses
29 ; @param[in] FS Selector allowing flat access to all addresses
30 ; @param[in] GS Selector allowing flat access to all addresses
31 ; @param[in] SS Selector allowing flat access to all addresses
33 ; @return None This routine does not return
35 global ASM_PFX(_ModuleEntryPoint)
36 ASM_PFX(_ModuleEntryPoint):
39 ; Fill the temporary RAM with the initial stack value.
40 ; The loop below will seed the heap as well, but that's harmless.
42 mov rax, (FixedPcdGet32 (PcdInitValueInTempStack) << 32) | FixedPcdGet32 (PcdInitValueInTempStack)
44 mov rdi, FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) ; base address,
47 mov rcx, FixedPcdGet32 (PcdOvmfSecPeiTempRamSize) / 8 ; qword count
53 ; Load temporary RAM stack based on PCDs
55 %define SEC_TOP_OF_STACK (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + \
56 FixedPcdGet32 (PcdOvmfSecPeiTempRamSize))
57 mov rsp, SEC_TOP_OF_STACK
61 ; Setup parameters and call SecCoreStartupWithStack
62 ; rcx: BootFirmwareVolumePtr
63 ; rdx: TopOfCurrentStack
68 call ASM_PFX(SecCoreStartupWithStack)