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