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