blob: 61473aafdd9deedd4c001362083a85ce28ae5cb5 [file] [log] [blame]
Subrata Banik20fe24b2021-12-09 02:46:38 +05301/** @file
2 Module entry point library for PEIM.
3
4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef __MODULE_ENTRY_POINT_H__
10#define __MODULE_ENTRY_POINT_H__
11
12///
13/// Declare the EFI/UEFI Specification Revision to which this driver is implemented
14///
15extern CONST UINT32 _gPeimRevision;
16
17
18/**
19 The entry point of PE/COFF Image for a PEIM.
20
21 This function is the entry point for a PEIM. This function must call ProcessLibraryConstructorList()
22 and ProcessModuleEntryPointList(). The return value from ProcessModuleEntryPointList() is returned.
23 If _gPeimRevision is not zero and PeiServices->Hdr.Revision is less than _gPeimRevison, then ASSERT().
24
25 @param FileHandle Handle of the file being invoked.
26 @param PeiServices Describes the list of possible PEI Services.
27
28 @retval EFI_SUCCESS The PEIM executed normally.
29 @retval !EFI_SUCCESS The PEIM failed to execute normally.
30**/
31EFI_STATUS
32EFIAPI
33_ModuleEntryPoint (
34 IN EFI_PEI_FILE_HANDLE FileHandle,
35 IN CONST EFI_PEI_SERVICES **PeiServices
36 );
37
38
39/**
40 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
41
42 This function is required to call _ModuleEntryPoint() passing in FileHandle and PeiServices.
43
44 @param FileHandle Handle of the file being invoked.
45 @param PeiServices Describes the list of possible PEI Services.
46
47 @retval EFI_SUCCESS The PEIM executed normally.
48 @retval !EFI_SUCCESS The PEIM failed to execute normally.
49
50**/
51EFI_STATUS
52EFIAPI
53EfiMain (
54 IN EFI_PEI_FILE_HANDLE FileHandle,
55 IN CONST EFI_PEI_SERVICES **PeiServices
56 );
57
58/**
59 Autogenerated function that calls the library constructors for all of the module's
60 dependent libraries.
61
62 This function must be called by _ModuleEntryPoint().
63 This function calls the set of library constructors for the set of library instances that a
64 module depends on. This includes library instances that a module depends on directly and library
65 instances that a module depends on indirectly through other libraries.
66 This function is autogenerated by build tools and those build tools are responsible for collecting
67 the set of library instances, determine which ones have constructors, and calling the library
68 constructors in the proper order based upon each of the library instances own dependencies.
69
70 @param FileHandle Handle of the file being invoked.
71 @param PeiServices Describes the list of possible PEI Services.
72
73**/
74VOID
75EFIAPI
76ProcessLibraryConstructorList (
77 IN EFI_PEI_FILE_HANDLE FileHandle,
78 IN CONST EFI_PEI_SERVICES **PeiServices
79 );
80
81/**
82 Autogenerated function that calls a set of module entry points.
83
84 This function must be called by _ModuleEntryPoint().
85 This function calls the set of module entry points.
86 This function is autogenerated by build tools and those build tools are responsible
87 for collecting the module entry points and calling them in a specified order.
88
89 @param FileHandle Handle of the file being invoked.
90 @param PeiServices Describes the list of possible PEI Services.
91
92 @retval EFI_SUCCESS The PEIM executed normally.
93 @retval !EFI_SUCCESS The PEIM failed to execute normally.
94
95**/
96EFI_STATUS
97EFIAPI
98ProcessModuleEntryPointList (
99 IN EFI_PEI_FILE_HANDLE FileHandle,
100 IN CONST EFI_PEI_SERVICES **PeiServices
101 );
102
103#endif