2 Module entry point library for UEFI drivers, DXE Drivers, DXE Runtime Drivers,
5 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __MODULE_ENTRY_POINT_H__
11 #define __MODULE_ENTRY_POINT_H__
14 ///Declare the PI Specification Revision that this driver requires to execute correctly.
16 extern CONST UINT32 _gDxeRevision
;
19 /// Declare the EFI/UEFI Specification Revision to which this driver is implemented
21 extern CONST UINT32 _gUefiDriverRevision
;
24 /// Declare the number of unload handler in the image.
26 extern CONST UINT8 _gDriverUnloadImageCount
;
30 The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
32 This function is the entry point for a DXE Driver, DXE Runtime Driver, DXE SMM Driver,
33 or UEFI Driver. This function must call ProcessLibraryConstructorList() and
34 ProcessModuleEntryPointList(). If the return status from ProcessModuleEntryPointList()
35 is an error status, then ProcessLibraryDestructorList() must be called. The return value
36 from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount is greater
37 than zero, then an unload handler must be registered for this image and the unload handler
38 must invoke ProcessModuleUnloadList().
39 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
40 then return EFI_INCOMPATIBLE_VERSION.
43 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
44 @param SystemTable A pointer to the EFI System Table.
46 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
47 or UEFI Driver exited normally.
48 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
49 @retval Other Return value from ProcessModuleEntryPointList().
55 IN EFI_HANDLE ImageHandle
,
56 IN EFI_SYSTEM_TABLE
*SystemTable
61 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
63 This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.
65 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
66 @param SystemTable A pointer to the EFI System Table.
68 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
69 or UEFI Driver exited normally.
70 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
71 @retval Other Return value from ProcessModuleEntryPointList().
76 IN EFI_HANDLE ImageHandle
,
77 IN EFI_SYSTEM_TABLE
*SystemTable
82 Invokes the library destructors for all dependent libraries and terminates the
83 DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
85 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
86 with a status specified by Status.
88 @param Status Status returned by the driver that is exiting.
99 Autogenerated function that calls the library constructors for all of the module's
102 This function must be called by _ModuleEntryPoint().
103 This function calls the set of library constructors for the set of library instances
104 that a module depends on. This includes library instances that a module depends on
105 directly and library instances that a module depends on indirectly through other libraries.
106 This function is autogenerated by build tools and those build tools are responsible
107 for collecting the set of library instances, determine which ones have constructors,
108 and calling the library constructors in the proper order based upon each of the library
109 instances own dependencies.
111 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
112 @param SystemTable A pointer to the EFI System Table.
117 ProcessLibraryConstructorList (
118 IN EFI_HANDLE ImageHandle
,
119 IN EFI_SYSTEM_TABLE
*SystemTable
124 Autogenerated function that calls the library descructors for all of the module's
127 This function may be called by _ModuleEntryPoint() or ExitDriver().
128 This function calls the set of library destructors for the set of library instances
129 that a module depends on. This includes library instances that a module depends on
130 directly and library instances that a module depends on indirectly through other libraries.
131 This function is autogenerated by build tools and those build tools are responsible for
132 collecting the set of library instances, determine which ones have destructors, and calling
133 the library destructors in the proper order based upon each of the library instances own dependencies.
135 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
136 @param SystemTable A pointer to the EFI System Table.
141 ProcessLibraryDestructorList (
142 IN EFI_HANDLE ImageHandle
,
143 IN EFI_SYSTEM_TABLE
*SystemTable
148 Autogenerated function that calls a set of module entry points.
150 This function must be called by _ModuleEntryPoint().
151 This function calls the set of module entry points.
152 This function is autogenerated by build tools and those build tools are responsible
153 for collecting the module entry points and calling them in a specified order.
155 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
156 @param SystemTable A pointer to the EFI System Table.
158 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver executed normally.
159 @retval !EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver failed to execute normally.
163 ProcessModuleEntryPointList (
164 IN EFI_HANDLE ImageHandle
,
165 IN EFI_SYSTEM_TABLE
*SystemTable
170 Autogenerated function that calls a set of module unload handlers.
172 This function must be called from the unload handler registered by _ModuleEntryPoint().
173 This function calls the set of module unload handlers.
174 This function is autogenerated by build tools and those build tools are responsible
175 for collecting the module unload handlers and calling them in a specified order.
177 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
179 @retval EFI_SUCCESS The unload handlers executed normally.
180 @retval !EFI_SUCCESS The unload handlers failed to execute normally.
185 ProcessModuleUnloadList (
186 IN EFI_HANDLE ImageHandle