]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c
Import DxeCoreHobLib, DxeHobLib, PeimEntryPoint and PeiServicesLib.
[mirror_edk2.git] / MdePkg / Library / PeimEntryPoint / PeimEntryPoint.c
1
2 /** @file
3 Entry point to a PEIM.
4
5 Copyright (c) 2006, Intel Corporation<BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 //
17 // Include common header file for this module.
18 //
19 #include "CommonHeader.h"
20
21 /**
22 Image entry point of Peim.
23
24 @param FfsHeader Pointer to FFS header the loaded driver.
25 @param PeiServices Pointer to the PEI services.
26
27 @return Status returned by entry points of Peims.
28
29 **/
30 EFI_STATUS
31 EFIAPI
32 _ModuleEntryPoint (
33 IN EFI_FFS_FILE_HEADER *FfsHeader,
34 IN EFI_PEI_SERVICES **PeiServices
35 )
36 {
37 if (_gPeimRevision != 0) {
38 //
39 // Make sure that the PEI spec revision of the platform is >= PEI spec revision of the driver
40 //
41 ASSERT ((*PeiServices)->Hdr.Revision >= _gPeimRevision);
42 }
43
44 //
45 // Call constructor for all libraries
46 //
47 ProcessLibraryConstructorList (FfsHeader, PeiServices);
48
49 //
50 // Call the driver entry point
51 //
52 return ProcessModuleEntryPointList (FfsHeader, PeiServices);
53 }
54
55
56 /**
57 Wrapper of Peim image entry point.
58
59 @param FfsHeader Pointer to FFS header the loaded driver.
60 @param PeiServices Pointer to the PEI services.
61
62 @return Status returned by entry points of Peims.
63
64 **/
65 EFI_STATUS
66 EFIAPI
67 EfiMain (
68 IN EFI_FFS_FILE_HEADER *FfsHeader,
69 IN EFI_PEI_SERVICES **PeiServices
70 )
71 {
72 return _ModuleEntryPoint (FfsHeader, PeiServices);
73 }