]>
Commit | Line | Data |
---|---|---|
49ba9447 | 1 | ;------------------------------------------------------------------------------\r |
2 | ;*\r | |
7cb6b0e0 | 3 | ;* Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r |
b26f0cf9 | 4 | ;* SPDX-License-Identifier: BSD-2-Clause-Patent\r |
49ba9447 | 5 | ;*\r |
6 | ;* CpuAsm.asm\r | |
7 | ;*\r | |
8 | ;* Abstract:\r | |
9 | ;*\r | |
10 | ;------------------------------------------------------------------------------\r | |
11 | \r | |
42a83e80 | 12 | #include <Base.h>\r |
49ba9447 | 13 | \r |
ba29ed09 | 14 | SECTION .text\r |
49ba9447 | 15 | \r |
ba29ed09 | 16 | extern ASM_PFX(SecCoreStartupWithStack)\r |
49ba9447 | 17 | \r |
18 | ;\r | |
0913fadc | 19 | ; SecCore Entry Point\r |
49ba9447 | 20 | ;\r |
0913fadc | 21 | ; Processor is in flat protected mode\r |
49ba9447 | 22 | ;\r |
0913fadc | 23 | ; @param[in] EAX Initial value of the EAX register (BIST: Built-in Self Test)\r |
24 | ; @param[in] DI 'BP': boot-strap processor, or 'AP': application processor\r | |
25 | ; @param[in] EBP Pointer to the start of the Boot Firmware Volume\r | |
9d9350a5 LE |
26 | ; @param[in] DS Selector allowing flat access to all addresses\r |
27 | ; @param[in] ES Selector allowing flat access to all addresses\r | |
28 | ; @param[in] FS Selector allowing flat access to all addresses\r | |
29 | ; @param[in] GS Selector allowing flat access to all addresses\r | |
30 | ; @param[in] SS Selector allowing flat access to all addresses\r | |
49ba9447 | 31 | ;\r |
0913fadc | 32 | ; @return None This routine does not return\r |
49ba9447 | 33 | ;\r |
ba29ed09 JJ |
34 | global ASM_PFX(_ModuleEntryPoint)\r |
35 | ASM_PFX(_ModuleEntryPoint):\r | |
49ba9447 | 36 | \r |
9d9350a5 LE |
37 | ;\r |
38 | ; Fill the temporary RAM with the initial stack value.\r | |
39 | ; The loop below will seed the heap as well, but that's harmless.\r | |
40 | ;\r | |
41 | mov eax, FixedPcdGet32 (PcdInitValueInTempStack) ; dword to store\r | |
42 | mov edi, FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) ; base address,\r | |
43 | ; relative to\r | |
44 | ; ES\r | |
45 | mov ecx, FixedPcdGet32 (PcdOvmfSecPeiTempRamSize) / 4 ; dword count\r | |
46 | cld ; store from base\r | |
47 | ; up\r | |
48 | rep stosd\r | |
49 | \r | |
49ba9447 | 50 | ;\r |
7cb6b0e0 | 51 | ; Load temporary RAM stack based on PCDs\r |
49ba9447 | 52 | ;\r |
ba29ed09 | 53 | %define SEC_TOP_OF_STACK (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + \\r |
7cb6b0e0 JJ |
54 | FixedPcdGet32 (PcdOvmfSecPeiTempRamSize))\r |
55 | mov eax, SEC_TOP_OF_STACK\r | |
49ba9447 | 56 | mov esp, eax\r |
57 | nop\r | |
58 | \r | |
59 | ;\r | |
7cb6b0e0 JJ |
60 | ; Setup parameters and call SecCoreStartupWithStack\r |
61 | ; [esp] return address for call\r | |
62 | ; [esp+4] BootFirmwareVolumePtr\r | |
63 | ; [esp+8] TopOfCurrentStack\r | |
49ba9447 | 64 | ;\r |
65 | push eax\r | |
49ba9447 | 66 | push ebp\r |
ba29ed09 | 67 | call ASM_PFX(SecCoreStartupWithStack)\r |
49ba9447 | 68 | \r |