]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Entry point to a PEIM.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r | |
5 | 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 | |
15 | \r | |
16 | #include <PiPei.h>\r | |
17 | \r | |
18 | \r | |
19 | #include <Library/PeimEntryPoint.h>\r | |
20 | #include <Library/DebugLib.h>\r | |
21 | \r | |
22 | /**\r | |
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 | |
28 | \r | |
29 | @param FileHandle Handle of the file being invoked. \r | |
30 | @param PeiServices Describes the list of possible PEI Services.\r | |
31 | \r | |
32 | @retval EFI_SUCCESS The PEIM executed normally.\r | |
33 | @retval !EFI_SUCCESS The PEIM failed to execute normally.\r | |
34 | **/\r | |
35 | EFI_STATUS\r | |
36 | EFIAPI\r | |
37 | _ModuleEntryPoint (\r | |
38 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
39 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
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 | |
52 | ProcessLibraryConstructorList (FileHandle, PeiServices);\r | |
53 | \r | |
54 | //\r | |
55 | // Call the driver entry point\r | |
56 | //\r | |
57 | return ProcessModuleEntryPointList (FileHandle, PeiServices);\r | |
58 | }\r | |
59 | \r | |
60 | \r | |
61 | /**\r | |
62 | Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().\r | |
63 | \r | |
64 | This function is required to call _ModuleEntryPoint() passing in FileHandle and PeiServices.\r | |
65 | \r | |
66 | @param FileHandle Handle of the file being invoked. \r | |
67 | @param PeiServices Describes the list of possible PEI Services.\r | |
68 | \r | |
69 | @retval EFI_SUCCESS The PEIM executed normally.\r | |
70 | @retval !EFI_SUCCESS The PEIM failed to execute normally.\r | |
71 | \r | |
72 | **/\r | |
73 | EFI_STATUS\r | |
74 | EFIAPI\r | |
75 | EfiMain (\r | |
76 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
77 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
78 | )\r | |
79 | {\r | |
80 | return _ModuleEntryPoint (FileHandle, PeiServices);\r | |
81 | }\r |