]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.c
MdePkg: Clean up source files
[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 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15
16 #include <PiPei.h>
17
18 //
19 // The Library classes this module produced
20 //
21 #include <Library/PeiCoreEntryPoint.h>
22 #include <Library/BaseLib.h>
23 #include <Library/DebugLib.h>
24
25 /**
26 The entry point of PE/COFF Image for the PEI Core.
27
28 This function is the entry point for the PEI Foundation, which allows the SEC phase
29 to pass information about the stack, temporary RAM and the Boot Firmware Volume.
30 In addition, it also allows the SEC phase to pass services and data forward for use
31 during the PEI phase in the form of one or more PPIs.
32 There is no limit to the number of additional PPIs that can be passed from SEC into
33 the PEI Foundation. As part of its initialization phase, the PEI Foundation will add
34 these SEC-hosted PPIs to its PPI database such that both the PEI Foundation and any
35 modules can leverage the associated service calls and/or code in these early PPIs.
36 This function is required to call ProcessModuleEntryPointList() with the Context
37 parameter set to NULL. ProcessModuleEntryPoint() is never expected to return.
38 The PEI Core is responsible for calling ProcessLibraryConstructorList() as soon as
39 the PEI Services Table and the file handle for the PEI Core itself have been established.
40 If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.
41
42 @param SecCoreData Points to a data structure containing information about the
43 PEI core's operating environment, such as the size and
44 location of temporary RAM, the stack location and the BFV
45 location.
46
47 @param PpiList Points to a list of one or more PPI descriptors to be
48 installed initially by the PEI core. An empty PPI list
49 consists of a single descriptor with the end-tag
50 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
51 As part of its initialization phase, the PEI Foundation will
52 add these SEC-hosted PPIs to its PPI database, such that both
53 the PEI Foundation and any modules can leverage the associated
54 service calls and/or code in these early PPIs.
55
56 **/
57 VOID
58 EFIAPI
59 _ModuleEntryPoint(
60 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
61 IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
62 )
63 {
64 ProcessModuleEntryPointList (SecCoreData, PpiList, NULL);
65
66 //
67 // Should never return
68 //
69 ASSERT(FALSE);
70 CpuDeadLoop ();
71 }
72
73
74 /**
75 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
76
77 This function is required to call _ModuleEntryPoint() passing in SecCoreData and PpiList.
78
79 @param SecCoreData Points to a data structure containing information about the PEI core's
80 operating environment, such as the size and location of temporary RAM,
81 the stack location and the BFV location.
82
83 @param PpiList Points to a list of one or more PPI descriptors to be installed
84 initially by the PEI core. An empty PPI list consists of
85 a single descriptor with the end-tag
86 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
87 As part of its initialization phase, the PEI Foundation will
88 add these SEC-hosted PPIs to its PPI database, such that both
89 the PEI Foundationand any modules can leverage the associated
90 service calls and/or code in these early PPIs.
91
92 **/
93 VOID
94 EFIAPI
95 EfiMain (
96 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
97 IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
98 )
99 {
100 _ModuleEntryPoint (SecCoreData, PpiList);
101 }