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