]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / PeiCoreEntryPoint / PeiCoreEntryPoint.c
1 /** @file
2 Entry point to a the PEI Core.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <PiPei.h>
10
11 //
12 // The Library classes this module produced
13 //
14 #include <Library/PeiCoreEntryPoint.h>
15 #include <Library/BaseLib.h>
16 #include <Library/DebugLib.h>
17
18 /**
19 The entry point of PE/COFF Image for the PEI Core.
20
21 This function is the entry point for the PEI Foundation, which allows the SEC phase
22 to pass information about the stack, temporary RAM and the Boot Firmware Volume.
23 In addition, it also allows the SEC phase to pass services and data forward for use
24 during the PEI phase in the form of one or more PPIs.
25 There is no limit to the number of additional PPIs that can be passed from SEC into
26 the PEI Foundation. As part of its initialization phase, the PEI Foundation will add
27 these SEC-hosted PPIs to its PPI database such that both the PEI Foundation and any
28 modules can leverage the associated service calls and/or code in these early PPIs.
29 This function is required to call ProcessModuleEntryPointList() with the Context
30 parameter set to NULL. ProcessModuleEntryPoint() is never expected to return.
31 The PEI Core is responsible for calling ProcessLibraryConstructorList() as soon as
32 the PEI Services Table and the file handle for the PEI Core itself have been established.
33 If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.
34
35 @param SecCoreData Points to a data structure containing information about the
36 PEI core's operating environment, such as the size and
37 location of temporary RAM, the stack location and the BFV
38 location.
39
40 @param PpiList Points to a list of one or more PPI descriptors to be
41 installed initially by the PEI core. An empty PPI list
42 consists of a single descriptor with the end-tag
43 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
44 As part of its initialization phase, the PEI Foundation will
45 add these SEC-hosted PPIs to its PPI database, such that both
46 the PEI Foundation and any modules can leverage the associated
47 service calls and/or code in these early PPIs.
48
49 **/
50 VOID
51 EFIAPI
52 _ModuleEntryPoint (
53 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
54 IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
55 )
56 {
57 ProcessModuleEntryPointList (SecCoreData, PpiList, NULL);
58
59 //
60 // Should never return
61 //
62 ASSERT (FALSE);
63 CpuDeadLoop ();
64 }
65
66 /**
67 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
68
69 This function is required to call _ModuleEntryPoint() passing in SecCoreData and PpiList.
70
71 @param SecCoreData Points to a data structure containing information about the PEI core's
72 operating environment, such as the size and location of temporary RAM,
73 the stack location and the BFV location.
74
75 @param PpiList Points to a list of one or more PPI descriptors to be installed
76 initially by the PEI core. An empty PPI list consists of
77 a single descriptor with the end-tag
78 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
79 As part of its initialization phase, the PEI Foundation will
80 add these SEC-hosted PPIs to its PPI database, such that both
81 the PEI Foundationand any modules can leverage the associated
82 service calls and/or code in these early PPIs.
83
84 **/
85 VOID
86 EFIAPI
87 EfiMain (
88 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
89 IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
90 )
91 {
92 _ModuleEntryPoint (SecCoreData, PpiList);
93 }