]>
Commit | Line | Data |
---|---|---|
738ec565 | 1 | /** @file\r |
2 | Entry point to a PEIM.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation<BR>\r | |
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 |
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 | |
33de5999 | 25 | @param FileHandle Handle of the file being invoked. \r |
26 | Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextFile().\r | |
27 | @param PeiServices Describes the list of possible PEI Services.\r | |
738ec565 | 28 | \r |
29 | @return Status returned by entry points of Peims.\r | |
30 | \r | |
31 | **/\r | |
32 | EFI_STATUS\r | |
33 | EFIAPI\r | |
34 | _ModuleEntryPoint (\r | |
0308e20d | 35 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
36 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
738ec565 | 37 | )\r |
38 | {\r | |
39 | if (_gPeimRevision != 0) {\r | |
40 | //\r | |
41 | // Make sure that the PEI spec revision of the platform is >= PEI spec revision of the driver\r | |
42 | //\r | |
43 | ASSERT ((*PeiServices)->Hdr.Revision >= _gPeimRevision);\r | |
44 | }\r | |
45 | \r | |
46 | //\r | |
47 | // Call constructor for all libraries\r | |
48 | //\r | |
0308e20d | 49 | ProcessLibraryConstructorList (FileHandle, PeiServices);\r |
738ec565 | 50 | \r |
51 | //\r | |
52 | // Call the driver entry point\r | |
53 | //\r | |
0308e20d | 54 | return ProcessModuleEntryPointList (FileHandle, PeiServices);\r |
738ec565 | 55 | }\r |
56 | \r | |
57 | \r | |
58 | /**\r | |
59 | Wrapper of Peim image entry point.\r | |
60 | \r | |
33de5999 | 61 | @param FileHandle Handle of the file being invoked. \r |
62 | Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextFile().\r | |
63 | @param PeiServices Describes the list of possible PEI Services.\r | |
738ec565 | 64 | \r |
65 | @return Status returned by entry points of Peims.\r | |
66 | \r | |
67 | **/\r | |
68 | EFI_STATUS\r | |
69 | EFIAPI\r | |
70 | EfiMain (\r | |
0308e20d | 71 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
72 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
738ec565 | 73 | )\r |
74 | {\r | |
0308e20d | 75 | return _ModuleEntryPoint (FileHandle, PeiServices);\r |
738ec565 | 76 | }\r |