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