]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / EntryPoints / EdkIIGlueDxeDriverEntryPoint.c
CommitLineData
3eb9473e 1/*++\r
2\r
2c7e5c2f
HT
3Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12\r
13Module Name:\r
14\r
15 EdkIIGlueDxeDriverEntryPoint.c\r
16 \r
17Abstract: \r
18\r
19 DXE Driver entry point template file\r
20\r
21--*/\r
22\r
23#include "EdkIIGlueDxe.h"\r
24#include "Common/EdkIIGlueDependencies.h"\r
25\r
3e99020d
LG
26//\r
27// Check definitions in .inf file to determine __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
28//\r
29// __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
30// 1: only install ComponentName, DriverConfiguration and DriverDiagnostics\r
31// 2: only install ComponentName2, DriverConfiguration2 and DriverDiagnostics2\r
32// 3: install all including ComponentName, DriverConfiguration, DriverDiagnostics AND\r
33// ComponentName2, DriverConfiguration2 and DriverDiagnostics2\r
34// 4: install automatically according to EFI_SPECIFICATION_VERSION:\r
35// if EFI_SPECIFICATION_VERSION < 0x00020000: only install ComponentName, DriverConfiguration and DriverDiagnostics\r
36// if EFI_SPECIFICATION_VERSION >= 0x00020000: only install ComponentName2, DriverConfiguration2 and DriverDiagnostics2\r
37//\r
38#ifdef __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__\r
39#undef __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__\r
40#endif\r
41\r
42#ifdef __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__\r
43#undef __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__\r
44#endif\r
45\r
46#ifdef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
47#undef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
48#endif\r
49\r
50#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__)\r
51#define __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__\r
52#endif\r
53\r
54#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__)\r
55#define __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__\r
56#endif\r
57\r
58#if defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)\r
59#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 1\r
60#endif\r
61\r
62#if !defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)\r
63#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 2\r
64#endif\r
65\r
66#if defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)\r
67#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 3\r
68#endif\r
69\r
70//\r
71// To use Auto-Select, it must be:\r
72// 1. both Protocol and Protocol2 are defined\r
73// 2. The Protocol and Protocol2 must use same names, for example, gDriverControllerName as __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__ and __EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__\r
74//\r
75#if defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)\r
76#if !(defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__))\r
77#error "To use Auto-Select please define both Protocol and Protocol2 instances"\r
78#endif\r
79#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 4\r
80#endif\r
81\r
82#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 4)\r
83#undef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
84#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
85#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 2\r
86#else\r
87#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 1\r
88#endif\r
89#endif\r
90\r
91#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)\r
92UINT8 _gEdkIIGlueDriverModelProtocolSelection = 1;\r
93#elif (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)\r
94UINT8 _gEdkIIGlueDriverModelProtocolSelection = 2;\r
95#elif (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)\r
96UINT8 _gEdkIIGlueDriverModelProtocolSelection = 3;\r
97#else\r
98UINT8 _gEdkIIGlueDriverModelProtocolSelection = 0;\r
99#endif\r
100\r
3eb9473e 101STATIC EFI_EVENT _mDriverExitBootServicesNotifyEvent;\r
102\r
103//\r
104// Driver Model related definitions.\r
105// LIMITATION: only support one instance of Driver Model protocols per driver.\r
106// In case where multiple Driver Model protocols need to be installed in a single driver,\r
107// manually edit this file and compile/link the modified file with the driver.\r
108//\r
3e99020d 109#if defined(__EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__)\r
3eb9473e 110extern EFI_DRIVER_BINDING_PROTOCOL __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__;\r
111#endif\r
112\r
3e99020d
LG
113#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1) || (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)\r
114#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__)\r
3eb9473e 115extern EFI_COMPONENT_NAME_PROTOCOL __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__;\r
116#endif\r
3eb9473e 117\r
3e99020d 118#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__)\r
3eb9473e 119extern EFI_DRIVER_CONFIGURATION_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__;\r
120#endif\r
3e99020d 121#endif\r
3eb9473e 122\r
3e99020d 123#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__)\r
3eb9473e 124extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__;\r
125#endif\r
126\r
3e99020d
LG
127#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2) || (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)\r
128#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__)\r
129extern EFI_COMPONENT_NAME2_PROTOCOL __EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__;\r
130#endif\r
131\r
132#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__)\r
133extern EFI_DRIVER_CONFIGURATION2_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__;\r
134#endif\r
135\r
136#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__)\r
137extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__;\r
138#endif\r
139#endif\r
140\r
3eb9473e 141GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {\r
142 {\r
143#ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__\r
144 &__EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__,\r
145#else\r
146 NULL,\r
147#endif\r
148\r
3e99020d 149#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)\r
3eb9473e 150 &__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__,\r
151#else\r
152 NULL,\r
153#endif\r
154\r
3e99020d 155#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)\r
3eb9473e 156 &__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__,\r
157#else\r
158 NULL,\r
159#endif\r
160\r
3e99020d 161#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)\r
3eb9473e 162 &__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__,\r
163#else\r
164 NULL,\r
165#endif\r
3e99020d
LG
166\r
167#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)\r
168 &__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__,\r
169#else\r
170 NULL,\r
171#endif\r
172\r
173#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)\r
174 &__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__,\r
175#else\r
176 NULL,\r
177#endif\r
178\r
179#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)\r
180 &__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__,\r
181#else\r
182 NULL,\r
183#endif\r
3eb9473e 184 }\r
185};\r
186\r
187//\r
188// NOTE: Limitation:\r
189// Only one handler for SetVirtualAddressMap Event and ExitBootServices Event each\r
190//\r
c7f33ca4 191\r
192/*\r
193 * This is the WRONG macro and it's kept only for backward compatibility.\r
194 */\r
195#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__\r
196VOID\r
197EFIAPI\r
198__EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__ (\r
199 IN EFI_EVENT Event,\r
200 IN VOID *Context\r
201 );\r
202#endif\r
203\r
204/*\r
205 * This is the CORRECT macro users should use.\r
206 */ \r
3eb9473e 207#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__\r
208VOID\r
c7f33ca4 209EFIAPI\r
3eb9473e 210__EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__ (\r
211 IN EFI_EVENT Event,\r
212 IN VOID *Context\r
213 );\r
214#endif\r
215\r
c7f33ca4 216/*\r
217 * Both __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__ and \r
218 * __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__ are kept here although\r
219 * the former is a WRONG macro. It's kept only for backward compatibility.\r
220 * For a single module, it's not likely that both macros are defined.\r
221 */\r
3eb9473e 222GLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r
c7f33ca4 223#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__\r
224 __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__,\r
225#endif\r
226\r
3eb9473e 227#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__\r
228 __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__,\r
229#endif\r
c7f33ca4 230\r
3eb9473e 231 NULL\r
232};\r
233\r
c7f33ca4 234/*\r
235 * This is the WRONG macro and it's kept only for backward compatibility.\r
236 */\r
237#ifdef __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__\r
238VOID\r
239__EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__ (\r
240 IN EFI_EVENT Event,\r
241 IN VOID *Context\r
242 );\r
243#endif\r
244\r
245/*\r
246 * This is the CORRECT macro users should use.\r
247 */\r
3eb9473e 248#ifdef __EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__\r
249VOID\r
250__EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__ (\r
251 IN EFI_EVENT Event,\r
252 IN VOID *Context\r
253 );\r
254#endif\r
255\r
256/**\r
257 Set AtRuntime flag as TRUE after ExitBootServices\r
258 \r
259 @param[in] Event The Event that is being processed\r
260 @param[in] Context Event Context\r
261**/\r
262VOID\r
263EFIAPI\r
264RuntimeDriverExitBootServices (\r
265 IN EFI_EVENT Event,\r
266 IN VOID *Context\r
267 );\r
268\r
c7f33ca4 269\r
270/*\r
271 * Both __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__ and \r
272 * __EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__ are kept here although\r
273 * the former is a WRONG macro. It's kept only for backward compatibility.\r
274 * For a single module, it's not likely that both macros are defined.\r
275 */\r
3eb9473e 276GLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r
277#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__ \r
278 //\r
279 // only Runtime drivers need to link EdkDxeRuntimeDriverLib\r
280 //\r
281 RuntimeDriverExitBootServices,\r
282#endif\r
c7f33ca4 283 \r
284#ifdef __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__\r
285 __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__,\r
286#endif\r
287\r
3eb9473e 288#ifdef __EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__\r
289 __EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__,\r
290#endif\r
c7f33ca4 291\r
3eb9473e 292 NULL\r
293};\r
294\r
295\r
296//\r
297// Module Unload Handler\r
298//\r
299\r
300#ifdef __EDKII_GLUE_MODULE_UNLOAD_HANDLER__\r
301EFI_STATUS\r
302EFIAPI\r
303__EDKII_GLUE_MODULE_UNLOAD_HANDLER__ (\r
304 EFI_HANDLE ImageHandle\r
305 );\r
306#endif\r
307\r
308EFI_STATUS\r
309EFIAPI\r
310ProcessModuleUnloadList (\r
311 EFI_HANDLE ImageHandle\r
312 )\r
313{\r
314#ifdef __EDKII_GLUE_MODULE_UNLOAD_HANDLER__\r
315 return (__EDKII_GLUE_MODULE_UNLOAD_HANDLER__ (ImageHandle));\r
316#else\r
317 return EFI_SUCCESS;\r
318#endif\r
319}\r
320\r
321#ifdef __EDKII_GLUE_EFI_CALLER_ID_GUID__\r
322 GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = __EDKII_GLUE_EFI_CALLER_ID_GUID__;\r
323#endif\r
324\r
325//\r
326// Library constructors\r
327//\r
328VOID\r
c7f33ca4 329EFIAPI\r
3eb9473e 330ProcessLibraryConstructorList (\r
331 IN EFI_HANDLE ImageHandle,\r
332 IN EFI_SYSTEM_TABLE *SystemTable\r
333 )\r
334{\r
335//\r
336// Declare "Status" if any of the following libraries are used\r
337//\r
338#if defined(__EDKII_GLUE_DXE_HOB_LIB__) \\r
339 || defined(__EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__) \\r
340 || defined(__EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__) \\r
341 || defined(__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) \\r
342 || defined(__EDKII_GLUE_DXE_SERVICES_TABLE_LIB__) \\r
343 || defined(__EDKII_GLUE_DXE_SMBUS_LIB__) \\r
344 || defined(__EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__) \\r
345 || defined(__EDKII_GLUE_EDK_DXE_SAL_LIB__) \\r
b56111f4
LG
346 || defined(__EDKII_GLUE_DXE_IO_LIB_CPU_IO__) \\r
347 || defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)\r
3eb9473e 348 EFI_STATUS Status;\r
349#endif\r
350\r
351//\r
352// EdkII Glue Library Constructors: \r
353// NOTE: the constructors must be called according to dependency order\r
354//\r
355// UefiBootServicesTableLib UefiBootServicesTableLibConstructor()\r
3e99020d
LG
356// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor() \r
357// DxeServicesTableLib DxeServicesTableLibConstructor()\r
3eb9473e 358// DxeIoLibCpuIo IoLibConstructor()\r
359// DxeSalLib DxeSalLibConstructor(), IPF only\r
360// EdkDxeRuntimeDriverLib RuntimeDriverLibConstruct()\r
3e99020d 361// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()\r
3eb9473e 362// UefiDriverModelLib UefiDriverModelLibConstructor()\r
3e99020d 363// DxeHobLib HobLibConstructor()\r
3eb9473e 364// DxeSmbusLib SmbusLibConstructor() \r
3eb9473e 365// \r
366\r
367#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__\r
368 Status = UefiBootServicesTableLibConstructor (ImageHandle, SystemTable);\r
369 ASSERT_EFI_ERROR (Status);\r
370#endif\r
371\r
3e99020d
LG
372#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__\r
373 Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);\r
374 ASSERT_EFI_ERROR (Status);\r
375#endif\r
376\r
377#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__\r
378 Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);\r
379 ASSERT_EFI_ERROR (Status); \r
380#endif\r
381\r
3eb9473e 382#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__\r
383 Status = IoLibConstructor (ImageHandle, SystemTable);\r
384 ASSERT_EFI_ERROR (Status);\r
385#endif\r
386\r
387#ifdef __EDKII_GLUE_EDK_DXE_SAL_LIB__\r
388 Status = DxeSalLibConstructor(ImageHandle, SystemTable);\r
389 ASSERT_EFI_ERROR (Status);\r
390#endif\r
391\r
392#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__\r
393 Status = RuntimeDriverLibConstruct (ImageHandle, SystemTable);\r
394 ASSERT_EFI_ERROR (Status);\r
395#endif\r
396\r
3e99020d
LG
397#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__\r
398 Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);\r
3eb9473e 399 ASSERT_EFI_ERROR (Status);\r
400#endif\r
401\r
402#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__\r
403 Status = UefiDriverModelLibConstructor (ImageHandle, SystemTable);\r
404 ASSERT_EFI_ERROR (Status);\r
405#endif\r
406\r
3eb9473e 407#ifdef __EDKII_GLUE_DXE_HOB_LIB__\r
408 Status = HobLibConstructor (ImageHandle, SystemTable);\r
409 ASSERT_EFI_ERROR (Status);\r
410#endif\r
411\r
412#ifdef __EDKII_GLUE_DXE_SMBUS_LIB__\r
413 Status = SmbusLibConstructor (ImageHandle, SystemTable);\r
414 ASSERT_EFI_ERROR (Status);\r
415#endif\r
416\r
417}\r
418\r
419//\r
420// Library Destructors\r
421//\r
422VOID\r
c7f33ca4 423EFIAPI\r
3eb9473e 424ProcessLibraryDestructorList (\r
425 IN EFI_HANDLE ImageHandle,\r
426 IN EFI_SYSTEM_TABLE *SystemTable\r
427 )\r
428{\r
b56111f4
LG
429#if defined (__EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__) \\r
430 || defined (__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) \\r
431 || defined (__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)\r
3eb9473e 432 EFI_STATUS Status; \r
433#endif\r
434\r
435//\r
436// NOTE: the destructors must be called according to dependency order\r
437//\r
438#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__\r
439 Status = UefiDriverModelLibDestructor (ImageHandle, SystemTable);\r
440 ASSERT_EFI_ERROR (Status);\r
441#endif\r
442\r
b56111f4
LG
443#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__\r
444 Status = ReportStatusCodeLibDestruct (ImageHandle, SystemTable);\r
445 ASSERT_EFI_ERROR (Status);\r
446#endif\r
447\r
3eb9473e 448#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__\r
449 Status = RuntimeDriverLibDeconstruct (ImageHandle, SystemTable);\r
450 ASSERT_EFI_ERROR (Status);\r
451#endif\r
452}\r
453\r
454\r
455/**\r
456 Unload function that is registered in the LoadImage protocol. It un-installs\r
457 protocols produced and deallocates pool used by the driver. Called by the core\r
458 when unloading the driver.\r
459\r
460 @param ImageHandle\r
461\r
462 @retval EFI_SUCCESS\r
463\r
464**/\r
465EFI_STATUS\r
466EFIAPI\r
467_DriverUnloadHandler (\r
468 EFI_HANDLE ImageHandle\r
469 )\r
470{\r
471 EFI_STATUS Status;\r
472\r
473 //\r
474 // If an UnloadImage() handler is specified, then call it\r
475 //\r
476 Status = ProcessModuleUnloadList (ImageHandle);\r
477\r
478 //\r
479 // If the driver specific unload handler does not return an error, then call all of the\r
480 // library destructors. If the unload handler returned an error, then the driver can not be\r
481 // unloaded, and the library destructors should not be called\r
482 //\r
483 if (!EFI_ERROR (Status)) {\r
484 //\r
485 // Close our ExitBootServices () notify function\r
486 //\r
c7f33ca4 487\r
488#if __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__\r
3eb9473e 489 if (_gDriverExitBootServicesEvent[0] != NULL) {\r
490 ASSERT (gBS != NULL);\r
491 Status = gBS->CloseEvent (_mDriverExitBootServicesNotifyEvent);\r
492 ASSERT_EFI_ERROR (Status);\r
493 }\r
c7f33ca4 494#endif\r
3eb9473e 495\r
3eb9473e 496 ProcessLibraryDestructorList (ImageHandle, gST);\r
497 }\r
498\r
499 //\r
500 // Return the status from the driver specific unload handler\r
501 //\r
502 return Status;\r
503}\r
504\r
505VOID\r
506EFIAPI\r
507_DriverExitBootServices (\r
508 IN EFI_EVENT Event,\r
509 IN VOID *Context\r
510 )\r
511/*++\r
512\r
513Routine Description:\r
514\r
515 Set AtRuntime flag as TRUE after ExitBootServices\r
516\r
517Arguments:\r
518\r
519 Event - The Event that is being processed\r
520 \r
521 Context - Event Context\r
522\r
523Returns: \r
524\r
525 None\r
526\r
527--*/\r
528{\r
c7f33ca4 529#if __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__\r
3eb9473e 530 EFI_EVENT_NOTIFY ChildNotifyEventHandler;\r
531 UINTN Index;\r
532\r
533 for (Index = 0; _gDriverExitBootServicesEvent[Index] != NULL; Index++) {\r
534 ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index];\r
535 ChildNotifyEventHandler (Event, NULL);\r
536 }\r
c7f33ca4 537#endif \r
3eb9473e 538}\r
539\r
540EFI_DRIVER_ENTRY_POINT (_ModuleEntryPoint);\r
541\r
542//\r
543// Module Entry Point\r
544//\r
545#ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__\r
546EFI_STATUS\r
547EFIAPI\r
548__EDKII_GLUE_MODULE_ENTRY_POINT__ (\r
549 EFI_HANDLE ImageHandle,\r
550 EFI_SYSTEM_TABLE *SystemTable\r
551 );\r
552#endif\r
553\r
554/**\r
555 Enrty point to DXE Driver.\r
556\r
557 @param ImageHandle ImageHandle of the loaded driver.\r
558 @param SystemTable Pointer to the EFI System Table.\r
559\r
560 @retval EFI_SUCCESS One or more of the drivers returned a success code.\r
561 @retval !EFI_SUCESS The return status from the last driver entry point in the list.\r
562\r
563**/\r
564EFI_STATUS\r
565EFIAPI\r
566_ModuleEntryPoint (\r
567 IN EFI_HANDLE ImageHandle,\r
568 IN EFI_SYSTEM_TABLE *SystemTable\r
569 )\r
570{\r
571 EFI_STATUS Status;\r
3eb9473e 572\r
573// if (_gUefiDriverRevision != 0) {\r
574// //\r
575// // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the driver\r
576// //\r
577// if (SystemTable->Hdr.Revision < _gUefiDriverRevision) {\r
578// return EFI_INCOMPATIBLE_VERSION;\r
579// }\r
580// }\r
581\r
582// DEBUG ((EFI_D_ERROR, "EdkII Glue Driver Entry - 0\n"));\r
583\r
584 //\r
585 // Call constructor for all libraries\r
586 //\r
587 ProcessLibraryConstructorList (ImageHandle, SystemTable);\r
588\r
589 //\r
590 // Register our ExitBootServices () notify function\r
591 //\r
c7f33ca4 592#if __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__\r
3eb9473e 593 if (_gDriverExitBootServicesEvent[0] != NULL) {\r
594 Status = SystemTable->BootServices->CreateEvent (\r
595 EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,\r
596 EFI_TPL_NOTIFY,\r
597 _DriverExitBootServices,\r
598 NULL,\r
599 &_mDriverExitBootServicesNotifyEvent\r
600 );\r
601\r
602 ASSERT_EFI_ERROR (Status);\r
603 }\r
c7f33ca4 604#endif\r
3eb9473e 605\r
606 //\r
607 // Install unload handler...\r
608 //\r
c7f33ca4 609 //\r
610 // Add conditional macro to save size. The 4 macros check against\r
611 // potential functions which may be invoked, if there is no function\r
612 // to be called, we don't register Unload callback.\r
613 //\r
614#if ( defined(__EDKII_GLUE_MODULE_UNLOAD_HANDLER__) \\r
615 || defined(__EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__) \\r
616 || defined(__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) ) \\r
617 || __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__ \r
618\r
619 do { \r
620 EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;\r
621\r
622 Status = SystemTable->BootServices->HandleProtocol (\r
623 ImageHandle,\r
624 &gEfiLoadedImageProtocolGuid,\r
625 (VOID **)&LoadedImage\r
626 );\r
627 ASSERT_EFI_ERROR (Status);\r
628 LoadedImage->Unload = _DriverUnloadHandler;\r
629 } while(0);\r
630\r
631#endif \r
3eb9473e 632\r
633 //\r
634 // Call the driver entry point\r
635 //\r
636 #ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__\r
637 Status = (__EDKII_GLUE_MODULE_ENTRY_POINT__ (ImageHandle, SystemTable));\r
638 #else\r
639 Status = EFI_SUCCESS;\r
640 #endif\r
641\r
642 //\r
643 // If all of the drivers returned errors, then invoke all of the library destructors\r
644 //\r
645 if (EFI_ERROR (Status)) {\r
646 //\r
647 // Close our ExitBootServices () notify function\r
648 //\r
c7f33ca4 649#if __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__ \r
3eb9473e 650 if (_gDriverExitBootServicesEvent[0] != NULL) {\r
651 EFI_STATUS CloseEventStatus;\r
652 CloseEventStatus = SystemTable->BootServices->CloseEvent (_mDriverExitBootServicesNotifyEvent);\r
653 ASSERT_EFI_ERROR (CloseEventStatus);\r
654 }\r
c7f33ca4 655#endif\r
3eb9473e 656\r
657 ProcessLibraryDestructorList (ImageHandle, SystemTable);\r
658 }\r
659\r
660 //\r
661 // Return the cummalative return status code from all of the driver entry points\r
662 //\r
663 return Status;\r
664}\r
665\r
666\r
667/**\r
668 Enrty point wrapper of DXE Driver.\r
669\r
670 @param ImageHandle ImageHandle of the loaded driver.\r
671 @param SystemTable Pointer to the EFI System Table.\r
672\r
673 @retval EFI_SUCCESS One or more of the drivers returned a success code.\r
674 @retval !EFI_SUCESS The return status from the last driver entry point in the list.\r
675\r
676 EBC build envrionment has /D $(IMAGE_ENTRY_POINT)=EfiMain which overrides what GlueLib \r
677 defines: /D IMAGE_ENTRY_POINT=_ModuleEntryPoint, so _ModuleEntryPoint will be replaced with\r
678 EfiMain thus the function below isn't needed in EBC envrionment.\r
679\r
680**/\r
681#ifndef MDE_CPU_EBC\r
682EFI_STATUS\r
683EFIAPI\r
684EfiMain (\r
685 IN EFI_HANDLE ImageHandle,\r
686 IN EFI_SYSTEM_TABLE *SystemTable\r
687 )\r
688{\r
689 return _ModuleEntryPoint (ImageHandle, SystemTable);\r
690}\r
691#endif\r
692\r
693//\r
694// Guids not present in R8.6 code base\r
695//\r
696\r
697//\r
698// Protocol/Arch Protocol GUID globals\r
699//\r
700GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gUefiDriverConfigurationProtocolGuid = { 0xbfd7dc1d, 0x24f1, 0x40d9, { 0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } };\r
701GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gUefiDriverDiagnosticsProtocolGuid = { 0x4d330321, 0x025f, 0x4aac, { 0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } };\r
702GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiArpProtocolGuid = { 0xf4b427bb, 0xba21, 0x4f16, { 0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } };\r
703GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiArpServiceBindingProtocolGuid = { 0xf44c00ee, 0x1f2c, 0x4a00, { 0xaa, 0x09, 0x1c, 0x9f, 0x3e, 0x08, 0x00, 0xa3 } };\r
704GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDhcp4ProtocolGuid = { 0x8a219718, 0x4ef5, 0x4761, { 0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } };\r
705GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid = { 0x9d9a39d8, 0xbd42, 0x4a73, { 0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } };\r
706GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ProtocolGuid = { 0x41d94cd2, 0x35b6, 0x455a, { 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } };\r
707GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ServiceBindingProtocolGuid = { 0xc51711e7, 0xb4bf, 0x404a, { 0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4 } };\r
708GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ConfigProtocolGuid = { 0x3b95aa31, 0x3793, 0x434b, { 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } };\r
709GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiManagedNetworkProtocolGuid = { 0x3b95aa31, 0x3793, 0x434b, { 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } };\r
710GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid = { 0xf36ff770, 0xa7e1, 0x42cf, { 0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } };\r
711GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiMtftp4ProtocolGuid = { 0x3ad9df29, 0x4501, 0x478d, { 0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } };\r
712GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid = { 0x2FE800BE, 0x8F01, 0x4aa6, { 0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } };\r
713GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTcp4ProtocolGuid = { 0x65530BC7, 0xA359, 0x410f, { 0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } }; \r
714GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTcp4ServiceBindingProtocolGuid = { 0x00720665, 0x67EB, 0x4a99, { 0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } };\r
715GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUdp4ProtocolGuid = { 0x3ad9df29, 0x4501, 0x478d, { 0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } };\r
716GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUdp4ServiceBindingProtocolGuid = { 0x83f01464, 0x99bd, 0x45e5, { 0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } };\r
717GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationInfoProtocolGuid = { 0x7671d9d0, 0x53db, 0x4173, { 0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } };\r
718GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathFromTextProtocolGuid = { 0x5c99a21, 0xc70f, 0x4ad2, { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } };\r
719GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathToTextProtocolGuid = { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } };\r
720GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = { 0x379be4e, 0xd706, 0x437d, { 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } };\r
721GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashProtocolGuid = { 0xc5184932, 0xdba5, 0x46db, { 0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 } };\r
722GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashServiceBindingProtocolGuid = { 0x42881c98, 0xa4f3, 0x44b0, { 0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd } };\r
723GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIScsiInitiatorNameProtocolGuid = { 0xa6a72875, 0x2962, 0x4c18, { 0x9f, 0x46, 0x8d, 0xa6, 0x44, 0xcc, 0xfe, 0x00 } };\r
724GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiExtScsiPassThruProtocolGuid = { 0x1d3de7f0, 0x0807, 0x424f, { 0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } };\r
725GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTapeIoProtocolGuid = { 0x1e93e633, 0xd65a, 0x459e, { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } };\r
726#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
727GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUsb2HcProtocolGuid = { 0x3e745226, 0x9818, 0x45b6, { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } };\r
728#endif\r
729\r
730//\r
731// PPI GUID globals\r
732//\r
733\r
734//\r
735// GUID globals\r
736//\r
737GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocBspStoreGuid = { 0x564b33cd, 0xc92a, 0x4593, { 0x90, 0xbf, 0x24, 0x73, 0xe4, 0x3c, 0x63, 0x22 } };\r
738GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocStackGuid = { 0x4ed4bf27, 0x4092, 0x42e9, { 0x80, 0x7d, 0x52, 0x7b, 0x1d, 0x00, 0xc9, 0xbd } }; \r
739GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocModuleGuid = { 0xf8e21975, 0x0899, 0x4f58, { 0xa4, 0xbe, 0x55, 0x25, 0xa9, 0xc6, 0xd7, 0x7a } }; \r
740GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationChapRadiusGuid = { 0xd6062b50, 0x15ca, 0x11da, { 0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } };\r
741GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationChapLocalGuid = { 0xc280c73e, 0x15ca, 0x11da, { 0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } };\r
742GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha1Guid = { 0x2ae9d80f, 0x3fb2, 0x4095, { 0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 } };\r
743GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha224Guid = { 0x8df01a06, 0x9bd5, 0x4bf7, { 0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b } }; \r
744GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha256Guid = { 0x51aa59de, 0xfdf2, 0x4ea3, { 0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 } };\r
745GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha384Guid = { 0xefa96432, 0xde33, 0x4dd2, { 0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a } }; \r
746GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha512Guid = { 0xcaa4381e, 0x750c, 0x4770, { 0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 } }; \r
747GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmMD5Guid = { 0xaf7c79c, 0x65b5, 0x4319, { 0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 } };\r
748GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gBootObjectAuthorizationParmsetGuid = { 0xedd35e31, 0x7b9, 0x11d2, { 0x83, 0xa3, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf } };\r
749GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gSmmCommunicateHeaderGuid = { 0xf328e36c, 0x23b6, 0x4a95, { 0x85, 0x4b, 0x32, 0xe1, 0x95, 0x34, 0xcd, 0x75 } };\r
750GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCapsuleGuid = { 0x3B6686BD, 0x0D76, 0x4030, { 0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } };\r
751GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiConfigFileNameGuid = { 0x98B8D59B, 0xE8BA, 0x48EE, { 0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } };\r