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