]>
Commit | Line | Data |
---|---|---|
738ec565 | 1 | /** @file\r |
2 | Entry point to a PEIM.\r | |
3 | \r | |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
738ec565 | 6 | \r |
7 | **/\r | |
8 | \r | |
c892d846 | 9 | \r |
c7d265a9 | 10 | #include <PiPei.h>\r |
c892d846 | 11 | \r |
12 | \r | |
c7d265a9 | 13 | #include <Library/PeimEntryPoint.h>\r |
14 | #include <Library/DebugLib.h>\r | |
738ec565 | 15 | \r |
16 | /**\r | |
f6d2bcc6 LG |
17 | The entry point of PE/COFF Image for a PEIM.\r |
18 | \r | |
9095d37b | 19 | This function is the entry point for a PEIM. This function must call ProcessLibraryConstructorList()\r |
f6d2bcc6 LG |
20 | and ProcessModuleEntryPointList(). The return value from ProcessModuleEntryPointList() is returned.\r |
21 | If _gPeimRevision is not zero and PeiServices->Hdr.Revision is less than _gPeimRevison, then ASSERT().\r | |
738ec565 | 22 | \r |
9095d37b | 23 | @param FileHandle Handle of the file being invoked.\r |
33de5999 | 24 | @param PeiServices Describes the list of possible PEI Services.\r |
738ec565 | 25 | \r |
f38fdc74 | 26 | @retval EFI_SUCCESS The PEIM executed normally.\r |
27 | @retval !EFI_SUCCESS The PEIM failed to execute normally.\r | |
738ec565 | 28 | **/\r |
29 | EFI_STATUS\r | |
30 | EFIAPI\r | |
31 | _ModuleEntryPoint (\r | |
0308e20d | 32 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
33 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
738ec565 | 34 | )\r |
35 | {\r | |
36 | if (_gPeimRevision != 0) {\r | |
37 | //\r | |
38 | // Make sure that the PEI spec revision of the platform is >= PEI spec revision of the driver\r | |
39 | //\r | |
40 | ASSERT ((*PeiServices)->Hdr.Revision >= _gPeimRevision);\r | |
41 | }\r | |
42 | \r | |
43 | //\r | |
44 | // Call constructor for all libraries\r | |
45 | //\r | |
0308e20d | 46 | ProcessLibraryConstructorList (FileHandle, PeiServices);\r |
738ec565 | 47 | \r |
48 | //\r | |
49 | // Call the driver entry point\r | |
50 | //\r | |
0308e20d | 51 | return ProcessModuleEntryPointList (FileHandle, PeiServices);\r |
738ec565 | 52 | }\r |
53 | \r | |
54 | \r | |
55 | /**\r | |
f38fdc74 | 56 | Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().\r |
9095d37b | 57 | \r |
f6d2bcc6 | 58 | This function is required to call _ModuleEntryPoint() passing in FileHandle and PeiServices.\r |
738ec565 | 59 | \r |
9095d37b | 60 | @param FileHandle Handle of the file being invoked.\r |
33de5999 | 61 | @param PeiServices Describes the list of possible PEI Services.\r |
738ec565 | 62 | \r |
f38fdc74 | 63 | @retval EFI_SUCCESS The PEIM executed normally.\r |
64 | @retval !EFI_SUCCESS The PEIM failed to execute normally.\r | |
738ec565 | 65 | \r |
66 | **/\r | |
67 | EFI_STATUS\r | |
68 | EFIAPI\r | |
69 | EfiMain (\r | |
f38fdc74 | 70 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
71 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
738ec565 | 72 | )\r |
73 | {\r | |
0308e20d | 74 | return _ModuleEntryPoint (FileHandle, PeiServices);\r |
738ec565 | 75 | }\r |