]>
Commit | Line | Data |
---|---|---|
738ec565 | 1 | \r |
2 | /** @file\r | |
3 | Entry point to a PEIM.\r | |
4 | \r | |
5 | Copyright (c) 2006, Intel Corporation<BR>\r | |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
c892d846 | 16 | \r |
c7d265a9 | 17 | #include <PiPei.h>\r |
c892d846 | 18 | \r |
19 | \r | |
c7d265a9 | 20 | #include <Library/PeimEntryPoint.h>\r |
21 | #include <Library/DebugLib.h>\r | |
738ec565 | 22 | \r |
23 | /**\r | |
24 | Image entry point of Peim.\r | |
25 | \r | |
26 | @param FfsHeader Pointer to FFS header the loaded driver.\r | |
27 | @param PeiServices Pointer to the PEI services.\r | |
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 | |
35 | IN EFI_FFS_FILE_HEADER *FfsHeader,\r | |
36 | IN EFI_PEI_SERVICES **PeiServices\r | |
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 | |
49 | ProcessLibraryConstructorList (FfsHeader, PeiServices);\r | |
50 | \r | |
51 | //\r | |
52 | // Call the driver entry point\r | |
53 | //\r | |
54 | return ProcessModuleEntryPointList (FfsHeader, PeiServices);\r | |
55 | }\r | |
56 | \r | |
57 | \r | |
58 | /**\r | |
59 | Wrapper of Peim image entry point.\r | |
60 | \r | |
61 | @param FfsHeader Pointer to FFS header the loaded driver.\r | |
62 | @param PeiServices Pointer to the PEI services.\r | |
63 | \r | |
64 | @return Status returned by entry points of Peims.\r | |
65 | \r | |
66 | **/\r | |
67 | EFI_STATUS\r | |
68 | EFIAPI\r | |
69 | EfiMain (\r | |
70 | IN EFI_FFS_FILE_HEADER *FfsHeader,\r | |
71 | IN EFI_PEI_SERVICES **PeiServices\r | |
72 | )\r | |
73 | {\r | |
74 | return _ModuleEntryPoint (FfsHeader, PeiServices);\r | |
75 | }\r |