2 Module entry point library for UEFI drivers, DXE Drivers, DXE Runtime Drivers,
5 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
6 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 PI Specification Revision that this driver requires to execute correctly.
22 extern CONST UINT32 _gDxeRevision
;
25 /// Declare the EFI/UEFI Specification Revision to which this driver is implemented
27 extern CONST UINT32 _gUefiDriverRevision
;
30 /// Declare the number of unload handler in the image.
32 extern CONST UINT8 _gDriverUnloadImageCount
;
36 The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
38 This function is the entry point for a DXE Driver, DXE Runtime Driver, DXE SMM Driver,
39 or UEFI Driver. This function must call ProcessLibraryConstructorList() and
40 ProcessModuleEntryPointList(). If the return status from ProcessModuleEntryPointList()
41 is an error status, then ProcessLibraryDestructorList() must be called. The return value
42 from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount is greater
43 than zero, then an unload handler must be registered for this image and the unload handler
44 must invoke ProcessModuleUnloadList().
45 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
46 then return EFI_INCOMPATIBLE_VERSION.
49 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
50 @param SystemTable A pointer to the EFI System Table.
52 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
53 or UEFI Driver exited normally.
54 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
55 @retval Other Return value from ProcessModuleEntryPointList().
61 IN EFI_HANDLE ImageHandle
,
62 IN EFI_SYSTEM_TABLE
*SystemTable
67 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
69 This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.
71 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
72 @param SystemTable A pointer to the EFI System Table.
74 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
75 or UEFI Driver exited normally.
76 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
77 @retval Other Return value from ProcessModuleEntryPointList().
82 IN EFI_HANDLE ImageHandle
,
83 IN EFI_SYSTEM_TABLE
*SystemTable
88 Invokes the library destructors for all dependent libraries and terminates the
89 DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
91 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
92 with a status specified by Status.
94 @param Status Status returned by the driver that is exiting.
105 Autogenerated function that calls the library constructors for all of the module's
108 This function must be called by _ModuleEntryPoint().
109 This function calls the set of library constructors for the set of library instances
110 that a module depends on. This includes library instances that a module depends on
111 directly and library instances that a module depends on indirectly through other libraries.
112 This function is autogenerated by build tools and those build tools are responsible
113 for collecting the set of library instances, determine which ones have constructors,
114 and calling the library constructors in the proper order based upon each of the library
115 instances own dependencies.
117 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
118 @param SystemTable A pointer to the EFI System Table.
123 ProcessLibraryConstructorList (
124 IN EFI_HANDLE ImageHandle
,
125 IN EFI_SYSTEM_TABLE
*SystemTable
130 Autogenerated function that calls the library descructors for all of the module's
133 This function may be called by _ModuleEntryPoint() or ExitDriver().
134 This function calls the set of library destructors for the set of library instances
135 that a module depends on. This includes library instances that a module depends on
136 directly and library instances that a module depends on indirectly through other libraries.
137 This function is autogenerated by build tools and those build tools are responsible for
138 collecting the set of library instances, determine which ones have destructors, and calling
139 the library destructors in the proper order based upon each of the library instances own dependencies.
141 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
142 @param SystemTable A pointer to the EFI System Table.
147 ProcessLibraryDestructorList (
148 IN EFI_HANDLE ImageHandle
,
149 IN EFI_SYSTEM_TABLE
*SystemTable
154 Autogenerated function that calls a set of module entry points.
156 This function must be called by _ModuleEntryPoint().
157 This function calls the set of module entry points.
158 This function is autogenerated by build tools and those build tools are responsible
159 for collecting the module entry points and calling them in a specified order.
161 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
162 @param SystemTable A pointer to the EFI System Table.
164 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver executed normally.
165 @retval !EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver failed to execute normally.
169 ProcessModuleEntryPointList (
170 IN EFI_HANDLE ImageHandle
,
171 IN EFI_SYSTEM_TABLE
*SystemTable
176 Autogenerated function that calls a set of module unload handlers.
178 This function must be called from the unload handler registered by _ModuleEntryPoint().
179 This function calls the set of module unload handlers.
180 This function is autogenerated by build tools and those build tools are responsible
181 for collecting the module unload handlers and calling them in a specified order.
183 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
185 @retval EFI_SUCCESS The unload handlers executed normally.
186 @retval !EFI_SUCCESS The unload handlers failed to execute normally.
191 ProcessModuleUnloadList (
192 IN EFI_HANDLE ImageHandle