e386b444 |
1 | /** @file\r |
2 | Entry point to a the PEI Core.\r |
3 | \r |
c7d265a9 |
4 | Copyright (c) 2006 - 2007, Intel Corporation<BR>\r |
e386b444 |
5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r |
8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT 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 |
42 | @param SecCoreData Points to a data structure containing information about the PEI\r |
43 | core's operating environment, such as the size and location of\r |
44 | temporary RAM, the stack location and the BFV location. \r |
45 | \r |
46 | @param PpiList Points to a list of one or more PPI descriptors to be installed\r |
47 | initially by the PEI core. An empty PPI list consists of a single\r |
48 | descriptor with the end-tag EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r |
49 | As part of its initialization phase, the PEI Foundation will add\r |
50 | these SEC-hosted PPIs to its PPI database such that both the PEI\r |
51 | Foundation and any modules can leverage the associated service calls\r |
52 | and/or code in these early PPIs.\r |
e386b444 |
53 | \r |
54 | **/\r |
c7d265a9 |
55 | VOID\r |
56 | EFIAPI \r |
57 | _ModuleEntryPoint(\r |
58 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r |
59 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r |
60 | )\r |
e386b444 |
61 | {\r |
c7d265a9 |
62 | ProcessModuleEntryPointList (SecCoreData, PpiList, NULL);\r |
f2084bda |
63 | \r |
64 | //\r |
65 | // Should never return\r |
66 | //\r |
67 | ASSERT(FALSE);\r |
68 | CpuDeadLoop (); \r |
e386b444 |
69 | }\r |
70 | \r |
71 | \r |
72 | /**\r |
71871514 |
73 | Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().\r |
74 | \r |
75 | This function is required to call _ModuleEntryPoint() passing in SecCoreData and PpiList.\r |
76 | \r |
77 | @param SecCoreData Points to a data structure containing information about the PEI core's\r |
78 | operating environment, such as the size and location of temporary RAM,\r |
79 | the stack location and the BFV location. \r |
80 | \r |
81 | @param PpiList Points to a list of one or more PPI descriptors to be installed\r |
82 | initially by the PEI core. An empty PPI list consists of a single\r |
83 | descriptor with the end-tag EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r |
84 | As part of its initialization phase, the PEI Foundation will add these\r |
85 | SEC-hosted PPIs to its PPI database such that both the PEI Foundation\r |
86 | and any modules can leverage the associated service calls and/or code\r |
87 | in these early PPIs.\r |
e386b444 |
88 | \r |
89 | **/\r |
c7d265a9 |
90 | VOID\r |
91 | EFIAPI\r |
e386b444 |
92 | EfiMain (\r |
c7d265a9 |
93 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r |
94 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r |
e386b444 |
95 | )\r |
96 | {\r |
c7d265a9 |
97 | _ModuleEntryPoint (SecCoreData, PpiList);\r |
e386b444 |
98 | }\r |