summaryrefslogtreecommitdiff
path: root/Core/CORE_DXE/DxeCore.h
blob: 0fb2611babd7f9cfab18f4b582714693a8348022 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
/*++

Copyright (c) 2004 - 2007, Intel Corporation                                                         
All rights reserved. This program and the accompanying materials                          
are licensed and made available under the terms and conditions of the BSD License         
which accompanies this distribution.  The full text of the license may be found at        
http://opensource.org/licenses/bsd-license.php                                            
                                                                                          
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             

Module Name:

  DxeCore.h

Abstract:

Revision History

--*/

#ifndef _DXECORE_H_
#define _DXECORE_H_

#include EFI_GUID_DEFINITION (PeiFlushInstructionCache)
#include EFI_GUID_DEFINITION (PeiPeCoffLoader)
#include EFI_GUID_DEFINITION (PeiTransferControl)
#include EFI_GUID_DEFINITION (Hob)
#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
#include EFI_GUID_DEFINITION (DxeServices)
#include EFI_GUID_DEFINITION (MemoryTypeInformation)
#include EFI_GUID_DEFINITION (StatusCodeCallerId)
#include EFI_GUID_DEFINITION (EventGroup)
#include EFI_GUID_DEFINITION (EventLegacyBios)
#include EFI_GUID_DEFINITION (FrameworkDevicePath)
#include EFI_ARCH_PROTOCOL_DEFINITION (Cpu)
#include EFI_ARCH_PROTOCOL_DEFINITION (Metronome)
#include EFI_ARCH_PROTOCOL_DEFINITION (MonotonicCounter)
#include EFI_ARCH_PROTOCOL_DEFINITION (Timer)
#include EFI_ARCH_PROTOCOL_DEFINITION (Bds)
#include EFI_ARCH_PROTOCOL_DEFINITION (Reset)
#include EFI_ARCH_PROTOCOL_DEFINITION (RealTimeClock)
#include EFI_ARCH_PROTOCOL_DEFINITION (Variable)
#include EFI_ARCH_PROTOCOL_DEFINITION (VariableWrite)
#include EFI_ARCH_PROTOCOL_DEFINITION (Capsule)
#include EFI_ARCH_PROTOCOL_DEFINITION (WatchdogTimer)
#include EFI_ARCH_PROTOCOL_DEFINITION (Runtime)
#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
#include EFI_ARCH_PROTOCOL_DEFINITION (Security)
//*** AMI PORTING BEGIN ***//
#include EFI_ARCH_PROTOCOL_DEFINITION (Security2)
//*** AMI PORTING END ***//
#include EFI_PROTOCOL_DEFINITION (Decompress)
#include EFI_PROTOCOL_DEFINITION (TianoDecompress)
#include EFI_PROTOCOL_DEFINITION (CustomizedDecompress)
#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)
#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeDispatch)
#include EFI_PROTOCOL_DEFINITION (LoadedImage)
#include EFI_PROTOCOL_DEFINITION (TcgService)
#include "LinkedList.h"
#include "DebugImageInfo.h"
#include "EfiCommonLib.h"
#include "Library.h"
#include "Peihob.h"
#include "EfiHobLib.h"
#include "DebugMask.h"


typedef struct {
  EFI_GUID                    *ProtocolGuid;
  VOID                        **Protocol;
  EFI_EVENT                   Event;
  VOID                        *Registration;
  BOOLEAN                     Present;
} ARCHITECTURAL_PROTOCOL_ENTRY;


//
// DXE Dispatcher Data structures
//

#define KNOWN_HANDLE_SIGNATURE  EFI_SIGNATURE_32('k','n','o','w')
typedef struct {
  UINTN           Signature;
  EFI_LIST_ENTRY  Link;         // mFvHandleList           
  EFI_HANDLE      Handle;
} KNOWN_HANDLE;


#define EFI_CORE_DRIVER_ENTRY_SIGNATURE EFI_SIGNATURE_32('d','r','v','r')
typedef struct {
  UINTN                           Signature;
  EFI_LIST_ENTRY                  Link;             // mDriverList

  EFI_LIST_ENTRY                  ScheduledLink;    // mScheduledQueue

  EFI_HANDLE                      FvHandle;
  EFI_GUID                        FileName;
  EFI_DEVICE_PATH_PROTOCOL        *FvFileDevicePath;
#if (PI_SPECIFICATION_VERSION < 0x00010000)
  EFI_FIRMWARE_VOLUME_PROTOCOL    *Fv;
#else
  EFI_FIRMWARE_VOLUME2_PROTOCOL    *Fv;
#endif
  VOID                            *Depex;
  UINTN                           DepexSize;

  BOOLEAN                         Before;
  BOOLEAN                         After;
  EFI_GUID                        BeforeAfterGuid;

  BOOLEAN                         Dependent;
  BOOLEAN                         Unrequested;
  BOOLEAN                         Scheduled;
  BOOLEAN                         Untrusted;
  BOOLEAN                         Initialized;
  BOOLEAN                         DepexProtocolError;

  EFI_HANDLE                      ImageHandle;

} EFI_CORE_DRIVER_ENTRY;

//
//The data structure of GCD memory map entry
//
#define EFI_GCD_MAP_SIGNATURE  EFI_SIGNATURE_32('g','c','d','m')
typedef struct {
  UINTN                 Signature;
  EFI_LIST_ENTRY        Link;
  EFI_PHYSICAL_ADDRESS  BaseAddress;
  UINT64                EndAddress;
  UINT64                Capabilities;
  UINT64                Attributes;
  EFI_GCD_MEMORY_TYPE   GcdMemoryType;
  EFI_GCD_IO_TYPE       GcdIoType;
  EFI_HANDLE            ImageHandle;
  EFI_HANDLE            DeviceHandle;
} EFI_GCD_MAP_ENTRY;

//
// DXE Core Global Variables
//
extern EFI_SYSTEM_TABLE                         *gST;
extern EFI_BOOT_SERVICES                        *gBS;
extern EFI_RUNTIME_SERVICES                     *gRT;
extern EFI_DXE_SERVICES                         *gDS;
extern EFI_HANDLE                               gDxeCoreImageHandle;

extern EFI_DECOMPRESS_PROTOCOL                  *gEfiDecompress;
extern EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *gEfiPeiFlushInstructionCache;
extern EFI_PEI_PE_COFF_LOADER_PROTOCOL          *gEfiPeiPeCoffLoader;
extern EFI_PEI_TRANSFER_CONTROL_PROTOCOL        *gEfiPeiTransferControl;

extern EFI_RUNTIME_ARCH_PROTOCOL                *gRuntime;
extern EFI_CPU_ARCH_PROTOCOL                    *gCpu;
extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL         *gWatchdogTimer;
extern EFI_METRONOME_ARCH_PROTOCOL              *gMetronome;
extern EFI_TIMER_ARCH_PROTOCOL                  *gTimer;
extern EFI_SECURITY_ARCH_PROTOCOL               *gSecurity;
//*** AMI PORTING BEGIN ***//
extern EFI_SECURITY2_ARCH_PROTOCOL              *gSecurity2;
//*** AMI PORTING END ***//
extern EFI_BDS_ARCH_PROTOCOL                    *gBds;
extern EFI_STATUS_CODE_PROTOCOL                 *gStatusCode;

extern EFI_TPL                                  gEfiCurrentTpl;

extern EFI_GUID                                 *gDxeCoreFileName;
extern EFI_LOADED_IMAGE_PROTOCOL                *gDxeCoreLoadedImage;

extern EFI_MEMORY_TYPE_INFORMATION              gMemoryTypeInformation[EfiMaxMemoryType + 1];

extern EFI_RUNTIME_ARCH_PROTOCOL                gRuntimeTemplate;

//
// Service Initialization Functions
//


VOID
CoreInitializePool (
  VOID
  )
/*++

Routine Description:

  Called to initialize the pool.

Arguments:

  None

Returns:

  None

--*/
;

VOID
CoreAddMemoryDescriptor (
  IN EFI_MEMORY_TYPE       Type,
  IN EFI_PHYSICAL_ADDRESS  Start,
  IN UINT64                NumberOfPages,
  IN UINT64                Attribute
  )
/*++

Routine Description:

  Called to initialize the memory map and add descriptors to
  the current descriptor list.

  N.B. The first descriptor that is added must be general usable
  memory as the addition allocates heap.

Arguments:

  Type          - The type of memory to add

  Start         - The starting address in the memory range
                  Must be page aligned

  NumberOfPages - The number of pages in the range

  Attribute     - Attributes of the memory to add

Returns:

  None.  The range is added to the memory map

--*/
;

VOID
CoreReleaseGcdMemoryLock (
  VOID
  )
/*++

Routine Description:
    Release memory lock on mGcdMemorySpaceLock

Arguments:
    None

Returns:
    None

--*/
;

VOID
CoreAcquireGcdMemoryLock (
  VOID
  )
/*++

Routine Description:
    Acquire memory lock on mGcdMemorySpaceLock

Arguments:
    None

Returns:
    None

--*/
;

EFI_STATUS
CoreInitializeMemoryServices (
  IN VOID                  **HobStart,
  IN EFI_PHYSICAL_ADDRESS  *MemoryBaseAddress,
  IN UINT64                *MemoryLength
  )
/*++

Routine Description:

  External function. Initializes the GCD and memory services based on the memory 
  descriptor HOBs.  This function is responsible for priming the GCD map and the
  memory map, so memory allocations and resource allocations can be made.  The first
  part of this function can not depend on any memory services until at least one
  memory descriptor is provided to the memory services.  Then the memory services
  can be used to intialize the GCD map.

Arguments:

  HobStart - The start address of the HOB.
  
  MemoryBaseAddress   - Start address of memory region found to init DXE core.
  
  MemoryLength        - Length of memory region found to init DXE core.

Returns:

  EFI_SUCCESS         - Memory services successfully initialized.

--*/
;


EFI_STATUS
CoreInitializeGcdServices (
  IN OUT VOID              **HobStart,
  IN EFI_PHYSICAL_ADDRESS  MemoryBaseAddress,
  IN UINT64                MemoryLength
  )
/*++

Routine Description:

  External function. Initializes the GCD and memory services based on the memory 
  descriptor HOBs.  This function is responsible for priming the GCD map and the
  memory map, so memory allocations and resource allocations can be made.  The first
  part of this function can not depend on any memory services until at least one
  memory descriptor is provided to the memory services.  Then the memory services
  can be used to intialize the GCD map. The HobStart will be relocated to a pool
  buffer.

Arguments:

  HobStart - The start address of the HOB
  
  MemoryBaseAddress   - Start address of memory region found to init DXE core.
  
  MemoryLength        - Length of memory region found to init DXE core.


Returns:

  EFI_SUCCESS         - GCD services successfully initialized.

--*/
;

EFI_STATUS
CoreInitializeEventServices (
  VOID
  )
/*++

Routine Description:

  Initializes "event" support and populates parts of the System and Runtime Table.

Arguments:

  None
    
Returns:

  EFI_SUCCESS - Always return success

--*/
;

EFI_STATUS
CoreInitializeImageServices (
  IN  VOID *HobStart
  )
/*++

Routine Description:

  Add the Image Services to EFI Boot Services Table and install the protocol
  interfaces for this image.

Arguments:

  HobStart        - The HOB to initialize

Returns:

  Status code.

--*/
;

VOID
CoreNotifyOnArchProtocolInstallation (
  VOID
  )
/*++

Routine Description:
  Creates an event that is fired everytime a Protocol of a specific type is installed

Arguments:
  NONE

Returns:
  NONE

--*/
;

EFI_STATUS
CoreAllEfiServicesAvailable (
  VOID
  )
/*++

Routine Description:
  Return TRUE if all AP services are availible.

Arguments:
  NONE

Returns:
  EFI_SUCCESS   - All AP services are available
  EFI_NOT_FOUND - At least one AP service is not available 

--*/
;

VOID
CalculateEfiHdrCrc (
  IN  OUT EFI_TABLE_HEADER    *Hdr
  )
/*++

Routine Description:

  Calcualte the 32-bit CRC in a EFI table using the service provided by the
  gRuntime service.

Arguments:

  Hdr  - Pointer to an EFI standard header

Returns:

  None

--*/
;

VOID
EFIAPI
CoreTimerTick (
  IN UINT64     Duration
  )
/*++

Routine Description:

  Called by the platform code to process a tick.

Arguments:

  Duration    - The number of 100ns elasped since the last call to TimerTick
    
Returns:

  None

--*/
;

VOID
CoreInitializeDispatcher (
  VOID
  )
/*++

Routine Description:

  Initialize the dispatcher. Initialize the notification function that runs when
  a FV protocol is added to the system.

Arguments:

  NONE

Returns:

  NONE 

--*/
;

BOOLEAN
CoreIsSchedulable (
  IN  EFI_CORE_DRIVER_ENTRY   *DriverEntry  
  )
/*++

Routine Description:

  This is the POSTFIX version of the dependency evaluator.  This code does 
  not need to handle Before or After, as it is not valid to call this 
  routine in this case. The SOR is just ignored and is a nop in the grammer.

  POSTFIX means all the math is done on top of the stack.

Arguments:

  DriverEntry - DriverEntry element to update
  
Returns:

  TRUE - If driver is ready to run.

  FALSE - If driver is not ready to run or some fatal error was found.

--*/
;

EFI_STATUS
CorePreProcessDepex (
  IN  EFI_CORE_DRIVER_ENTRY   *DriverEntry  
  )
/*++

Routine Description:

  Preprocess dependency expression and update DriverEntry to reflect the
  state of  Before, After, and SOR dependencies. If DriverEntry->Before
  or DriverEntry->After is set it will never be cleared. If SOR is set
  it will be cleared by CoreSchedule(), and then the driver can be 
  dispatched.

Arguments:

  DriverEntry - DriverEntry element to update

Returns:

  EFI_SUCCESS - It always works.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreExitBootServices (
  IN EFI_HANDLE   ImageHandle,
  IN UINTN        MapKey
  )
/*++

Routine Description:

  EFI 1.0 API to terminate Boot Services

Arguments:

  ImageHandle - Handle that represents the identity of the calling image

  MapKey      -Key to the latest memory map.

Returns:

  EFI_SUCCESS - Boot Services terminated
  EFI_INVALID_PARAMETER - MapKey is incorrect.

--*/
;

EFI_STATUS
CoreTerminateMemoryMap (
  IN UINTN        MapKey
  )
/*++

Routine Description:

  Make sure the memory map is following all the construction rules, 
  it is the last time to check memory map error before exit boot services.

Arguments:

  MapKey        - Memory map key

Returns:

  EFI_INVALID_PARAMETER       - Memory map not consistent with construction rules.
  
  EFI_SUCCESS                 - Valid memory map.

--*/
;

VOID
CoreNotifySignalList (
  IN EFI_GUID     *EventGroup
  )
/*++

Routine Description:

  Signals all events on the requested list

Arguments:

  SignalType      - The list to signal
    
Returns:

  None

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreInstallConfigurationTable (
  IN EFI_GUID         *Guid,
  IN VOID             *Table
  )
/*++

Routine Description:

  Boot Service called to add, modify, or remove a system configuration table from 
  the EFI System Table.

Arguments:

  Guid:   Pointer to the GUID for the entry to add, update, or remove
  Table:  Pointer to the configuration table for the entry to add, update, or
          remove, may be NULL.

Returns:
  
  EFI_SUCCESS               Guid, Table pair added, updated, or removed.
  EFI_INVALID_PARAMETER     Input GUID not valid.
  EFI_NOT_FOUND             Attempted to delete non-existant entry
  EFI_OUT_OF_RESOURCES      Not enough memory available

--*/
;

EFI_BOOTSERVICE
EFI_TPL
EFIAPI
CoreRaiseTpl (
  IN EFI_TPL  NewTpl
  )
/*++

Routine Description:

  Raise the task priority level to the new level.
  High level is implemented by disabling processor interrupts.

Arguments:

  NewTpl  - New task priority level
    
Returns:

  The previous task priority level

--*/
;

EFI_BOOTSERVICE
VOID
EFIAPI
CoreRestoreTpl (
  IN EFI_TPL  NewTpl
  )
/*++

Routine Description:

  Lowers the task priority to the previous value.   If the new 
  priority unmasks events at a higher priority, they are dispatched.

Arguments:

  NewTpl  - New, lower, task priority
    
Returns:

  None

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreStall (
  IN UINTN            Microseconds
  )
/*++

Routine Description:

  Introduces a fine-grained stall.

Arguments:

  Microseconds      The number of microseconds to stall execution

Returns:

  EFI_SUCCESS            - Execution was stalled for at least the requested amount
                           of microseconds.

  EFI_NOT_AVAILABLE_YET  - gMetronome is not available yet

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreSetWatchdogTimer (
  IN UINTN            Timeout,
  IN UINT64           WatchdogCode,
  IN UINTN            DataSize,
  IN CHAR16           *WatchdogData   OPTIONAL
  )
/*++

Routine Description:

  Sets the system's watchdog timer.

Arguments:

  Timeout         The number of seconds.  Zero disables the timer.

  ///////following  three parameters are left for platform specific using  
  
  WatchdogCode    The numberic code to log.  0x0 to 0xffff are firmware
  DataSize        Size of the optional data
  WatchdogData    Optional Null terminated unicode string followed by binary 
                  data.

Returns:

  EFI_SUCCESS               Timeout has been set
  EFI_NOT_AVAILABLE_YET     WatchdogTimer is not available yet 
  EFI_UNSUPPORTED           System does not have a timer (currently not used)
  EFI_DEVICE_ERROR          Could not complete due to hardware error

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreInstallProtocolInterface (
  IN OUT EFI_HANDLE     *UserHandle,
  IN EFI_GUID           *Protocol,
  IN EFI_INTERFACE_TYPE InterfaceType,
  IN VOID               *Interface
  )
/*++

Routine Description:

  Wrapper function to CoreInstallProtocolInterfaceNotify.  This is the public API which
  Calls the private one which contains a BOOLEAN parameter for notifications

Arguments:

  UserHandle     - The handle to install the protocol handler on,
                    or NULL if a new handle is to be allocated

  Protocol       - The protocol to add to the handle

  InterfaceType  - Indicates whether Interface is supplied in native form.

  Interface      - The interface for the protocol being added

Returns:

  Status code    

--*/
;

EFI_STATUS
CoreInstallProtocolInterfaceNotify (
  IN OUT EFI_HANDLE     *UserHandle,
  IN EFI_GUID           *Protocol,
  IN EFI_INTERFACE_TYPE InterfaceType,
  IN VOID               *Interface,
  IN BOOLEAN            Notify
  )
/*++

Routine Description:

  Installs a protocol interface into the boot services environment.

Arguments:

  UserHandle     - The handle to install the protocol handler on,
                   or NULL if a new handle is to be allocated

  Protocol       - The protocol to add to the handle

  InterfaceType  - Indicates whether Interface is supplied in native form.

  Interface      - The interface for the protocol being added
  
  Notify         - Whether to notify the notification list for this protocol 

Returns:

  EFI_INVALID_PARAMETER     - Invalid parameter
  
  EFI_OUT_OF_RESOURCES       - No enough buffer to allocate
  
  EFI_SUCCESS               - Protocol interface successfully installed

--*/
;

EFI_BOOTSERVICE11
EFI_STATUS
EFIAPI
CoreInstallMultipleProtocolInterfaces (
  IN OUT EFI_HANDLE           *Handle,
  ...
  )
/*++

Routine Description:

  Installs a list of protocol interface into the boot services environment.
  This function calls InstallProtocolInterface() in a loop. If any error
  occures all the protocols added by this function are removed. This is 
  basically a lib function to save space.

Arguments:

  Handle      - The handle to install the protocol handlers on,
                or NULL if a new handle is to be allocated
  ...         - EFI_GUID followed by protocol instance. A NULL terminates the 
                list. The pairs are the arguments to InstallProtocolInterface().
                All the protocols are added to Handle.

Returns:

  EFI_INVALID_PARAMETER       - Handle is NULL.
  
  EFI_SUCCESS                 - Protocol interfaces successfully installed.

--*/
;

EFI_BOOTSERVICE11
EFI_STATUS
EFIAPI
CoreUninstallMultipleProtocolInterfaces (
  IN EFI_HANDLE           Handle,
  ...
  )
/*++

Routine Description:

  Uninstalls a list of protocol interface in the boot services environment. 
  This function calls UnisatllProtocolInterface() in a loop. This is 
  basically a lib function to save space.

Arguments:

  Handle      - The handle to uninstall the protocol

  ...         - EFI_GUID followed by protocol instance. A NULL terminates the 
                list. The pairs are the arguments to UninstallProtocolInterface().
                All the protocols are added to Handle.

Returns:

  Status code    

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreReinstallProtocolInterface (
  IN EFI_HANDLE     UserHandle,
  IN EFI_GUID       *Protocol,
  IN VOID           *OldInterface,
  IN VOID           *NewInterface
  )
/*++

Routine Description:

  Reinstall a protocol interface on a device handle.  The OldInterface for Protocol is replaced by the NewInterface.

Arguments:

  UserHandle    - Handle on which the interface is to be reinstalled
  Protocol      - The numeric ID of the interface
  OldInterface  - A pointer to the old interface
  NewInterface  - A pointer to the new interface 


Returns:

  Status code.

  On EFI_SUCCESS            The protocol interface was installed
  On EFI_NOT_FOUND          The OldInterface on the handle was not found
  On EFI_INVALID_PARAMETER  One of the parameters has an invalid value
  
--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreUninstallProtocolInterface (
  IN EFI_HANDLE       UserHandle,
  IN EFI_GUID         *Protocol,
  IN VOID             *Interface
  )
/*++

Routine Description:

  Uninstalls all instances of a protocol:interfacer from a handle. 
  If the last protocol interface is remove from the handle, the 
  handle is freed.

Arguments:

  UserHandle      - The handle to remove the protocol handler from

  Protocol        - The protocol, of protocol:interface, to remove

  Interface       - The interface, of protocol:interface, to remove

Returns:

  EFI_INVALID_PARAMETER       - Protocol is NULL.
  
  EFI_SUCCESS                 - Protocol interface successfully uninstalled.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreHandleProtocol (
  IN  EFI_HANDLE       UserHandle,
  IN  EFI_GUID         *Protocol,
  OUT VOID             **Interface
  )
/*++

Routine Description:

  Queries a handle to determine if it supports a specified protocol.

Arguments:

  UserHandle  - The handle being queried.

  Protocol    - The published unique identifier of the protocol.

  Interface   - Supplies the address where a pointer to the corresponding Protocol
               Interface is returned.

Returns:

  The requested protocol interface for the handle
  
--*/  
;

EFI_BOOTSERVICE11
EFI_STATUS
EFIAPI
CoreOpenProtocol (
  IN  EFI_HANDLE                UserHandle,
  IN  EFI_GUID                  *Protocol,
  OUT VOID                      **Interface OPTIONAL,
  IN  EFI_HANDLE                ImageHandle,
  IN  EFI_HANDLE                ControllerHandle,
  IN  UINT32                    Attributes
  )
/*++

Routine Description:

  Locates the installed protocol handler for the handle, and
  invokes it to obtain the protocol interface. Usage information
  is registered in the protocol data base.

Arguments:

  UserHandle        - The handle to obtain the protocol interface on

  Protocol          - The ID of the protocol 

  Interface         - The location to return the protocol interface

  ImageHandle       - The handle of the Image that is opening the protocol interface
                    specified by Protocol and Interface.
  
  ControllerHandle  - The controller handle that is requiring this interface.

  Attributes     - The open mode of the protocol interface specified by Handle
                    and Protocol.

Returns:

  EFI_INVALID_PARAMETER       - Protocol is NULL.
  
  EFI_SUCCESS                 - Get the protocol interface.
  
--*/
;

EFI_BOOTSERVICE11
EFI_STATUS
EFIAPI
CoreOpenProtocolInformation (
  IN  EFI_HANDLE                          UserHandle,
  IN  EFI_GUID                            *Protocol,
  OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
  OUT UINTN                               *EntryCount
  )
/*++

Routine Description:

  Return information about Opened protocols in the system

Arguments:

  UserHandle  - The handle to close the protocol interface on

  Protocol    - The ID of the protocol 

  EntryBuffer - A pointer to a buffer of open protocol information in the form of
                EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.

  EntryCount  - Number of EntryBuffer entries

Returns:

  
--*/
;

EFI_BOOTSERVICE11
EFI_STATUS
EFIAPI
CoreCloseProtocol (
  IN  EFI_HANDLE                UserHandle,
  IN  EFI_GUID                  *Protocol,
  IN  EFI_HANDLE                ImageHandle,
  IN  EFI_HANDLE                ControllerHandle
  )
/*++

Routine Description:

  Close Protocol

Arguments:

  UserHandle       - The handle to close the protocol interface on

  Protocol         - The ID of the protocol 

  ImageHandle      - The user of the protocol to close

  ControllerHandle - The user of the protocol to close

Returns:

  EFI_INVALID_PARAMETER     - Protocol is NULL.
    
--*/
;

EFI_BOOTSERVICE11
EFI_STATUS
EFIAPI
CoreProtocolsPerHandle (
  IN  EFI_HANDLE       UserHandle,
  OUT EFI_GUID         ***ProtocolBuffer,
  OUT UINTN            *ProtocolBufferCount
  )
/*++

Routine Description:

  Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
 from pool.

Arguments:

  UserHandle           - The handle from which to retrieve the list of protocol interface
                          GUIDs.

  ProtocolBuffer       - A pointer to the list of protocol interface GUID pointers that are
                          installed on Handle.

  ProtocolBufferCount  - A pointer to the number of GUID pointers present in
                          ProtocolBuffer.

Returns:
  EFI_SUCCESS   -  The list of protocol interface GUIDs installed on Handle was returned in
                   ProtocolBuffer. The number of protocol interface GUIDs was
                   returned in ProtocolBufferCount.
  EFI_INVALID_PARAMETER   -  Handle is NULL.
  EFI_INVALID_PARAMETER   -  Handle is not a valid EFI_HANDLE.
  EFI_INVALID_PARAMETER   -  ProtocolBuffer is NULL.
  EFI_INVALID_PARAMETER   -  ProtocolBufferCount is NULL.
  EFI_OUT_OF_RESOURCES    -  There is not enough pool memory to store the results.
  
--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreRegisterProtocolNotify (
  IN  EFI_GUID       *Protocol,
  IN  EFI_EVENT      Event,
  OUT VOID           **Registration
  )
/*++

Routine Description:

  Add a new protocol notification record for the request protocol.

Arguments:

  Protocol      - The requested protocol to add the notify registration

  Event         - The event to signal 

  Registration  - Returns the registration record


Returns:

  EFI_INVALID_PARAMETER       - Invalid parameter

  EFI_SUCCESS                 - Successfully returned the registration record that has been added
  
--*/
;
  
EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreLocateHandle (
  IN     EFI_LOCATE_SEARCH_TYPE         SearchType,
  IN     EFI_GUID                       *Protocol OPTIONAL,
  IN     VOID                           *SearchKey OPTIONAL,
  IN OUT UINTN                          *BufferSize,
  OUT    EFI_HANDLE                     *Buffer
  )
/*++

Routine Description:

  Locates the requested handle(s) and returns them in Buffer.

Arguments:

  SearchType  - The type of search to perform to locate the handles

  Protocol    - The protocol to search for
  
  SearchKey   - Dependant on SearchType

  BufferSize  - On input the size of Buffer.  On output the 
                size of data returned.  

  Buffer      - The buffer to return the results in


Returns:

  EFI_BUFFER_TOO_SMALL      - Buffer too small, required buffer size is returned in BufferSize.

  EFI_INVALID_PARAMETER     - Invalid parameter
  
  EFI_SUCCESS               - Successfully found the requested handle(s) and returns them in Buffer.
  
--*/
;
  
EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreLocateDevicePath (
  IN     EFI_GUID                       *Protocol,
  IN OUT EFI_DEVICE_PATH_PROTOCOL       **FilePath,
  OUT    EFI_HANDLE                     *Device
  )
/*++

Routine Description:

  Locates the handle to a device on the device path that supports the specified protocol.

Arguments:

  Protocol    - The protocol to search for.
  FilePath    - On input, a pointer to a pointer to the device path. On output, the device
                  path pointer is modified to point to the remaining part of the devicepath.
  Device      - A pointer to the returned device handle.              

Returns:

  EFI_SUCCESS           - The resulting handle was returned.
  EFI_NOT_FOUND         - No handles matched the search.
  EFI_INVALID_PARAMETER - One of the parameters has an invalid value.

--*/
;

EFI_BOOTSERVICE11 
EFI_STATUS
EFIAPI
CoreLocateHandleBuffer (
  IN     EFI_LOCATE_SEARCH_TYPE         SearchType,
  IN     EFI_GUID                       *Protocol OPTIONAL,
  IN     VOID                           *SearchKey OPTIONAL,
  IN OUT UINTN                          *NumberHandles,
  OUT    EFI_HANDLE                     **Buffer
  )
/*++

Routine Description:

  Function returns an array of handles that support the requested protocol 
  in a buffer allocated from pool. This is a version of CoreLocateHandle()
  that allocates a buffer for the caller.

Arguments:

  SearchType           - Specifies which handle(s) are to be returned.
  Protocol             - Provides the protocol to search by.   
                         This parameter is only valid for SearchType ByProtocol.
  SearchKey            - Supplies the search key depending on the SearchType.
  NumberHandles      - The number of handles returned in Buffer.
  Buffer               - A pointer to the buffer to return the requested array of 
                         handles that support Protocol.

Returns:
  
  EFI_SUCCESS             - The result array of handles was returned.
  EFI_NOT_FOUND           - No handles match the search. 
  EFI_OUT_OF_RESOURCES    - There is not enough pool memory to store the matching results.
  EFI_INVALID_PARAMETER   - Invalid parameter

--*/
;

EFI_BOOTSERVICE11 
EFI_STATUS
EFIAPI
CoreLocateProtocol (
  IN    EFI_GUID  *Protocol,
  IN    VOID      *Registration OPTIONAL,
  OUT   VOID      **Interface
  )
/*++

Routine Description:

  Return the first Protocol Interface that matches the Protocol GUID. If
  Registration is pasased in return a Protocol Instance that was just add
  to the system. If Retistration is NULL return the first Protocol Interface
  you find.

Arguments:

  Protocol     - The protocol to search for
  
  Registration - Optional Registration Key returned from RegisterProtocolNotify() 

  Interface    - Return the Protocol interface (instance).

Returns:

  EFI_SUCCESS                 - If a valid Interface is returned
  
  EFI_INVALID_PARAMETER       - Invalid parameter
  
  EFI_NOT_FOUND               - Protocol interface not found

--*/
;

UINT64
CoreGetHandleDatabaseKey (
  VOID
  )
/*++

Routine Description:

  return handle database key.

Arguments:

  None
  
Returns:
  
  Handle database key.
  
--*/
;

VOID
CoreConnectHandlesByKey (
  UINT64  Key
  )
/*++

Routine Description:

  Go connect any handles that were created or modified while a image executed.

Arguments:

  Key  -  The Key to show that the handle has been created/modified

Returns:
  
  None
--*/
;

EFI_BOOTSERVICE11
EFI_STATUS 
EFIAPI
CoreConnectController (
  IN  EFI_HANDLE                ControllerHandle,
  IN  EFI_HANDLE                *DriverImageHandle    OPTIONAL,
  IN  EFI_DEVICE_PATH_PROTOCOL  *RemainingDevicePath  OPTIONAL,
  IN  BOOLEAN                   Recursive
  )
/*++

Routine Description:

  Connects one or more drivers to a controller.

Arguments:

  ControllerHandle            - Handle of the controller to be connected.

  DriverImageHandle           - DriverImageHandle A pointer to an ordered list of driver image handles.

  RemainingDevicePath         - RemainingDevicePath A pointer to the device path that specifies a child of the
                                controller specified by ControllerHandle.
    
  Recursive -                 - Whether the function would be called recursively or not.

Returns:

  Status code.

--*/
;

EFI_BOOTSERVICE11
EFI_STATUS 
EFIAPI
CoreDisconnectController (
  IN EFI_HANDLE  ControllerHandle,
  IN EFI_HANDLE  DriverImageHandle  OPTIONAL,
  IN EFI_HANDLE  ChildHandle        OPTIONAL
  )
/*++

Routine Description:

  Disonnects a controller from a driver

Arguments:

  ControllerHandle  - ControllerHandle The handle of the controller from which driver(s) 
                        are to be disconnected.
  DriverImageHandle - DriverImageHandle The driver to disconnect from ControllerHandle.
  ChildHandle       - ChildHandle The handle of the child to destroy.

Returns:

  EFI_SUCCESS           -  One or more drivers were disconnected from the controller.
  EFI_SUCCESS           -  On entry, no drivers are managing ControllerHandle.
  EFI_SUCCESS           -  DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.
  EFI_INVALID_PARAMETER -  ControllerHandle is not a valid EFI_HANDLE.
  EFI_INVALID_PARAMETER -  DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
  EFI_INVALID_PARAMETER -  ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
  EFI_OUT_OF_RESOURCES  -  There are not enough resources available to disconnect any drivers from ControllerHandle.
  EFI_DEVICE_ERROR      -  The controller could not be disconnected because of a device error.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreAllocatePages (
  IN      EFI_ALLOCATE_TYPE       Type,
  IN      EFI_MEMORY_TYPE         MemoryType,
  IN      UINTN                   NumberOfPages,
  IN OUT  EFI_PHYSICAL_ADDRESS    *Memory
  )
/*++

Routine Description:

  Allocates pages from the memory map.

Arguments:

  Type          - The type of allocation to perform

  MemoryType    - The type of memory to turn the allocated pages into

  NumberOfPages - The number of pages to allocate

  Memory        - A pointer to receive the base allocated memory address

Returns:

  Status. On success, Memory is filled in with the base address allocated
  
  EFI_INVALID_PARAMETER     - Parameters violate checking rules defined in spec.
  
  EFI_NOT_FOUND             - Could not allocate pages match the requirement.
  
  EFI_OUT_OF_RESOURCES      - No enough pages to allocate.
  
  EFI_SUCCESS               - Pages successfully allocated.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS 
EFIAPI
CoreFreePages (
  IN EFI_PHYSICAL_ADDRESS   Memory,
  IN UINTN                  NumberOfPages
  )
/*++

Routine Description:

  Frees previous allocated pages.

Arguments:

  Memory        - Base address of memory being freed

  NumberOfPages - The number of pages to free

Returns:

  EFI_NOT_FOUND       - Could not find the entry that covers the range
  
  EFI_INVALID_PARAMETER   - Address not aligned
  
  EFI_SUCCESS         -Pages successfully freed.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreGetMemoryMap (
  IN OUT UINTN                       *MemoryMapSize,
  IN OUT EFI_MEMORY_DESCRIPTOR       *Desc,
  OUT    UINTN                       *MapKey,
  OUT    UINTN                       *DescriptorSize,
  OUT    UINT32                      *DescriptorVersion
  )
/*++

Routine Description:

  Returns the current memory map.

Arguments:

  MemoryMapSize     - On input the buffer size of MemoryMap allocated by caller
                      On output the required buffer size to contain the memory map 
                      
  Desc              - The buffer to return the current memory map

  MapKey            - The address to return the current map key

  DescriptorSize    - The size in bytes for an individual EFI_MEMORY_DESCRIPTOR

  DescriptorVersion - The version number associated with the EFI_MEMORY_DESCRIPTOR

Returns:

  EFI_SUCCESS           The current memory map was returned successfully

  EFI_BUFFER_TOO_SMALL  The MemoryMap buffer was too small

  EFI_INVALID_PARAMETER One of the parameters has an invalid value

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreAllocatePool (
  IN   EFI_MEMORY_TYPE  PoolType,
  IN   UINTN            Size,
  OUT  VOID             **Buffer
  )
/*++

Routine Description:

  Allocate pool of a particular type.

Arguments:

  PoolType    - Type of pool to allocate

  Size        - The amount of pool to allocate

  Buffer      - The address to return a pointer to the allocated pool

Returns:

  EFI_INVALID_PARAMETER     - PoolType not valid
  
  EFI_OUT_OF_RESOURCES      - Size exceeds max pool size or allocation failed.  
  
  EFI_SUCCESS               - Pool successfully allocated.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreFreePool (
  IN VOID      *Buffer
  )
/*++

Routine Description:

  Frees pool.

Arguments:

  Buffer      - The allocated pool entry to free

Returns:

  EFI_INVALID_PARAMETER   - Buffer is not a valid value.
  
  EFI_SUCCESS             - Pool successfully freed.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreLoadImage (
  IN  BOOLEAN                    BootPolicy,
  IN  EFI_HANDLE                 ParentImageHandle,
  IN  EFI_DEVICE_PATH_PROTOCOL   *FilePath,
  IN  VOID                       *SourceBuffer   OPTIONAL,
  IN  UINTN                      SourceSize,
  OUT EFI_HANDLE                 *ImageHandle
  )
/*++

Routine Description:

  Loads an EFI image into memory and returns a handle to the image.

Arguments:

  BootPolicy          - If TRUE, indicates that the request originates from the boot manager,
                        and that the boot manager is attempting to load FilePath as a boot selection.
  ParentImageHandle   - The caller's image handle.
  FilePath            - The specific file path from which the image is loaded.
  SourceBuffer        - If not NULL, a pointer to the memory location containing a copy of 
                        the image to be loaded.
  SourceSize          - The size in bytes of SourceBuffer.
  ImageHandle         - Pointer to the returned image handle that is created when the image 
                        is successfully loaded.

Returns:

  EFI_SUCCESS            - The image was loaded into memory.
  EFI_NOT_FOUND          - The FilePath was not found.
  EFI_INVALID_PARAMETER  - One of the parameters has an invalid value.
  EFI_UNSUPPORTED        - The image type is not supported, or the device path cannot be 
                           parsed to locate the proper protocol for loading the file.
  EFI_OUT_OF_RESOURCES   - Image was not loaded due to insufficient resources.
--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreUnloadImage (
  IN EFI_HANDLE  ImageHandle
  )
/*++

Routine Description:

  Unload the specified image.

Arguments:

  ImageHandle       - The specified image handle.

Returns:

  EFI_INVALID_PARAMETER       - Image handle is NULL.
  
  EFI_UNSUPPORTED             - Attempt to unload an unsupported image.
  
  EFI_SUCCESS                 - Image successfully unloaded.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreStartImage (
  IN  EFI_HANDLE  ImageHandle,
  OUT UINTN       *ExitDataSize,
  OUT CHAR16      **ExitData  OPTIONAL
  )
/*++

Routine Description:

  Transfer control to a loaded image's entry point.

Arguments:

  ImageHandle     - Handle of image to be started.
  
  ExitDataSize    - Pointer of the size to ExitData
  
  ExitData        - Pointer to a pointer to a data buffer that includes a Null-terminated
                    Unicode string, optionally followed by additional binary data. The string
                    is a description that the caller may use to further indicate the reason for
                    the image's exit.

Returns:

  EFI_INVALID_PARAMETER     - Invalid parameter
  
  EFI_OUT_OF_RESOURCES       - No enough buffer to allocate
  
  EFI_SUCCESS               - Successfully transfer control to the image's entry point.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreExit (
  IN EFI_HANDLE  ImageHandle,
  IN EFI_STATUS  Status,
  IN UINTN       ExitDataSize,
  IN CHAR16      *ExitData  OPTIONAL
  )
/*++

Routine Description:

  Terminates the currently loaded EFI image and returns control to boot services.

Arguments:

  ImageHandle       - Handle that identifies the image. This parameter is passed to the image 
                      on entry.
  Status            - The image's exit code.
  ExitDataSize      - The size, in bytes, of ExitData. Ignored if ExitStatus is
                      EFI_SUCCESS.
  ExitData          - Pointer to a data buffer that includes a Null-terminated Unicode string,
                      optionally followed by additional binary data. The string is a 
                      description that the caller may use to further indicate the reason for
                      the image's exit.

Returns:

  EFI_INVALID_PARAMETER     - Image handle is NULL or it is not current image.
  
  EFI_SUCCESS               - Successfully terminates the currently loaded EFI image.
  
  EFI_ACCESS_DENIED         - Should never reach there.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreCreateEvent (
  IN  UINT32               Type,
  IN  EFI_TPL              NotifyTpl,
  IN  EFI_EVENT_NOTIFY     NotifyFunction,
  IN  VOID                 *NotifyContext,
  OUT EFI_EVENT            *pEvent
  )
/*++

Routine Description:

  Creates a general-purpose event structure

Arguments:

  Type                - The type of event to create and its mode and attributes
  NotifyTpl           - The task priority level of event notifications
  NotifyFunction      - Pointer to the event's notification function
  NotifyContext       - Pointer to the notification function's context; corresponds to
                        parameter "Context" in the notification function
  pEvent              - Pointer to the newly created event if the call succeeds; undefined otherwise

Returns:

  EFI_SUCCESS           - The event structure was created
  EFI_INVALID_PARAMETER - One of the parameters has an invalid value
  EFI_OUT_OF_RESOURCES  - The event could not be allocated

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreCreateEventEx (
  IN UINT32                   Type,
  IN EFI_TPL                  NotifyTpl,
  IN EFI_EVENT_NOTIFY         NotifyFunction,
  IN VOID                     *NotifyContext,
  IN CONST EFI_GUID           *EventGroup,    OPTIONAL
  OUT EFI_EVENT               *Event
  )
/*++

Routine Description:
  Creates a general-purpose event structure

Arguments:
  Type                - The type of event to create and its mode and attributes
  NotifyTpl           - The task priority level of event notifications
  NotifyFunction      - Pointer to the events notification function
  NotifyContext       - Pointer to the notification functions context; corresponds to
                        parameter "Context" in the notification function
  EventGrout          - GUID for EventGroup if NULL act the same as gBS->CreateEvent().
  Event               - Pointer to the newly created event if the call succeeds; undefined otherwise

Returns:
  EFI_SUCCESS           - The event structure was created
  EFI_INVALID_PARAMETER - One of the parameters has an invalid value
  EFI_OUT_OF_RESOURCES  - The event could not be allocated

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreSetTimer (
  IN EFI_EVENT            Event,
  IN EFI_TIMER_DELAY      Type,
  IN UINT64               TriggerTime
  )
/*++

Routine Description:

  Sets the type of timer and the trigger time for a timer event.

Arguments:

  UserEvent   - The timer event that is to be signaled at the specified time
  Type        - The type of time that is specified in TriggerTime
  TriggerTime - The number of 100ns units until the timer expires
  
Returns:

  EFI_SUCCESS           - The event has been set to be signaled at the requested time
  EFI_INVALID_PARAMETER - Event or Type is not valid

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreSignalEvent (
  IN EFI_EVENT            Event
  )
/*++

Routine Description:

  Signals the event.  Queues the event to be notified if needed
    
Arguments:

  Event - The event to signal
    
Returns:

  EFI_INVALID_PARAMETER - Parameters are not valid.
  
  EFI_SUCCESS - The event was signaled.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreWaitForEvent (
  IN  UINTN        NumberOfEvents,
  IN  EFI_EVENT    *UserEvents,
  OUT UINTN        *UserIndex
  )
/*++

Routine Description:

  Stops execution until an event is signaled.
    
Arguments:

  NumberOfEvents  - The number of events in the UserEvents array
  UserEvents      - An array of EFI_EVENT
  UserIndex       - Pointer to the index of the event which satisfied the wait condition
    
Returns:

  EFI_SUCCESS           - The event indicated by Index was signaled.
  EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or 
                          Event was not a valid type
  EFI_UNSUPPORTED       - The current TPL is not TPL_APPLICATION

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreCloseEvent (
  IN EFI_EVENT            Event
  )
/*++

Routine Description:

  Closes an event and frees the event structure.
    
Arguments:

  UserEvent - Event to close
    
Returns:

  EFI_INVALID_PARAMETER - Parameters are not valid.
  
  EFI_SUCCESS - The event has been closed

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreCheckEvent (
  IN EFI_EVENT            Event
  )
/*++

Routine Description:

  Check the status of an event
    
Arguments:

  UserEvent - The event to check
    
Returns:

  EFI_SUCCESS           - The event is in the signaled state
  EFI_NOT_READY         - The event is not in the signaled state
  EFI_INVALID_PARAMETER - Event is of type EVT_NOTIFY_SIGNAL

--*/
;

EFI_STATUS
CoreAddMemorySpace (
  IN EFI_GCD_MEMORY_TYPE   GcdMemoryType,
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length,
  IN UINT64                Capabilities
  )
/*++

Routine Description:

  Add a segment of memory space to GCD map and add all available pages in this segment 
  as memory descriptors.

Arguments:
    
  GcdMemoryType     - Memory type of the segment.
  
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
  Capabilities      - alterable attributes of the segment.

Returns:

  EFI_SUCCESS       - Merged this segment into GCD map.

--*/
;

EFI_STATUS
CoreAllocateMemorySpace (
  IN     EFI_GCD_ALLOCATE_TYPE  GcdAllocateType,
  IN     EFI_GCD_MEMORY_TYPE    GcdMemoryType,
  IN     UINTN                  Alignment,
  IN     UINT64                 Length,
  IN OUT EFI_PHYSICAL_ADDRESS   *BaseAddress,
  IN     EFI_HANDLE             ImageHandle,
  IN     EFI_HANDLE             DeviceHandle OPTIONAL
  )
/*++

Routine Description:

  Allocate memory space on GCD map.

Arguments:
  
  GcdAllocateType   - The type of allocate operation
  
  GcdMemoryType     - The desired memory type
  
  Alignment         - Align with 2^Alignment
  
  Length            - Length to allocate
  
  BaseAddress       - Base address to allocate
  
  ImageHandle       - The image handle consume the allocated space.
  
  DeviceHandle      - The device handle consume the allocated space.

Returns:

  EFI_INVALID_PARAMETER       - Invalid parameter.
  
  EFI_NOT_FOUND               - No descriptor contains the desired space.
  
  EFI_SUCCESS                 - Memory space successfully allocated.

--*/
;

EFI_STATUS
CoreFreeMemorySpace (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:Routine Description:

  Free a segment of memory space in GCD map.

Arguments:
    
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
Returns:

  EFI_SUCCESS       - Space successfully freed.

--*/
;

EFI_STATUS
CoreRemoveMemorySpace (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:Routine Description:

  Remove a segment of memory space in GCD map.

Arguments:
    
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
Returns:

  EFI_SUCCESS       - Successfully a segment of memory space.

--*/
;

EFI_STATUS
CoreGetMemorySpaceDescriptor (
  IN  EFI_PHYSICAL_ADDRESS             BaseAddress,
  OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  *Descriptor
  )
/*++

Routine Description:

  Search all entries in GCD map which contains specified segment and build it to a descriptor.

Arguments:

  BaseAddress       - Specified start address
  
  Descriptor        - Specified length

Returns:

  EFI_INVALID_PARAMETER       - Invalid parameter
  
  EFI_SUCCESS                 - Successfully get memory space descriptor.

--*/
;

EFI_STATUS
CoreSetMemorySpaceAttributes (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length,
  IN UINT64                Attributes
  )
/*++

Routine Description:

  Set memory space with specified attributes.

Arguments:

  BaseAddress       - Specified start address
  
  Length            - Specified length
  
  Attributes        - Specified attributes

Returns:

  EFI_SUCCESS       - Successfully set attribute of a segment of memory space.

--*/
;

EFI_STATUS
CoreGetMemorySpaceMap (
  OUT UINTN                            *NumberOfDescriptors,
  OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  **MemorySpaceMap
  )
/*++

Routine Description:

  Transer all entries of GCD memory map into memory descriptors and pass to caller.

Arguments:

  NumberOfDescriptors       - Number of descriptors.
  
  MemorySpaceMap            - Descriptor array

Returns:

  EFI_INVALID_PARAMETER     - Invalid parameter
  
  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate
  
  EFI_SUCCESS               - Successfully get memory space map.

--*/
;

EFI_STATUS
CoreAddIoSpace (
  IN EFI_GCD_IO_TYPE       GcdIoType,
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:

  Add a segment of IO space to GCD map.

Arguments:
    
  GcdIoType         - IO type of the segment.
  
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.

Returns:

  EFI_SUCCESS       - Merged this segment into GCD map.

--*/
;

EFI_STATUS
CoreAllocateIoSpace (
  IN     EFI_GCD_ALLOCATE_TYPE  GcdAllocateType,
  IN     EFI_GCD_IO_TYPE        GcdIoType,
  IN     UINTN                  Alignment,
  IN     UINT64                 Length,
  IN OUT EFI_PHYSICAL_ADDRESS   *BaseAddress,
  IN     EFI_HANDLE             ImageHandle,
  IN     EFI_HANDLE             DeviceHandle OPTIONAL
  )
/*++

Routine Description:

  Allocate IO space on GCD map.

Arguments:
  
  GcdAllocateType   - The type of allocate operation
  
  GcdIoType         - The desired IO type
  
  Alignment         - Align with 2^Alignment
  
  Length            - Length to allocate
  
  BaseAddress       - Base address to allocate
  
  ImageHandle       - The image handle consume the allocated space.
  
  DeviceHandle      - The device handle consume the allocated space.

Returns:

  EFI_INVALID_PARAMETER       - Invalid parameter.
  
  EFI_NOT_FOUND               - No descriptor contains the desired space.
  
  EFI_SUCCESS                 - IO space successfully allocated.

--*/
;

EFI_STATUS
CoreFreeIoSpace (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:Routine Description:

  Free a segment of IO space in GCD map.

Arguments:
    
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
Returns:

  EFI_SUCCESS       - Space successfully freed.

--*/
;

EFI_STATUS
CoreRemoveIoSpace (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:Routine Description:

  Remove a segment of IO space in GCD map.

Arguments:
    
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
Returns:

  EFI_SUCCESS       - Successfully removed a segment of IO space.

--*/
;

EFI_STATUS
CoreGetIoSpaceDescriptor (
  IN  EFI_PHYSICAL_ADDRESS         BaseAddress,
  OUT EFI_GCD_IO_SPACE_DESCRIPTOR  *Descriptor
  )
/*++

Routine Description:

  Search all entries in GCD map which contains specified segment and build it to a descriptor.

Arguments:

  BaseAddress       - Specified start address
  
  Descriptor        - Specified length

Returns:

  EFI_INVALID_PARAMETER       - Descriptor is NULL.
  
  EFI_SUCCESS                 - Successfully get the IO space descriptor.

--*/
;

EFI_STATUS
CoreGetIoSpaceMap (
  OUT UINTN                        *NumberOfDescriptors,
  OUT EFI_GCD_IO_SPACE_DESCRIPTOR  **IoSpaceMap
  )
/*++

Routine Description:

  Transer all entries of GCD IO map into IO descriptors and pass to caller.

Arguments:

  NumberOfDescriptors       - Number of descriptors.
  
  IoSpaceMap                - Descriptor array

Returns:

  EFI_INVALID_PARAMETER     - Invalid parameter
  
  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate
  
  EFI_SUCCESS               - Successfully get IO space map.

--*/
;

EFI_DXESERVICE
EFI_STATUS
EFIAPI
CoreDispatcher (
  VOID
  )
/*++

Routine Description:

  This is the main Dispatcher for DXE and it exits when there are no more 
  drivers to run. Drain the mScheduledQueue and load and start a PE
  image for each driver. Search the mDiscoveredList to see if any driver can 
  be placed on the mScheduledQueue. If no drivers are placed on the
  mScheduledQueue exit the function. On exit it is assumed the Bds()
  will be called, and when the Bds() exits the Dispatcher will be called 
  again.

Arguments:

  NONE

Returns:

  EFI_ALREADY_STARTED - The DXE Dispatcher is already running

  EFI_NOT_FOUND       - No DXE Drivers were dispatched

  EFI_SUCCESS         - One or more DXE Drivers were dispatched

--*/
;
EFI_DXESERVICE
EFI_STATUS
EFIAPI
CoreSchedule (
  IN  EFI_HANDLE  FirmwareVolumeHandle,
  IN  EFI_GUID    *DriverName
  )
/*++

Routine Description:

  Check every driver and locate a matching one. If the driver is found, the Unrequested
  state flag is cleared.

Arguments:

  FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware 
                         file specified by DriverName.

  DriverName           - The Driver name to put in the Dependent state.

Returns:

  EFI_SUCCESS   - The DriverName was found and it's SOR bit was cleared

  EFI_NOT_FOUND - The DriverName does not exist or it's SOR bit was not set.

--*/
;

EFI_DXESERVICE
EFI_STATUS
EFIAPI
CoreTrust (
  IN  EFI_HANDLE  FirmwareVolumeHandle,
  IN  EFI_GUID    *DriverName
  )
/*++

Routine Description:

  Convert a driver from the Untrused back to the Scheduled state

Arguments:

  FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware 
                         file specified by DriverName.

  DriverName           - The Driver name to put in the Scheduled state

Returns:

  EFI_SUCCESS   - The file was found in the untrusted state, and it was promoted 
                  to the trusted state.

  EFI_NOT_FOUND - The file was not found in the untrusted state.

--*/
;

BOOLEAN
CoreGrowBuffer (
  IN OUT EFI_STATUS       *Status,
  IN OUT VOID             **Buffer,
  IN     UINTN            BufferSize
  )
/*++

Routine Description:

    Helper function called as part of the code needed
    to allocate the proper sized buffer for various 
    EFI interfaces.

Arguments:

    Status      - Current status

    Buffer      - Current allocated buffer, or NULL

    BufferSize  - Current buffer size needed
    
Returns:
    
    TRUE - if the buffer was reallocated and the caller 
    should try the API again.

    FALSE - buffer could not be allocated and the caller
    should not try the API again.

--*/
;

EFI_STATUS
EFIAPI
FwVolDriverInit (
  IN EFI_HANDLE                   ImageHandle,
  IN EFI_SYSTEM_TABLE             *SystemTable
  )
/*++

Routine Description:
    This routine is the driver initialization entry point.  It initializes the
    libraries, and registers two notification functions.  These notification
    functions are responsible for building the FV stack dynamically.
    
Arguments:
    ImageHandle   - The image handle.
    SystemTable   - The system table.
    
Returns:
    EFI_SUCCESS   - Function successfully returned.

--*/
;

EFI_STATUS
EFIAPI
InitializeSectionExtraction (
  IN EFI_HANDLE                   ImageHandle,
  IN EFI_SYSTEM_TABLE             *SystemTable
  )
/*++

Routine Description: 
  Entry point of the section extraction code. Initializes an instance of the 
  section extraction interface and installs it on a new handle.

Arguments:  
  ImageHandle   EFI_HANDLE: A handle for the image that is initializing this driver
  SystemTable   EFI_SYSTEM_TABLE: A pointer to the EFI system table        

Returns:  
  EFI_SUCCESS:  Driver initialized successfully
  EFI_OUT_OF_RESOURCES:   Could not allocate needed resources

--*/
;

EFI_STATUS
CoreProcessFirmwareVolume (
  IN  VOID                         *FvHeader,
  IN  UINTN                        Size, 
  OUT EFI_HANDLE                   *FVProtocolHandle
  )
/*++

Routine Description:
    This DXE service routine is used to process a firmware volume. In
    particular, it can be called by BDS to process a single firmware
    volume found in a capsule. 

Arguments:
    FvHeader              - pointer to a firmware volume header
    Size                  - the size of the buffer pointed to by FvHeader
    FVProtocolHandle      - the handle on which a firmware volume protocol
                            was produced for the firmware volume passed in.

Returns:
    EFI_OUT_OF_RESOURCES  - if an FVB could not be produced due to lack of 
                            system resources
    EFI_VOLUME_CORRUPTED  - if the volume was corrupted
    EFI_SUCCESS           - a firmware volume protocol was produced for the
                            firmware volume

--*/
;

//
//Functions used during debug buils
//
DEBUG_CODE (
  VOID
  CoreDisplayMissingArchProtocols (
    VOID
    )
  /*++

  Routine Description:
    Displays Architectural protocols that were not loaded and are required for DXE core to function
    Only used in Debug Builds

  Arguments:
    NONE

  Returns:
    NONE

  --*/;
  
  VOID
  CoreDisplayDiscoveredNotDispatched (
    VOID
    )
  /*++

  Routine Description:

    Traverse the discovered list for any drivers that were discovered but not loaded 
    because the dependency experessions evaluated to false

  Arguments:

    NONE

  Returns:

    NONE 

  --*/;
)
#endif