2 Module entry point library for UEFI drivers, DXE Drivers, DXE Runtime Drivers,
5 Copyright (c) 2006 - 2008, Intel Corporation
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
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.
16 #ifndef __MODULE_ENTRY_POINT_H__
17 #define __MODULE_ENTRY_POINT_H__
20 /// Declare the EFI/UEFI Specification Revision to which this driver is implemented
22 extern CONST UINT32 _gUefiDriverRevision
;
25 /// Declare the number of unload handler in the image.
27 extern CONST UINT8 _gDriverUnloadImageCount
;
31 The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
33 This function is the entry point for a DXE Driver, DXE Runtime Driver, DXE SMM Driver,
34 or UEFI Driver. This function must call ProcessLibraryConstructorList() and
35 ProcessModuleEntryPointList(). If the return status from ProcessModuleEntryPointList()
36 is an error status, then ProcessLibraryDestructorList() must be called. The return value
37 from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount is greater
38 than zero, then an unload handler must be registered for this image and the unload handler
39 must invoke ProcessModuleUnloadList().
40 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
41 then return EFI_INCOMPATIBLE_VERSION.
44 @param ImageHandle ImageHandle of the loaded driver.
45 @param SystemTable Pointer to the EFI System Table.
47 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
48 or UEFI Driver exited normally.
49 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
50 @retval Other Return value from ProcessModuleEntryPointList().
56 IN EFI_HANDLE ImageHandle
,
57 IN EFI_SYSTEM_TABLE
*SystemTable
62 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
64 This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.
66 @param ImageHandle ImageHandle of the loaded driver.
67 @param SystemTable Pointer to the EFI System Table.
69 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
70 or UEFI Driver exited normally.
71 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
72 @retval Other Return value from ProcessModuleEntryPointList().
77 IN EFI_HANDLE ImageHandle
,
78 IN EFI_SYSTEM_TABLE
*SystemTable
83 Invokes the library destructors fror all dependent libraries and terminates the
84 DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
86 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
87 with a status specified by Status.
89 @param Status Status returned by the driver that is exiting.
100 Autogenerated function that calls the library constructors for all of the module's
103 This function must be called by _ModuleEntryPoint().
104 This function calls the set of library constructors for the set of library instances
105 that a module depends on. This includes library instances that a module depends on
106 directly and library instances that a module depends on indirectly through other libraries.
107 This function is autogenerated by build tools and those build tools are responsible
108 for collecting the set of library instances, determine which ones have constructors,
109 and calling the library constructors in the proper order based upon each of the library
110 instances own dependencies.
112 @param ImageHandle ImageHandle of the loaded driver.
113 @param SystemTable Pointer to the EFI System Table.
118 ProcessLibraryConstructorList (
119 IN EFI_HANDLE ImageHandle
,
120 IN EFI_SYSTEM_TABLE
*SystemTable
125 Autogenerated function that calls the library descructors for all of the module's
128 This function may be called by _ModuleEntryPoint() or ExitDriver().
129 This function calls the set of library destructors for the set of library instances
130 that a module depends on. This includes library instances that a module depends on
131 directly and library instances that a module depends on indirectly through other libraries.
132 This function is autogenerated by build tools and those build tools are responsible for
133 collecting the set of library instances, determine which ones have destructors, and calling
134 the library destructors in the proper order based upon each of the library instances own dependencies.
136 @param ImageHandle ImageHandle of the loaded driver.
137 @param SystemTable Pointer to the EFI System Table.
142 ProcessLibraryDestructorList (
143 IN EFI_HANDLE ImageHandle
,
144 IN EFI_SYSTEM_TABLE
*SystemTable
149 Autogenerated function that calls a set of module entry points.
151 This function must be called by _ModuleEntryPoint().
152 This function calls the set of module entry points.
153 This function is autogenerated by build tools and those build tools are responsible
154 for collecting the module entry points and calling them in a specified order.
156 @param ImageHandle ImageHandle of the loaded driver.
157 @param SystemTable Pointer to the EFI System Table.
159 @retval EFI_SUCCESS The UEFI Application executed normally.
160 @retval !EFI_SUCCESS The UEFI Application failed to execute normally.
164 ProcessModuleEntryPointList (
165 IN EFI_HANDLE ImageHandle
,
166 IN EFI_SYSTEM_TABLE
*SystemTable
171 Autogenerated function that calls a set of module unload handlers.
173 This function must be called from the unload handler registered by _ModuleEntryPoint().
174 This function calls the set of module unload handlers.
175 This function is autogenerated by build tools and those build tools are responsible
176 for collecting the module unload handlers and calling them in a specified order.
178 @param ImageHandle ImageHandle of the loaded driver.
180 @retval EFI_SUCCESS The unoad handlers executed normally.
181 @retval !EFI_SUCCESS The unload handlers failed to execute normally.
186 ProcessModuleUnloadList (
187 IN EFI_HANDLE ImageHandle