blob: 7783800d38a833f69d7974ea827b3d0a44f93c98 [file] [log] [blame]
Ronak Kanabar1ae366f2023-06-07 01:21:56 +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 The entry point of PE/COFF Image for a PEIM.
19
20 This function is the entry point for a PEIM. This function must call ProcessLibraryConstructorList()
21 and ProcessModuleEntryPointList(). The return value from ProcessModuleEntryPointList() is returned.
22 If _gPeimRevision is not zero and PeiServices->Hdr.Revision is less than _gPeimRevison, then ASSERT().
23
24 @param FileHandle Handle of the file being invoked.
25 @param PeiServices Describes the list of possible PEI Services.
26
27 @retval EFI_SUCCESS The PEIM executed normally.
28 @retval !EFI_SUCCESS The PEIM failed to execute normally.
29**/
30EFI_STATUS
31EFIAPI
32_ModuleEntryPoint (
33 IN EFI_PEI_FILE_HANDLE FileHandle,
34 IN CONST EFI_PEI_SERVICES **PeiServices
35 );
36
37/**
38 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
39
40 This function is required to call _ModuleEntryPoint() passing in FileHandle and PeiServices.
41
42 @param FileHandle Handle of the file being invoked.
43 @param PeiServices Describes the list of possible PEI Services.
44
45 @retval EFI_SUCCESS The PEIM executed normally.
46 @retval !EFI_SUCCESS The PEIM failed to execute normally.
47
48**/
49EFI_STATUS
50EFIAPI
51EfiMain (
52 IN EFI_PEI_FILE_HANDLE FileHandle,
53 IN CONST EFI_PEI_SERVICES **PeiServices
54 );
55
56/**
57 Autogenerated function that calls the library constructors for all of the module's
58 dependent libraries.
59
60 This function must be called by _ModuleEntryPoint().
61 This function calls the set of library constructors for the set of library instances that a
62 module depends on. This includes library instances that a module depends on directly and library
63 instances that a module depends on indirectly through other libraries.
64 This function is autogenerated by build tools and those build tools are responsible for collecting
65 the set of library instances, determine which ones have constructors, and calling the library
66 constructors in the proper order based upon each of the library instances own dependencies.
67
68 @param FileHandle Handle of the file being invoked.
69 @param PeiServices Describes the list of possible PEI Services.
70
71**/
72VOID
73EFIAPI
74ProcessLibraryConstructorList (
75 IN EFI_PEI_FILE_HANDLE FileHandle,
76 IN CONST EFI_PEI_SERVICES **PeiServices
77 );
78
79/**
80 Autogenerated function that calls a set of module entry points.
81
82 This function must be called by _ModuleEntryPoint().
83 This function calls the set of module entry points.
84 This function is autogenerated by build tools and those build tools are responsible
85 for collecting the module entry points and calling them in a specified order.
86
87 @param FileHandle Handle of the file being invoked.
88 @param PeiServices Describes the list of possible PEI Services.
89
90 @retval EFI_SUCCESS The PEIM executed normally.
91 @retval !EFI_SUCCESS The PEIM failed to execute normally.
92
93**/
94EFI_STATUS
95EFIAPI
96ProcessModuleEntryPointList (
97 IN EFI_PEI_FILE_HANDLE FileHandle,
98 IN CONST EFI_PEI_SERVICES **PeiServices
99 );
100
101#endif