]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/UefiDriverEntryPoint.h
Function headers in .h and .c files synchronized with spec
[mirror_edk2.git] / MdePkg / Include / Library / UefiDriverEntryPoint.h
CommitLineData
fb3df220 1/** @file\r
50a64e5b 2 Module entry point library for UEFI drivers, DXE Drivers, DXE Runtime Drivers,\r
3 and DXE SMM Drivers.\r
fb3df220 4\r
50a64e5b 5Copyright (c) 2006 - 2008, Intel Corporation\r
fb3df220 6All rights reserved. This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef __MODULE_ENTRY_POINT_H__\r
17#define __MODULE_ENTRY_POINT_H__\r
18\r
fc30687f 19///\r
20/// Declare the EFI/UEFI Specification Revision to which this driver is implemented \r
21///\r
0308e20d 22extern CONST UINT32 _gUefiDriverRevision;\r
fb3df220 23\r
fc30687f 24///\r
25/// Declare the number of unload handler in the image. \r
26///\r
0308e20d 27extern CONST UINT8 _gDriverUnloadImageCount;\r
fb3df220 28\r
fb3df220 29\r
30/**\r
66770ccb 31 The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver. \r
fb3df220 32\r
86c4360b 33 This function is the entry point for a DXE Driver, DXE Runtime Driver, DXE SMM Driver,\r
66770ccb 34 or UEFI Driver. This function must call ProcessLibraryConstructorList() and\r
86c4360b 35 ProcessModuleEntryPointList(). If the return status from ProcessModuleEntryPointList()\r
66770ccb 36 is an error status, then ProcessLibraryDestructorList() must be called. The return value\r
37 from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount is greater\r
38 than zero, then an unload handler must be registered for this image and the unload handler\r
39 must invoke ProcessModuleUnloadList().\r
40 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,\r
41 then return EFI_INCOMPATIBLE_VERSION.\r
42\r
86c4360b 43\r
44 @param ImageHandle ImageHandle of the loaded driver.\r
45 @param SystemTable Pointer to the EFI System Table.\r
46\r
71871514 47 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,\r
48 or UEFI Driver exited normally.\r
86c4360b 49 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.\r
50 @retval Other Return value from ProcessModuleEntryPointList().\r
fb3df220 51\r
52**/\r
53EFI_STATUS\r
54EFIAPI\r
55_ModuleEntryPoint (\r
56 IN EFI_HANDLE ImageHandle,\r
57 IN EFI_SYSTEM_TABLE *SystemTable\r
58 );\r
59\r
60\r
61/**\r
66770ccb 62 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint(). \r
86c4360b 63\r
64 This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.\r
fb3df220 65\r
66 @param ImageHandle ImageHandle of the loaded driver.\r
67 @param SystemTable Pointer to the EFI System Table.\r
68\r
86c4360b 69 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,\r
70 or UEFI Driver exited normally.\r
71 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.\r
72 @retval Other Return value from ProcessModuleEntryPointList().\r
fb3df220 73**/\r
74EFI_STATUS\r
75EFIAPI\r
76EfiMain (\r
77 IN EFI_HANDLE ImageHandle,\r
78 IN EFI_SYSTEM_TABLE *SystemTable\r
79 );\r
80\r
81\r
82/**\r
86c4360b 83 Invokes the library destructors fror all dependent libraries and terminates the\r
84 DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver. \r
85\r
86 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()\r
87 with a status specified by Status.\r
fb3df220 88\r
89 @param Status Status returned by the driver that is exiting.\r
90\r
91**/\r
92VOID\r
93EFIAPI\r
94ExitDriver (\r
95 IN EFI_STATUS Status\r
96 );\r
97\r
98\r
99/**\r
86c4360b 100 Autogenerated function that calls the library constructors for all of the module's\r
101 dependent libraries.\r
102\r
103 This function must be called by _ModuleEntryPoint().\r
104 This function calls the set of library constructors for the set of library instances\r
66770ccb 105 that a module depends on. This includes library instances that a module depends on\r
86c4360b 106 directly and library instances that a module depends on indirectly through other libraries. \r
107 This function is autogenerated by build tools and those build tools are responsible\r
108 for collecting the set of library instances, determine which ones have constructors,\r
109 and calling the library constructors in the proper order based upon each of the library\r
110 instances own dependencies.\r
fb3df220 111\r
112 @param ImageHandle ImageHandle of the loaded driver.\r
113 @param SystemTable Pointer to the EFI System Table.\r
114\r
115**/\r
116VOID\r
117EFIAPI\r
118ProcessLibraryConstructorList (\r
119 IN EFI_HANDLE ImageHandle,\r
120 IN EFI_SYSTEM_TABLE *SystemTable\r
121 );\r
122\r
123\r
124/**\r
66770ccb 125 Autogenerated function that calls the library descructors for all of the module's\r
126 dependent libraries.\r
86c4360b 127\r
128 This function may be called by _ModuleEntryPoint() or ExitDriver().\r
129 This function calls the set of library destructors for the set of library instances\r
130 that a module depends on. This includes library instances that a module depends on\r
131 directly and library instances that a module depends on indirectly through other libraries. \r
132 This function is autogenerated by build tools and those build tools are responsible for\r
133 collecting the set of library instances, determine which ones have destructors, and calling\r
134 the library destructors in the proper order based upon each of the library instances own dependencies.\r
fb3df220 135\r
136 @param ImageHandle ImageHandle of the loaded driver.\r
137 @param SystemTable Pointer to the EFI System Table.\r
138\r
139**/\r
140VOID\r
141EFIAPI\r
142ProcessLibraryDestructorList (\r
143 IN EFI_HANDLE ImageHandle,\r
144 IN EFI_SYSTEM_TABLE *SystemTable\r
145 );\r
146\r
fb3df220 147\r
42eedea9 148/**\r
86c4360b 149 Autogenerated function that calls a set of module entry points.\r
150\r
151 This function must be called by _ModuleEntryPoint().\r
152 This function calls the set of module entry points. \r
153 This function is autogenerated by build tools and those build tools are responsible\r
154 for collecting the module entry points and calling them in a specified order.\r
42eedea9 155\r
156 @param ImageHandle ImageHandle of the loaded driver.\r
157 @param SystemTable Pointer to the EFI System Table.\r
158\r
86c4360b 159 @retval EFI_SUCCESS The UEFI Application executed normally.\r
160 @retval !EFI_SUCCESS The UEFI Application failed to execute normally.\r
42eedea9 161**/\r
fb3df220 162EFI_STATUS\r
163EFIAPI\r
164ProcessModuleEntryPointList (\r
165 IN EFI_HANDLE ImageHandle,\r
166 IN EFI_SYSTEM_TABLE *SystemTable\r
167 );\r
168\r
169\r
170/**\r
86c4360b 171 Autogenerated function that calls a set of module unload handlers.\r
172\r
173 This function must be called from the unload handler registered by _ModuleEntryPoint().\r
174 This function calls the set of module unload handlers. \r
175 This function is autogenerated by build tools and those build tools are responsible\r
176 for collecting the module unload handlers and calling them in a specified order.\r
fb3df220 177\r
178 @param ImageHandle ImageHandle of the loaded driver.\r
86c4360b 179\r
180 @retval EFI_SUCCESS The unoad handlers executed normally.\r
181 @retval !EFI_SUCCESS The unload handlers failed to execute normally.\r
fb3df220 182\r
183**/\r
184EFI_STATUS\r
185EFIAPI\r
186ProcessModuleUnloadList (\r
187 IN EFI_HANDLE ImageHandle\r
188 );\r
189\r
190#endif\r