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