]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/UefiDriverEntryPoint.h
Function headers in .h and .c files synchronized with spec
[mirror_edk2.git] / MdePkg / Include / Library / UefiDriverEntryPoint.h
1 /** @file
2 Module entry point library for UEFI drivers, DXE Drivers, DXE Runtime Drivers,
3 and DXE SMM Drivers.
4
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
10
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.
13
14 **/
15
16 #ifndef __MODULE_ENTRY_POINT_H__
17 #define __MODULE_ENTRY_POINT_H__
18
19 ///
20 /// Declare the EFI/UEFI Specification Revision to which this driver is implemented
21 ///
22 extern CONST UINT32 _gUefiDriverRevision;
23
24 ///
25 /// Declare the number of unload handler in the image.
26 ///
27 extern CONST UINT8 _gDriverUnloadImageCount;
28
29
30 /**
31 The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
32
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.
42
43
44 @param ImageHandle ImageHandle of the loaded driver.
45 @param SystemTable Pointer to the EFI System Table.
46
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().
51
52 **/
53 EFI_STATUS
54 EFIAPI
55 _ModuleEntryPoint (
56 IN EFI_HANDLE ImageHandle,
57 IN EFI_SYSTEM_TABLE *SystemTable
58 );
59
60
61 /**
62 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
63
64 This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.
65
66 @param ImageHandle ImageHandle of the loaded driver.
67 @param SystemTable Pointer to the EFI System Table.
68
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().
73 **/
74 EFI_STATUS
75 EFIAPI
76 EfiMain (
77 IN EFI_HANDLE ImageHandle,
78 IN EFI_SYSTEM_TABLE *SystemTable
79 );
80
81
82 /**
83 Invokes the library destructors fror all dependent libraries and terminates the
84 DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
85
86 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
87 with a status specified by Status.
88
89 @param Status Status returned by the driver that is exiting.
90
91 **/
92 VOID
93 EFIAPI
94 ExitDriver (
95 IN EFI_STATUS Status
96 );
97
98
99 /**
100 Autogenerated function that calls the library constructors for all of the module's
101 dependent libraries.
102
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.
111
112 @param ImageHandle ImageHandle of the loaded driver.
113 @param SystemTable Pointer to the EFI System Table.
114
115 **/
116 VOID
117 EFIAPI
118 ProcessLibraryConstructorList (
119 IN EFI_HANDLE ImageHandle,
120 IN EFI_SYSTEM_TABLE *SystemTable
121 );
122
123
124 /**
125 Autogenerated function that calls the library descructors for all of the module's
126 dependent libraries.
127
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.
135
136 @param ImageHandle ImageHandle of the loaded driver.
137 @param SystemTable Pointer to the EFI System Table.
138
139 **/
140 VOID
141 EFIAPI
142 ProcessLibraryDestructorList (
143 IN EFI_HANDLE ImageHandle,
144 IN EFI_SYSTEM_TABLE *SystemTable
145 );
146
147
148 /**
149 Autogenerated function that calls a set of module entry points.
150
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.
155
156 @param ImageHandle ImageHandle of the loaded driver.
157 @param SystemTable Pointer to the EFI System Table.
158
159 @retval EFI_SUCCESS The UEFI Application executed normally.
160 @retval !EFI_SUCCESS The UEFI Application failed to execute normally.
161 **/
162 EFI_STATUS
163 EFIAPI
164 ProcessModuleEntryPointList (
165 IN EFI_HANDLE ImageHandle,
166 IN EFI_SYSTEM_TABLE *SystemTable
167 );
168
169
170 /**
171 Autogenerated function that calls a set of module unload handlers.
172
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.
177
178 @param ImageHandle ImageHandle of the loaded driver.
179
180 @retval EFI_SUCCESS The unoad handlers executed normally.
181 @retval !EFI_SUCCESS The unload handlers failed to execute normally.
182
183 **/
184 EFI_STATUS
185 EFIAPI
186 ProcessModuleUnloadList (
187 IN EFI_HANDLE ImageHandle
188 );
189
190 #endif