]>
Commit | Line | Data |
---|---|---|
738ec565 | 1 | /** @file\r |
2 | Entry point to a PEIM.\r | |
3 | \r | |
19388d29 HT |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
738ec565 | 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 | |
58380e9c | 8 | http://opensource.org/licenses/bsd-license.php.\r |
738ec565 | 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 | |
f6d2bcc6 LG |
23 | The entry point of PE/COFF Image for a PEIM.\r |
24 | \r | |
25 | This function is the entry point for a PEIM. This function must call ProcessLibraryConstructorList() \r | |
26 | and ProcessModuleEntryPointList(). The return value from ProcessModuleEntryPointList() is returned.\r | |
27 | If _gPeimRevision is not zero and PeiServices->Hdr.Revision is less than _gPeimRevison, then ASSERT().\r | |
738ec565 | 28 | \r |
33de5999 | 29 | @param FileHandle Handle of the file being invoked. \r |
33de5999 | 30 | @param PeiServices Describes the list of possible PEI Services.\r |
738ec565 | 31 | \r |
f38fdc74 | 32 | @retval EFI_SUCCESS The PEIM executed normally.\r |
33 | @retval !EFI_SUCCESS The PEIM failed to execute normally.\r | |
738ec565 | 34 | **/\r |
35 | EFI_STATUS\r | |
36 | EFIAPI\r | |
37 | _ModuleEntryPoint (\r | |
0308e20d | 38 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
39 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
738ec565 | 40 | )\r |
41 | {\r | |
42 | if (_gPeimRevision != 0) {\r | |
43 | //\r | |
44 | // Make sure that the PEI spec revision of the platform is >= PEI spec revision of the driver\r | |
45 | //\r | |
46 | ASSERT ((*PeiServices)->Hdr.Revision >= _gPeimRevision);\r | |
47 | }\r | |
48 | \r | |
49 | //\r | |
50 | // Call constructor for all libraries\r | |
51 | //\r | |
0308e20d | 52 | ProcessLibraryConstructorList (FileHandle, PeiServices);\r |
738ec565 | 53 | \r |
54 | //\r | |
55 | // Call the driver entry point\r | |
56 | //\r | |
0308e20d | 57 | return ProcessModuleEntryPointList (FileHandle, PeiServices);\r |
738ec565 | 58 | }\r |
59 | \r | |
60 | \r | |
61 | /**\r | |
f38fdc74 | 62 | Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().\r |
f6d2bcc6 LG |
63 | \r |
64 | This function is required to call _ModuleEntryPoint() passing in FileHandle and PeiServices.\r | |
738ec565 | 65 | \r |
33de5999 | 66 | @param FileHandle Handle of the file being invoked. \r |
33de5999 | 67 | @param PeiServices Describes the list of possible PEI Services.\r |
738ec565 | 68 | \r |
f38fdc74 | 69 | @retval EFI_SUCCESS The PEIM executed normally.\r |
70 | @retval !EFI_SUCCESS The PEIM failed to execute normally.\r | |
738ec565 | 71 | \r |
72 | **/\r | |
73 | EFI_STATUS\r | |
74 | EFIAPI\r | |
75 | EfiMain (\r | |
f38fdc74 | 76 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
77 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
738ec565 | 78 | )\r |
79 | {\r | |
0308e20d | 80 | return _ModuleEntryPoint (FileHandle, PeiServices);\r |
738ec565 | 81 | }\r |