]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c
refine code.
[mirror_edk2.git] / MdePkg / Library / PeimEntryPoint / PeimEntryPoint.c
CommitLineData
738ec565 1/** @file\r
2 Entry point to a PEIM.\r
3\r
4Copyright (c) 2006, Intel Corporation<BR>\r
5All rights reserved. This program and the accompanying materials\r
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
8http://opensource.org/licenses/bsd-license.php\r
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
18\r
c7d265a9 19#include <Library/PeimEntryPoint.h>\r
20#include <Library/DebugLib.h>\r
738ec565 21\r
22/**\r
23 Image entry point of Peim.\r
24\r
25 @param FfsHeader Pointer to FFS header the loaded driver.\r
0514e9c3 26 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r
738ec565 27\r
28 @return Status returned by entry points of Peims.\r
29\r
30**/\r
31EFI_STATUS\r
32EFIAPI\r
33_ModuleEntryPoint (\r
c6f4d4c9 34 IN EFI_PEI_FILE_HANDLE *FfsHeader,\r
738ec565 35 IN EFI_PEI_SERVICES **PeiServices\r
36 )\r
37{\r
38 if (_gPeimRevision != 0) {\r
39 //\r
40 // Make sure that the PEI spec revision of the platform is >= PEI spec revision of the driver\r
41 //\r
42 ASSERT ((*PeiServices)->Hdr.Revision >= _gPeimRevision);\r
43 }\r
44\r
45 //\r
46 // Call constructor for all libraries\r
47 //\r
48 ProcessLibraryConstructorList (FfsHeader, PeiServices);\r
49\r
50 //\r
51 // Call the driver entry point\r
52 //\r
53 return ProcessModuleEntryPointList (FfsHeader, PeiServices);\r
54}\r
55\r
56\r
57/**\r
58 Wrapper of Peim image entry point.\r
59\r
60 @param FfsHeader Pointer to FFS header the loaded driver.\r
0514e9c3 61 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r
738ec565 62\r
63 @return Status returned by entry points of Peims.\r
64\r
65**/\r
66EFI_STATUS\r
67EFIAPI\r
68EfiMain (\r
c6f4d4c9 69 IN EFI_PEI_FILE_HANDLE *FfsHeader,\r
738ec565 70 IN EFI_PEI_SERVICES **PeiServices\r
71 )\r
72{\r
73 return _ModuleEntryPoint (FfsHeader, PeiServices);\r
74}\r