1 /*++
2 
3 Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution.  The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8 
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 
12 
13 Module Name:
14 
15   EdkIIGlueDepedencies.h
16 
17 Abstract:
18 
19   Header file that lists dependency relations among library instances
20 
21 --*/
22 
23 #ifndef __EDKII_GLUE_DEPENDENCIES_H__
24 #define __EDKII_GLUE_DEPENDENCIES_H__
25 
26 #include "EdkIIGlueProcessorBind.h"
27 
28 //
29 // Declarations of dependencies among EDKII Glue Library instances and EDK Libraries
30 // Pay attention to the order of following #define structures
31 //
32 
33 
34 //
35 // PeiDxeDebugLibReportStatusCode
36 // Actually almost every module and GlueLib instance needs this library, but GlueLib
37 // instances don't have to list this library in their own inf files. Module inf
38 // does this.
39 //
40 #ifdef __EDKII_GLUE_PEI_DXE_DEBUG_LIB_REPORT_STATUS_CODE__
41   #ifndef __EDKII_GLUE_BASE_LIB__
42   #define __EDKII_GLUE_BASE_LIB__
43   #endif
44   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
45   #define __EDKII_GLUE_BASE_MEMORY_LIB__
46   #endif
47 #endif
48 
49 //
50 //  BaseDebugLibNull
51 //
52 #ifdef __EDKII_GLUE_BASE_DEBUG_LIB_NULL__
53   #ifndef __EDKII_GLUE_BASE_LIB__
54   #define __EDKII_GLUE_BASE_LIB__
55   #endif
56   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
57   #define __EDKII_GLUE_BASE_MEMORY_LIB__
58   #endif
59   #ifndef __EDKII_GLUE_BASE_PRINT_LIB__
60   #define __EDKII_GLUE_BASE_PRINT_LIB__
61   #endif
62 #endif
63 
64 //
65 //  DxePerformanceLib
66 //
67 #ifdef __EDKII_GLUE_DXE_PERFORMANCE_LIB__
68   #ifndef __EDKII_GLUE_BASE_LIB__
69   #define __EDKII_GLUE_BASE_LIB__
70   #endif
71   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
72   #define __EDKII_GLUE_BASE_MEMORY_LIB__
73   #endif
74   #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
75   #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
76   #endif
77   #ifndef __EDKII_GLUE_DXE_HOB_LIB__
78   #define __EDKII_GLUE_DXE_HOB_LIB__
79   #endif
80   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
81   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
82   #endif
83   #ifndef __EDKII_GLUE_UEFI_LIB__
84   #define __EDKII_GLUE_UEFI_LIB__
85   #endif
86 #endif
87 
88 //
89 //  PeiPerformanceLib
90 //
91 #ifdef __EDKII_GLUE_PEI_PERFORMANCE_LIB__
92   #ifndef __EDKII_GLUE_BASE_LIB__
93   #define __EDKII_GLUE_BASE_LIB__
94   #endif
95   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
96   #define __EDKII_GLUE_BASE_MEMORY_LIB__
97   #endif
98   #ifndef __EDKII_GLUE_PEI_SERVICES_LIB__
99   #define __EDKII_GLUE_PEI_SERVICES_LIB__
100   #endif
101 #endif
102 
103 //
104 // EdkDxeRuntimeDriverLib
105 //
106 #ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
107   #ifndef __EDKII_GLUE_UEFI_LIB__
108   #define __EDKII_GLUE_UEFI_LIB__
109   #endif
110   #ifndef __EDKII_GLUE_BASE_LIB__
111   #define __EDKII_GLUE_BASE_LIB__
112   #endif
113   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
114   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
115   #endif
116 #ifdef MDE_CPU_IPF // IPF
117   #ifndef __EDKII_GLUE_EDK_DXE_SAL_LIB__
118   #define __EDKII_GLUE_EDK_DXE_SAL_LIB__
119   #endif
120 #endif // IPF
121 #endif
122 
123 //
124 //  EdkDxeSalLib
125 //
126 #ifdef __EDKII_GLUE_EDK_DXE_SAL_LIB__
127   #ifndef __EDKII_GLUE_BASE_LIB__
128   #define __EDKII_GLUE_BASE_LIB__
129   #endif
130   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
131   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
132   #endif
133 #endif
134 
135 //
136 // BasePciLibCf8
137 //
138 #ifdef __EDKII_GLUE_BASE_PCI_LIB_CF8__
139   #ifndef __EDKII_GLUE_BASE_PCI_CF8_LIB__
140   #define __EDKII_GLUE_BASE_PCI_CF8_LIB__
141   #endif
142 #endif
143 
144 //
145 // BasePciLibPciExpress
146 //
147 #ifdef __EDKII_GLUE_BASE_PCI_LIB_PCI_EXPRESS__
148   #ifndef __EDKII_GLUE_BASE_PCI_EXPRESS_LIB__
149   #define __EDKII_GLUE_BASE_PCI_EXPRESS_LIB__
150   #endif
151 #endif
152 
153 //
154 // BasePciCf8Lib
155 //
156 #ifdef __EDKII_GLUE_BASE_PCI_CF8_LIB__
157 #ifndef MDE_CPU_EBC
158   #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
159   #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
160   #endif
161 #else
162   #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
163   #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
164   #endif
165 #endif
166 #endif
167 
168 //
169 // BasePciExpressLib
170 //
171 #ifdef __EDKII_GLUE_BASE_PCI_EXPRESS_LIB__
172 #ifndef MDE_CPU_EBC
173   #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
174   #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
175   #endif
176 #else
177   #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
178   #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
179   #endif
180 #endif
181 #endif
182 
183 //
184 // BaseTimerLibLocalApic
185 //
186 #ifdef __EDKII_GLUE_BASE_TIMER_LIB_LOCAL_APIC__
187   #ifndef __EDKII_GLUE_BASE_LIB__
188   #define __EDKII_GLUE_BASE_LIB__
189   #endif
190 #ifndef MDE_CPU_EBC
191   #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
192   #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
193   #endif
194 #else
195   #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
196   #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
197   #endif
198 #endif
199 #endif
200 
201 //
202 // DxeReportStatusCodeLib
203 //
204 #ifdef  __EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__
205   #ifndef __EDKII_GLUE_BASE_LIB__
206   #define __EDKII_GLUE_BASE_LIB__
207   #endif
208 #ifndef MDE_CPU_EBC
209   #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
210   #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
211   #endif
212 #else
213   #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
214   #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
215   #endif
216 #endif
217   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
218   #define __EDKII_GLUE_BASE_MEMORY_LIB__
219   #endif
220   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
221   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
222   #endif
223   #ifndef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
224   #define __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
225   #endif
226 #endif
227 
228 //
229 // SmmRuntimeDxeReportStatusCodeLib - typically used by SMM driver and Runtime driver
230 //
231 #ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
232   #ifndef __EDKII_GLUE_BASE_LIB__
233   #define __EDKII_GLUE_BASE_LIB__
234   #endif
235   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
236   #define __EDKII_GLUE_BASE_MEMORY_LIB__
237   #endif
238   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
239   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
240   #endif
241   #ifndef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
242   #define __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
243   #endif
244 #endif
245 
246 //
247 // PeiReportStatusCodeLib
248 //
249 #ifdef  __EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__
250   #ifndef __EDKII_GLUE_BASE_LIB__
251   #define __EDKII_GLUE_BASE_LIB__
252   #endif
253   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
254   #define __EDKII_GLUE_BASE_MEMORY_LIB__
255   #endif
256 #ifndef MDE_CPU_EBC
257   #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
258   #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
259   #endif
260 #else
261   #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
262   #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
263   #endif
264 #endif
265 #if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
266   #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
267   #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
268   #endif
269 #elif defined(MDE_CPU_IPF)
270   #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
271   #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
272   #endif
273 #endif
274   //
275   //  If necessary, __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__ or
276   //  __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__ can be
277   //  replaced with __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
278   //
279 #endif
280 
281 //
282 // BasePeCoffLib
283 //
284 #ifdef __EDKII_GLUE_BASE_PE_COFF_LIB__
285   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
286   #define __EDKII_GLUE_BASE_MEMORY_LIB__
287   #endif
288 #endif
289 
290 //
291 // BaseUefiDecompressLib
292 //
293 #ifdef  __EDKII_GLUE_BASE_UEFI_DECOMPRESS_LIB__
294   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
295   #define __EDKII_GLUE_BASE_MEMORY_LIB__
296   #endif
297 #endif
298 
299 //
300 // DxeHobLib
301 //
302 #ifdef  __EDKII_GLUE_DXE_HOB_LIB__
303   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
304   #define __EDKII_GLUE_BASE_MEMORY_LIB__
305   #endif
306   #ifndef __EDKII_GLUE_UEFI_LIB__
307   #define __EDKII_GLUE_UEFI_LIB__
308   #endif
309 #endif
310 
311 //
312 // HiiLib
313 //
314 #ifdef  __EDKII_GLUE_HII_LIB__
315   #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
316   #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
317   #endif
318 #endif
319 
320 //
321 // UefiDevicePathLib
322 //
323 #ifdef  __EDKII_GLUE_UEFI_DEVICE_PATH_LIB__
324   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
325   #define __EDKII_GLUE_BASE_MEMORY_LIB__
326   #endif
327   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
328   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
329   #endif
330   #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
331   #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
332   #endif
333 #endif
334 
335 //
336 // DxeServicesTableLib
337 //
338 #ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
339   #ifndef __EDKII_GLUE_UEFI_LIB__
340   #define __EDKII_GLUE_UEFI_LIB__
341   #endif
342 #endif
343 
344 //
345 // UefiLib
346 //
347 #ifdef  __EDKII_GLUE_UEFI_LIB__
348   #ifndef __EDKII_GLUE_BASE_LIB__
349   #define __EDKII_GLUE_BASE_LIB__
350   #endif
351   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
352   #define __EDKII_GLUE_BASE_MEMORY_LIB__
353   #endif
354   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
355   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
356   #endif
357   #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
358   #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
359   #endif
360 #endif
361 
362 //
363 // DxeMemoryAllocationLib
364 //
365 #ifdef  __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
366   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
367   #define __EDKII_GLUE_BASE_MEMORY_LIB__
368   #endif
369   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
370   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
371   #endif
372 #endif
373 
374 //
375 // DxeSmbusLib
376 //
377 #ifdef  __EDKII_GLUE_DXE_SMBUS_LIB__
378   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
379   #define __EDKII_GLUE_BASE_MEMORY_LIB__
380   #endif
381   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
382   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
383   #endif
384 #endif
385 
386 //
387 // PeiHobLib
388 //
389 #ifdef  __EDKII_GLUE_PEI_HOB_LIB__
390   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
391   #define __EDKII_GLUE_BASE_MEMORY_LIB__
392   #endif
393   #ifndef __EDKII_GLUE_PEI_SERVICES_LIB__
394   #define __EDKII_GLUE_PEI_SERVICES_LIB__
395   #endif
396 #endif
397 
398 //
399 // PeiMemoryAllocationLib
400 //
401 #ifdef  __EDKII_GLUE_PEI_MEMORY_ALLOCATION_LIB__
402   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
403   #define __EDKII_GLUE_BASE_MEMORY_LIB__
404   #endif
405 #if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
406   #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
407   #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
408   #endif
409 #elif defined(MDE_CPU_IPF)
410   #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
411   #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
412   #endif
413 #endif
414   //
415   //  If necessary, __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__ or
416   //  __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__ can be
417   //  replaced with __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
418   //
419 #endif
420 
421 //
422 // PeiResourcePublicationLib
423 //
424 #ifdef  __EDKII_GLUE_PEI_RESOURCE_PUBLICATION_LIB__
425   #ifndef __EDKII_GLUE_PEI_SERVICES_LIB__
426   #define __EDKII_GLUE_PEI_SERVICES_LIB__
427   #endif
428 #endif
429 
430 //
431 // PeiServicesLib
432 //
433 #ifdef  __EDKII_GLUE_PEI_SERVICES_LIB__
434 #if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
435   #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
436   #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
437   #endif
438 #elif defined(MDE_CPU_IPF)
439   #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
440   #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
441   #endif
442 #endif
443   //
444   //  If necessary, __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__ or
445   //  __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__ can be
446   //  replaced with __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
447   //
448 #endif
449 
450 //
451 // PeiSmbusLib
452 //
453 #ifdef  __EDKII_GLUE_PEI_SMBUS_LIB__
454   #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
455   #define __EDKII_GLUE_BASE_MEMORY_LIB__
456   #endif
457 #if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
458   #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
459   #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
460   #endif
461 #elif defined(MDE_CPU_IPF)
462   #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
463   #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
464   #endif
465 #endif
466   //
467   //  If necessary, __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__ or
468   //  __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__ can be
469   //  replaced with __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
470   //
471 #endif
472 
473 //
474 // PeiServicesTablePointerLibMm7
475 //
476 #ifdef  __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
477   #ifndef __EDKII_GLUE_BASE_LIB__
478   #define __EDKII_GLUE_BASE_LIB__
479   #endif
480 #endif
481 
482 //
483 // PeiServicesTablePointerLibKr1
484 //
485 #ifdef  __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
486   #ifndef __EDKII_GLUE_BASE_LIB__
487   #define __EDKII_GLUE_BASE_LIB__
488   #endif
489 #endif
490 
491 
492 //
493 // UefiDriverModelLib
494 //
495 #ifdef  __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
496   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
497   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
498   #endif
499 #endif
500 
501 //
502 // BasePrintLib
503 //
504 #ifdef __EDKII_GLUE_BASE_PRINT_LIB__
505   #ifndef __EDKII_GLUE_BASE_LIB__
506   #define __EDKII_GLUE_BASE_LIB__
507   #endif
508 #endif
509 
510 //
511 // BaseMemoryLib
512 //
513 #ifdef __EDKII_GLUE_BASE_MEMORY_LIB__
514   #ifndef __EDKII_GLUE_BASE_LIB__
515   #define __EDKII_GLUE_BASE_LIB__
516   #endif
517 #endif
518 
519 //
520 // BasePostCodeLibPort80
521 //
522 #ifdef __EDKII_GLUE_BASE_POST_CODE_LIB_PORT_80__
523 #ifndef MDE_CPU_EBC
524   #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
525   #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
526   #endif
527 #else
528   #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
529   #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
530   #endif
531 #endif
532 #endif
533 
534 //
535 // BaseIoLibIntrinsic
536 //
537 #ifdef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
538   #ifndef __EDKII_GLUE_BASE_LIB__
539   #define __EDKII_GLUE_BASE_LIB__
540   #endif
541 #endif
542 
543 //
544 // DxeIoLibCpuIo
545 //
546 #ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
547   #ifndef __EDKII_GLUE_BASE_LIB__
548   #define __EDKII_GLUE_BASE_LIB__
549   #endif
550   #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
551   #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
552   #endif
553 #endif
554 
555 //
556 // UefiBootServicesTableLib
557 //
558 #ifdef  __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
559 #endif
560 
561 //
562 // BaseCacheMaintenanceLib
563 //
564 #ifdef __EDKII_GLUE_BASE_CACHE_MAINTENANCE_LIB__
565   #ifndef __EDKII_GLUE_BASE_LIB__
566   #define __EDKII_GLUE_BASE_LIB__
567   #endif
568 #endif
569 
570 //
571 // BaseLib
572 //
573 #ifdef __EDKII_GLUE_BASE_LIB__
574 #endif
575 
576 //
577 // UefiRuntimeServicesTableLib
578 //
579 #ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
580 #endif
581 
582 //
583 // BasePeCoffGetEntryPointLib
584 //
585 #ifdef __EDKII_GLUE_BASE_PE_COFF_GET_ENTRY_POINT_LIB__
586 #endif
587 
588 //
589 // PeiServicesTablePointerLib
590 //
591 #ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
592 #endif
593 
594 //
595 // BasePostCodeLibDebug
596 //
597 #ifdef __EDKII_GLUE_BASE_POST_CODE_LIB_DEBUG__
598   //
599   // A DebugLib instance
600   // Usually EdkIIGluePeiDxeDebugLibReportStatusCodeLib is listed in module inf
601   //
602 #endif
603 
604 //
605 // PeiDxePostCodeLibReportStatusCode
606 //
607 #ifdef __EDKII_GLUE_PEI_DXE_POST_CODE_LIB_REPORT_STATUS_CODE__
608   //
609   // PEI or DXE ReportStatusCodeLib instance
610   // Usually EdkIIGluePei/DxeReportStatusCodeLib is listed in module inf
611   //
612 #endif
613 
614 //
615 //  Whether _gDriverExitBootServicesEvent[] contains effective handler
616 //
617 #if defined(__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) || defined(__EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__)
618   #define __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__ 1
619 #else
620   #define __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__ 0
621 #endif
622 
623 //
624 // Check against multiple instances of same library class being used
625 //
626 #if defined(__EDKII_GLUE_PEI_DXE_DEBUG_LIB_REPORT_STATUS_CODE__) && defined(__EDKII_GLUE_BASE_DEBUG_LIB_NULL__)
627   #error EdkIIGluePeiDxeDebugLibReportStatusCode and EdkIIGlueBaseDebugLibNull: can only be mutual exclusively used.
628 #endif
629 
630 #if defined(__EDKII_GLUE_BASE_PCI_LIB_PCI_EXPRESS__) && defined(__EDKII_GLUE_BASE_PCI_LIB_CF8__)
631   #error EdkIIGluePciLibPciExpress and EdkIIGluePciLibCf8: can only be mutual exclusively used.
632 #endif
633 
634 #if defined(__EDKII_GLUE_DXE_HOB_LIB__) && defined(__EDKII_GLUE_PEI_HOB_LIB__)
635   #error EdkIIGlueDxeHobLib and EdkIIGluePeiHobLib: can only be mutual exclusively used.
636 #endif
637 
638 #if defined(__EDKII_GLUE_BASE_POST_CODE_LIB_PORT_80__) && defined(__EDKII_GLUE_BASE_POST_CODE_LIB_DEBUG__)
639   #error EdkIIGlueBasePostCodeLibPort80 and EdkIIGlueBasePostCodeLibDebug: can only be mutual exclusively used.
640 #endif
641 
642 #if defined(__EDKII_GLUE_BASE_POST_CODE_LIB_PORT_80__) && defined(__EDKII_GLUE_PEI_DXE_POST_CODE_LIB_REPORT_STATUS_CODE__)
643   #error EdkIIGlueBasePostCodeLibPort80 and EdkIIGluePeiDxePostCodeLibReportStatusCode: can only be mutual exclusively used.
644 #endif
645 
646 #if defined(__EDKII_GLUE_BASE_POST_CODE_LIB_DEBUG__) && defined(__EDKII_GLUE_PEI_DXE_POST_CODE_LIB_REPORT_STATUS_CODE__)
647   #error EdkIIGlueBasePostCodeLibDebug and EdkIIGluePeiDxePostCodeLibReportStatusCode: can only be mutual exclusively used.
648 #endif
649 
650 #if defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__) && defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__)
651   #error EdkIIGluePeiServicesTablePointerLib and EdkIIGluePeiServicesTablePointerLibMm7: can only be mutual exclusively used.
652 #endif
653 
654 #if defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__) && defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__)
655   #error EdkIIGluePeiServicesTablePointerLib and EdkIIGluePeiServicesTablePointerLibKr1: can only be mutual exclusively used.
656 #endif
657 
658 #if defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__) && defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__)
659   #error EdkIIGluePeiServicesTablePointerLibMm7 and EdkIIGluePeiServicesTablePointerLibKr1: can only be mutual exclusively used.
660 #endif
661 
662 #if defined(__EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__) && defined(__EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__)
663   #error EdkIIGlueDxeReportStatusCodeLib and EdkIIGluePeiReportStatusCodeLib: can only be mutual exclusively used.
664 #endif
665 
666 #if defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__) && defined(__EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__)
667   #error EdkIIGlueSmmRuntimeDxeReportStatusCodeLib and EdkIIGluePeiReportStatusCodeLib: can only be mutual exclusively used.
668 #endif
669 
670 #if defined(__EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__) && defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
671   #error EdkIIGlueDxeReportStatusCodeLib and EdkIIGlueSmmRuntimeDxeReportStatusCodeLib: can only be mutual exclusively used.
672 #endif
673 
674 #if defined(__EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__) && defined(__EDKII_GLUE_PEI_MEMORY_ALLOCATION_LIB__)
675   #error EdkIIGlueDxeMemoryAllocationLib and EdkIIGluePeiMemoryAllocationLib: can only be mutual exclusively used.
676 #endif
677 
678 #if defined(__EDKII_GLUE_DXE_SMBUS_LIB__) && defined(__EDKII_GLUE_PEI_SMBUS_LIB__)
679   #error EdkIIGlueDxeSmbusLib and EdkIIGluePeiSmbusLib: can only be mutual exclusively used.
680 #endif
681 
682 #if defined(__EDKII_GLUE_BASE_IO_LIB_INTRINSIC__) && defined(__EDKII_GLUE_DXE_IO_LIB_CPU_IO__)
683   #error EdkIIGlueBaseIoLibIntrinsic and EdkIIGlueDxeIoLibCpuIo: can only be mutual exclusively used.
684 #endif
685 
686 //
687 // Some instances must be supplied
688 //
689 #ifdef __EDKII_GLUE_PEI_DXE_DEBUG_LIB_REPORT_STATUS_CODE__
690   #if !defined(__EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__) \
691       && !defined(__EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__) \
692       && !defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
693     #error You use EdkIIGluePeiDxeDebugLibReportStatusCode, \
694       so either EdkIIGlueDxeReportStatusCodeLib, EdkIIGluePeiReportStatusCodeLib, \
695       or EdkIIGlueSmmRuntimeDxeReportStatusCodeLib must be supplied
696   #endif
697 #endif
698 
699 #ifdef __EDKII_GLUE_BASE_POST_CODE_LIB_DEBUG__
700   #if !defined(__EDKII_GLUE_PEI_DXE_DEBUG_LIB_REPORT_STATUS_CODE__) && !defined(__EDKII_GLUE_BASE_DEBUG_LIB_NULL__)
701     #error You use EdkIIGlueBasePostCodeLibDebug, so either EdkIIGluePeiDxeDebugLibReportStatusCode or EdkIIGlueBaseDebugLibNull must be supplied
702   #endif
703 #endif
704 
705 //
706 //  EdkIIGlueUefiDriverModelLib used, but no Driver Binding Protocol defined
707 //
708 #ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
709   #ifndef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__
710     #error "EdkIIGlueUefiDriverModelLib used, but no Driver Binding Protocol defined. Please define __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__."
711   #endif
712 #endif
713 
714 //
715 // EdkII Glue Library Constructors:
716 // NOTE: the constructors must be called according to dependency order
717 //
718 // UefiBootServicesTableLib         UefiBootServicesTableLibConstructor()
719 // DxeIoLibCpuIo                    IoLibConstructor()
720 // UefiRuntimeServicesTableLib      UefiRuntimeServicesTableLibConstructor()
721 // EdkDxeRuntimeDriverLib           RuntimeDriverLibConstruct()
722 // SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
723 // DxeHobLib                        HobLibConstructor()
724 // UefiDriverModelLib               UefiDriverModelLibConstructor()
725 // PeiServicesTablePointerLib       PeiServicesTablePointerLibConstructor()
726 // PeiServicesTablePointerLibMm7    PeiServicesTablePointerLibConstructor()
727 // PeiServicesTablePointerLibKr1    PeiServicesTablePointerLibConstructor()
728 // DxeSmbusLib                      SmbusLibConstructor()
729 // DxeServicesTableLib              DxeServicesTableLibConstructor()
730 // DxeSalLib                        DxeSalLibConstructor()
731 //
732 
733 #ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
734 EFI_STATUS
735 EFIAPI
736 UefiBootServicesTableLibConstructor (
737   IN EFI_HANDLE        ImageHandle,
738   IN EFI_SYSTEM_TABLE  *SystemTable
739   );
740 #endif
741 
742 #ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
743 EFI_STATUS
744 EFIAPI
745 IoLibConstructor (
746   IN      EFI_HANDLE                ImageHandle,
747   IN      EFI_SYSTEM_TABLE          *SystemTable
748   );
749 #endif
750 
751 #ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
752 EFI_STATUS
753 EFIAPI
754 UefiRuntimeServicesTableLibConstructor (
755   IN EFI_HANDLE        ImageHandle,
756   IN EFI_SYSTEM_TABLE  *SystemTable
757   );
758 #endif
759 
760 #ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
761 EFI_STATUS
762 EFIAPI
763 RuntimeDriverLibConstruct (
764   IN EFI_HANDLE           ImageHandle,
765   IN EFI_SYSTEM_TABLE     *SystemTable
766   );
767 #endif
768 
769 #ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
770 EFI_STATUS
771 EFIAPI
772 ReportStatusCodeLibConstruct (
773   IN EFI_HANDLE           ImageHandle,
774   IN EFI_SYSTEM_TABLE     *SystemTable
775   );
776 #endif
777 
778 #ifdef __EDKII_GLUE_DXE_HOB_LIB__
779 EFI_STATUS
780 EFIAPI
781 HobLibConstructor (
782   IN EFI_HANDLE        ImageHandle,
783   IN EFI_SYSTEM_TABLE  *SystemTable
784   );
785 #endif
786 
787 #ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
788 EFI_STATUS
789 EFIAPI
790 UefiDriverModelLibConstructor (
791   IN EFI_HANDLE        ImageHandle,
792   IN EFI_SYSTEM_TABLE  *SystemTable
793   );
794 #endif
795 
796 #ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
797 EFI_STATUS
798 EFIAPI
799 PeiServicesTablePointerLibConstructor (
800   IN EFI_FFS_FILE_HEADER  *FfsHeader,
801   IN EFI_PEI_SERVICES     **PeiServices
802   );
803 #endif
804 
805 #ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
806 EFI_STATUS
807 EFIAPI
808 PeiServicesTablePointerLibConstructor (
809   IN EFI_FFS_FILE_HEADER  *FfsHeader,
810   IN EFI_PEI_SERVICES     **PeiServices
811   );
812 #endif
813 
814 #ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
815 EFI_STATUS
816 EFIAPI
817 PeiServicesTablePointerLibConstructor (
818   IN EFI_FFS_FILE_HEADER  *FfsHeader,
819   IN EFI_PEI_SERVICES     **PeiServices
820   );
821 #endif
822 
823 #ifdef __EDKII_GLUE_DXE_SMBUS_LIB__
824 EFI_STATUS
825 EFIAPI
826 SmbusLibConstructor (
827   IN EFI_HANDLE                ImageHandle,
828   IN EFI_SYSTEM_TABLE          *SystemTable
829   );
830 #endif
831 
832 #ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
833 EFI_STATUS
834 EFIAPI
835 DxeServicesTableLibConstructor (
836   IN EFI_HANDLE        ImageHandle,
837   IN EFI_SYSTEM_TABLE  *SystemTable
838   );
839 #endif
840 
841 #ifdef __EDKII_GLUE_EDK_DXE_SAL_LIB__
842 EFI_STATUS
843 EFIAPI
844 DxeSalLibConstructor (
845   IN EFI_HANDLE        ImageHandle,
846   IN EFI_SYSTEM_TABLE  *SystemTable
847   );
848 #endif
849 
850 //
851 // EdkII Glue Library Destructors:
852 // NOTE: the destructors must be called according to dependency order
853 //
854 // UefiDriverModelLibDestructor    UefiDriverModelLibDestructor()
855 // SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibDestruct()
856 // EdkDxeRuntimeDriverLib          RuntimeDriverLibDeconstruct()
857 //
858 #ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
859 EFI_STATUS
860 EFIAPI
861 UefiDriverModelLibDestructor (
862   IN EFI_HANDLE        ImageHandle,
863   IN EFI_SYSTEM_TABLE  *SystemTable
864   );
865 #endif
866 
867 #ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
868 EFI_STATUS
869 EFIAPI
870 ReportStatusCodeLibDestruct (
871   IN EFI_HANDLE        ImageHandle,
872   IN EFI_SYSTEM_TABLE  *SystemTable
873   );
874 #endif
875 
876 #ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
877 EFI_STATUS
878 EFIAPI
879 RuntimeDriverLibDeconstruct (
880   IN EFI_HANDLE        ImageHandle,
881   IN EFI_SYSTEM_TABLE  *SystemTable
882   );
883 #endif
884 
885 #endif
886