]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c
a7faf2b5f4dd28c34e8ea0a56fed8149ad3e17ac
[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 // The package level header files this module uses
18 //
19 #include <PiPei.h>
20 //
21 // The protocols, PPI and GUID defintions for this module
22 //
23 //
24 // The Library classes this module consumes
25 //
26 #include <Library/PeimEntryPoint.h>
27 #include <Library/DebugLib.h>
28
29 /**
30 Image entry point of Peim.
31
32 @param FfsHeader Pointer to FFS header the loaded driver.
33 @param PeiServices Pointer to the PEI services.
34
35 @return Status returned by entry points of Peims.
36
37 **/
38 EFI_STATUS
39 EFIAPI
40 _ModuleEntryPoint (
41 IN EFI_FFS_FILE_HEADER *FfsHeader,
42 IN EFI_PEI_SERVICES **PeiServices
43 )
44 {
45 if (_gPeimRevision != 0) {
46 //
47 // Make sure that the PEI spec revision of the platform is >= PEI spec revision of the driver
48 //
49 ASSERT ((*PeiServices)->Hdr.Revision >= _gPeimRevision);
50 }
51
52 //
53 // Call constructor for all libraries
54 //
55 ProcessLibraryConstructorList (FfsHeader, PeiServices);
56
57 //
58 // Call the driver entry point
59 //
60 return ProcessModuleEntryPointList (FfsHeader, PeiServices);
61 }
62
63
64 /**
65 Wrapper of Peim image entry point.
66
67 @param FfsHeader Pointer to FFS header the loaded driver.
68 @param PeiServices Pointer to the PEI services.
69
70 @return Status returned by entry points of Peims.
71
72 **/
73 EFI_STATUS
74 EFIAPI
75 EfiMain (
76 IN EFI_FFS_FILE_HEADER *FfsHeader,
77 IN EFI_PEI_SERVICES **PeiServices
78 )
79 {
80 return _ModuleEntryPoint (FfsHeader, PeiServices);
81 }