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