summaryrefslogtreecommitdiff
path: root/Include/Protocol/SMBios.h
blob: 1a564e6c032a02d5239aaa3fb921c3d14456b4a2 (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
//**********************************************************************//
//**********************************************************************//
//**                                                                  **//
//**        (C)Copyright 1985-2016, American Megatrends, Inc.         **//
//**                                                                  **//
//**                       All Rights Reserved.                       **//
//**                                                                  **//
//**        5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093         **//
//**                                                                  **//
//**                       Phone: (770)-246-8600                      **//
//**                                                                  **//
//**********************************************************************//
//**********************************************************************//

//**********************************************************************//
// $Header: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SMBios.h 30    4/07/16 5:51p Davidd $
//
// $Revision: 30 $
//
// $Date: 4/07/16 5:51p $
//**********************************************************************//
// Revision History
// ----------------
// $Log: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SMBios.h $
// 
// 30    4/07/16 5:51p Davidd
// [TAG]  		EIP231162
// [Category]  	New Feature
// [Description]  	Merge Aptio V Smbios -09 changes for Aptio 4
// 4.6.5.5_SMBIOS_40 release
// [Files]  		Smbios.sdl
// SmbiosDynamicData.h
// Smbios.h
// SmbiosStaticData.sdl
// SmbiosStaticData.asm
// SmbData.mac
// SmbMacro.aid
// SmbDesc.def
//
// 29    6/13/14 3:25p Davidd
// [TAG]  		EIP171151
// [Category]  	Bug Fix
// [Severity]  	Minor
// [Symptom]  	Smbios Type 12 - Changes beyond string #8 were not
// persistent across the reboot
// [RootCause]  	Test flag is only 8 bits
// [Solution]  	Create and use array of test flags for specified number of
// Type 12 structure
// [Files]  		Smbios.c
// Smbios.h
//
// 28    6/03/13 6:21p Davidd
// [TAG]  		EIP125665
// [Category]  	New Feature
// [Description]  	Request to Support multiple instances of SMBIOS Type 3
// structure (merge EIP106206 into Aptio 4)
// [Files]  		Smbdata.mac
// SmbiosStaticData.sdl
// Smbstruc.def
// Smbios.c
// SmbiosDMIEditFunc.c
// Smbios.h
//
// 27    5/29/13 12:48p Davidd
// [TAG]  		EIP124735
// [Category]  	Spec Update
// [Severity]  	Normal
// [Description]  	SMBIOS 2.8.0 specification support for Aptio 4
// [Files]  		Smb.equ
// Smbdata.mac
// Smbdesc.def
// Smbstruc.def
// Smbios.c
// Smbios.h
// SmbiosDynamicData.h
//
// 26    5/23/13 2:38p Davidd
// [TAG]  		    EIP104836
// [Category]  	New Feature
// [Description]  	DMIEdit support edit type 4
// [Files]  		SmbiosBoard.c
//                 SmbiosDMIEditBoard.sdl
//                 Smbios.c
//                 SmbiosDMIEditFunc.c
//                 Smbios.h
//                 SmbiosDynamicData.h
//
// 25    6/11/12 11:24a Davidd
// [TAG]  		EIP92170
// [Category]  	Improvement
// [Description]  	Adding DmiEdit support for multiple instances of Smbios
// type 39 structure to match with AMI DmiEdit tool
// [Files]  		Smbios.h
// Smbios.c
// SmbiosStaticData.sdl
//
// 24    3/26/12 12:04p Davidd
// [TAG]  		EIP84370
// [Category]  	New Feature
// [Description]  	Flash memory(type 16 and 17) on aptio
// [Files]  		Smbdata.mac
// SmbiosStaticData.asm
// SmbiosStaticData.sdl
// Smbios.c
// Smbios.mak
// Smbios.h
//
// 23    3/09/12 10:56a Davidd
// [TAG]  		EIP81469
// [Category]  	Bug Fix
// [Severity]  	Normal
// [Symptom]  	SMBIOS protocl didn't compatible with PI1.1
// [RootCause]  	PI1.1 protocol functions incorrectly added after AMI
// functions of Smbios protocols.
// [Solution]  	Moved PI1.1 protocol functions to the top of the protocol.
// [Files]  		Smbios.c
// Smbios.h
//
// 22    1/17/12 4:37p Davidd
// [TAG]           EIP78264
// [Category]      Improvement
// [Description]   SMBOS Type 2 (Spec 2.7.1) - No multiple type 2 support
// [Files]         Smbios.c
//                 Smbios.h
//                 Smbdata.mac
//                 Smbdesc.def
//                 SmbiosStaticData.sdl
//
// 21    11/17/11 2:43p Davidd
// [TAG]           EIP74579
// [Category]      Improvement
// [Description]   Update SMBIOS moudule to let AMDELNX support SMBIOS
// spec 2.7
//                 (remove the 64 characters string limitation)
// [Files]         Smbios.h
//                 SmbiosStaticData.sdl
//                 Smbios.c
//                 SMBios.dxs
//                 SmbiosDMIEdit.sdl
//                 SmbiosDMIEdit.h
//                 SmbiosDMIEditFunc.c
//                 SmbiosNvram.c
//                 SmbiosFlashData.sdl
//
// 20    10/05/11 3:53p Davidd
// [Category]      NEW FEATURE
// [Description]   Allow Smbios Type 2 Location field and Type 3 SKU
// Number field
//                 to be updated by dmieditwingui tool
// [Files]         Smbios.c
//                 SmbiosDMIEditFunc.c
//                 Smbdata.mac
//                 Smbios.h
//
// 19    8/03/11 10:54a Davidd
// [TAG]           EIP64029
// [Category]      NEW FEATURE
// [Description]   Allow SMBIOS Type 22 to be modified using DMIEdit
// [Files]         Smbios.h
//                 Smbios.c
//                 SmbiosDmieditFunc.c
//
// 18    6/10/11 3:02p Davidd
// [TAG]           EIP61934
// [Category]      Improvement
// [Description]   Dependency viewer is not working in Chief River Project
// [Files]         Smbios.h
//
// 17    5/04/11 3:34p Davidd
// [TAG]           EIP57144
// [Category]      NEW FEATURE
// [Description]   Allow SMBIOS Type 39 to be modified using DMIEdit
// [Files]         SmbiosBoard.c
//                 Smbios.h
//                 SmbiosDynamicData.h
//                 Smbios.c
//                 SmbiosDmieditFunc.c
//                 SmbiosNvramFunc.c
//
// 16    11/02/10 4:17p Davidd
// [TAG]           EIP42938
// [Category]      BUG FIX
// [Severity]      Critical
// [Symptom]       The SMBIOS string field cannot be successfully updated
// if it was programmed to Null by the 3-party SMBIOS tool
// [RootCause]     BIOS did not have support for NULL strings
// [Solution]      Problem has been fixed with code changes
// [Files]
//    Smbios.c
//    SmbiosDMIEditFunc.c
//    SmbiosGetFlashData.c
//    SmbiosDMIEdit.h
//    SmbiosFlashData.sdl
//
// 15    10/08/10 8:14p Davidd
// [TAG]		EIP43278
//
// [Category]	Function Request
//
// [Severity]	Normal
//
// [Description]	SMBIOS 2.7 requirement
//
// [Files]		Include\Protocol\Smbios.h
// 		Include\Protocol\SmbiosDynamicData.h
// 		Board\EM\SMBIOS\SMBiosStaticData\SmbiosStaticData.sdl
// 		Board\EM\SMBIOS\SMBiosStaticData\SMBDATA.MAC
// 		Board\EM\SMBIOS\SMBiosStaticData\SMBSTRUC.DEF
// 		Board\EM\SMBIOS\SMBiosStaticData\SMBMACRO.AID
// 		Board\EM\SMBIOS\SMBiosStaticData\Smbdesc.def
// 		Board\EM\SMBIOS\SMBiosStaticData\SMB.EQU
//
// 14    5/18/10 5:15p Davidd
// Added PnP function 52h commands 3 and 4 support - EIP 38010.
//
// 13    5/06/10 10:37a Davidd
// Added Smbios PI 1.1 support.
//
// 12    11/23/09 5:52p Davidd
// Corrected the DMIEdit data not updated after being updated 5-6 times
// (when NVRAM is used to store DMIEdit data) - EIP 30837.
//
// 11    1/28/09 11:36a Davidd
//
// 10    11/14/08 4:44p Davidd
// - Added GetFreeHandle protocol
// - Added AddStructureByHandle protocol
// - Added ReadStructureByType protocol
//
// 9     10/23/08 6:22p Davidd
// Added changes to support SMBIOS version 2.5 and 2.6.
//
// 8     11/26/07 11:39a Davidd
//
// 7     11/21/07 10:39a Davidd
// Added SmbiosUpdateHeader protocol.
//
// 6     11/09/07 11:15a Davidd
// Reapply the fixes for long string that were inadvertently changed in
// revision 5.
//
// 5     6/21/07 3:11p Pats
// Modified to support editing of SMBIOS structure type 0, offsets 5 and 8
//
// 4     4/18/07 12:36p Davidd
// Fixed long strings (64 characters) problem after being updated with
// DMIEdit and system restarted.
//
// 3     3/28/07 7:49p Davidd
// Updated the year on the AMI banner
//
// 2     12/15/06 1:16p Davidd
// Code cleanup and reformatted to coding  standard.
//
// 1     3/02/06 2:29p Davidd
//
// 3     8/10/05 10:35a Davidd
// Removed definition for EFI_SMBIOS_PROTOCOL_GUID. It has been moved to
// SmbiosGetFlashDataProtocol.h
//
// 2     7/20/05 12:41p Davidd
// - Corrected dynamic update on-board device problem.
//
// 1     4/29/05 2:03p Davidd
// Initial checkin.
//
//**********************************************************************//

#ifndef _Smbios_DRIVER_H
#define _Smbios_DRIVER_H

#include <token.h>

#define EFI_SMBIOS_STATIC_DATA_GUID \
    {0xdaf4bf89, 0xce71, 0x4917, { 0xb5, 0x22, 0xc8, 0x9d, 0x32, 0xfb, 0xc5, 0x9f }}
#define EFI_SMBIOS_NVRAM_DATA_GUID \
    {0x4b3082a3, 0x80c6, 0x4d7e, { 0x9c, 0xd0, 0x58, 0x39, 0x17, 0x26, 0x5d, 0xf1 }}

#ifndef EFI_SMBIOS_PROTOCOL_GUID
    #if (SMBIOS_PI_1_1 == 0)
        #define EFI_SMBIOS_PROTOCOL_GUID \
            {0x5e90a50d, 0x6955, 0x4a49, { 0x90, 0x32, 0xda, 0x38, 0x12, 0xf8, 0xe8, 0xe5 }}
    #else
        #define EFI_SMBIOS_PROTOCOL_GUID \
            {0x03583ff6, 0xcb36, 0x4940, { 0x94, 0x7e, 0xb9, 0xb3, 0x9f, 0x4a, 0xfa, 0xf7 }}
    #endif
#endif

//**********************************************************************//
//  DMI ERROR Codes
//**********************************************************************//

#define DMI_SUCCESS                 0x00
#define DMI_UNKNOWN_FUNCTION        0x81
#define DMI_FUNCTION_NOT_SUPPORTED  0x82
#define DMI_INVALID_HANDLE          0x83
#define DMI_BAD_PARAMETER           0x84
#define DMI_INVALID_SUBFUNCTION     0x85
#define DMI_NO_CHANGE               0x86
#define DMI_ADD_STRUCTURE_FAILED    0x87
#define DMI_READ_ONLY               0x8D
#define DMI_LOCK_NOT_SUPPORTED      0x90
#define DMI_CURRENTLY_LOCKED        0x91
#define DMI_INVALID_LOCK            0x92

//**********************************************************************//

#pragma pack(1)

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_TABLE_ENTRY_POINT
//
// Description: SMBIOS Structure Table Entry Point
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT8   AnchorString[4];
    UINT8   EntryPointStructureChecksum;
    UINT8   EntryPointLength;
    UINT8   MajorVersion;
    UINT8   MinorVersion;
    UINT16  MaxStructureSize;
    UINT8   EntryPointRevision;
    UINT8   FormattedArea[5];
    UINT8   IntermediateAnchorString[5];
    UINT8   IntermediateChecksum;
    UINT16  TableLength;
    UINT32  TableAddress;
    UINT16  NumberOfSmbiosStructures;
    UINT8   SmbiosBCDRevision;
} SMBIOS_TABLE_ENTRY_POINT;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_STRUCTURE_HEADER
//
// Description: SMBIOS Structure Header - Common for all structures
//              Describing the type, size of the fixed area, and handle
//              of the structure.
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT8   Type;
    UINT8   Length;
    UINT16  Handle;
} SMBIOS_STRUCTURE_HEADER;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_BIOS_INFO
//
// Description: BIOS Information Structure (Type 0)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     BiosVendor;                     // String number
    UINT8                     BiosVersion;                    // String number
    UINT16                    BiosStartingAddrSegment;
    UINT8                     BiosReleaseDate;                // String number
    UINT8                     BiosRomSize;
    UINT32                    BiosChar_1;
    UINT32                    BiosChar_2;
    UINT8                     BiosCharExtByte1;
    UINT8                     BiosCharExtByte2;
    UINT8                     SystemBiosMajorRelease;
    UINT8                     SystemBiosMinorRelease;
    UINT8                     ECFirmwareMajorRelease;
    UINT8                     ECFirmwareMinorRelease;
} SMBIOS_BIOS_INFO;                                           // TYPE 0

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SYSTEM_INFO
//
// Description: System Information Structure (Type 1)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Manufacturer;                   // String number
    UINT8                     ProductName;                    // String number
    UINT8                     Version;                        // String number
    UINT8                     SerialNumber;                   // String number
    EFI_GUID                  Uuid;
    UINT8                     WakeupType;
    UINT8                     SkuNumber;
    UINT8                     Family;
} SMBIOS_SYSTEM_INFO;                                         // TYPE 1

#if BASE_BOARD_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_BASE_BOARD_INFO
//
// Description: Base Board (or Module) Information Structure (Type 2)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Manufacturer;                   // String number
    UINT8                     ProductName;                    // String number
    UINT8                     Version;                        // String number
    UINT8                     SerialNumber;                   // String number
    UINT8                     AssetTag;                       // String number
    UINT8                     FeatureTag;
    UINT8                     Location;                       // String number
    UINT16                    ChassisHandle;
    UINT8                     BoardType;
    UINT8                     NumberOfObjectHandles;
#if NUMBER_OF_OBJECT_HANDLES != 0
    UINT8                     ObjectHandles[NUMBER_OF_OBJECT_HANDLES];
#endif
} SMBIOS_BASE_BOARD_INFO;                                     // TYPE 2
#endif

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SYSTEM_ENCLOSURE_INFO
//
// Description: System Enclosure or Chassis Information Structure (Type 3)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Manufacturer;                   // String number
    UINT8                     Type;
    UINT8                     Version;                        // String number
    UINT8                     SerialNumber;                   // String number
    UINT8                     AssetTag;                       // String number
    UINT8                     BootupState;
    UINT8                     PowerSupplyState;
    UINT8                     ThermalState;
    UINT8                     SecurityStatus;
    UINT32                    OemDefined;
    UINT8                     Height;
    UINT8                     NumberOfPowerCord;
    UINT8                     ElementCount;
    UINT8                     ElementRecordLength;
#if ((ELEMENT_COUNT != 0) && (ELEMENT_LEN != 0))
    UINT8                     Elements[ELEMENT_COUNT * ELEMENT_LEN];
#endif
    UINT8                     SkuNumber;
} SMBIOS_SYSTEM_ENCLOSURE_INFO;                               // TYPE 3

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_PROCESSOR_INFO
//
// Description: Processor Information Structure (Type 4)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     SocketDesignation;              // String number
    UINT8                     ProcessotType;
    UINT8                     Family;
    UINT8                     ProcessorManufacturer;          // String number
    UINT32                    ProcessorID_1;
    UINT32                    ProcessorID_2;
    UINT8                     ProcessorVersion;               // String number
    UINT8                     Voltage;
    UINT16                    ExtClockFreq;
    UINT16                    MaxSpeed;
    UINT16                    CurrentSpeed;
    UINT8                     Status;
    UINT8                     Upgrade;
    UINT16                    L1CacheHandle;
    UINT16                    L2CacheHandle;
    UINT16                    L3CacheHandle;
    UINT8                     SerialNumber;                   // String number
    UINT8                     AssetTag;                       // String number
    UINT8                     PartNumber;                     // String number
    UINT8                     CoreCount;                      // Number of cores per processor socket
    UINT8                     CoreEnabled;                    // Number of enabled cores per processor socket
    UINT8                     ThreadCount;                    // Number of threads per processor socket
    UINT16                    ProcessorChar;                  // Defines which functions the processor supports
    UINT16                    Family2;
} SMBIOS_PROCESSOR_INFO;                                      // TYPE 4

#if MEM_CTRL_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_MEM_CONTROLLER_INFO
//
// Description: Memory Controller Information Structure (Type 5)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     ErrDetMethod;
    UINT8                     ECC;
    UINT8                     SupportInterleave;
    UINT8                     CurrentInterleave;
    UINT8                     MaxMemModuleSize;
    UINT16                    SupportSpeed;
    UINT16                    SupportMemTypes;
    UINT8                     MemModuleVoltage;
    UINT8                     NumberMemSlots;
    UINT16                    MemModuleConfigHandle[NUMBER_OF_MEM_MODULE];
    UINT8                     EnabledECC;
} SMBIOS_MEM_CONTROLLER_INFO;                                 // TYPE 5
#endif

#if MEM_MODULE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_MEM_MODULE_INFO
//
// Description: Memory Module Information Structure (Type 6)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     SocketDesignation;
    UINT8                     BankConnections;
    UINT8                     CurrentSpeed;
    UINT16                    CurrentMemType;
    UINT8                     InstalledSize;
    UINT8                     EnabledSize;
    UINT8                     ErrorStatus;
} SMBIOS_MEM_MODULE_INFO;                                     // TYPE 6
#endif

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_CACHE_INFO
//
// Description: Cache Information Structure (Type 7)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     SocketDesignation;
    UINT16                    CacheConfig;
    UINT16                    MaxCacheSize;
    UINT16                    InstalledSize;
    UINT16                    SupportSRAM;
    UINT16                    CurrentSRAM;
    UINT8                     CacheSpeed;
    UINT8                     ErrorCorrectionType;
    UINT8                     SystemCacheType;
    UINT8                     Associativity;
} SMBIOS_CACHE_INFO;                                          // TYPE 7

#if PORT_CONNECTOR_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_PORT_CONN_INFO
//
// Description: Port Connector Information Structure (Type 8)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     IntRefDesig;
    UINT8                     IntConnType;
    UINT8                     ExtRefDesig;
    UINT8                     ExtConnType;
    UINT8                     PortType;
} SMBIOS_PORT_CONN_INFO;                                      // TYPE 8
#endif

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SYSTEM_SLOTS_INFO
//
// Description: System Slot Information Structure (Type 9)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     SlotDesig;
    UINT8                     SlotType;
    UINT8                     SlotDataBusWidth;
    UINT8                     CurrentUsage;
    UINT8                     SlotLength;
    UINT16                    SlotID;
    UINT8                     SlotChar_1;
    UINT8                     SlotChar_2;
    UINT16                    SegGroupNumber;
    UINT8                     BusNumber;
    UINT8                     DevFuncNumber;
} SMBIOS_SYSTEM_SLOTS_INFO;                                   // TYPE 9

#if ONBOARD_DEVICE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SINGLE_DEV_INFO
//
// Description: Single Device Information
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT8                     DeviceType;
    UINT8                     DescStringNum;
} SINGLE_DEV_INFO;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_ONBOARD_DEV_INFO
//
// Description: On Board Devices Information Structure (Type 10)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    SINGLE_DEV_INFO    OnBoardDev;
} SMBIOS_ONBOARD_DEV_INFO;                                    // TYPE 10
#endif

#if OEM_STRING_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_OEM_STRINGS_INFO
//
// Description: OEM Strings Structure (Type 11)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Count;
} SMBIOS_OEM_STRINGS_INFO;                                    // TYPE 11
#endif

#if SYSTEM_CONFIG_OPTION_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SYSTEM_CONFIG_INFO
//
// Description: System Configuration Options (Type 12)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Count;
} SMBIOS_SYSTEM_CONFIG_INFO;                                  // TYPE 12
#endif

#if BIOS_LANGUAGE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_BIOS_LANG_INFO
//
// Description: BIOS Language Information (Type 13)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     InstallableLang;
    UINT8                     Flags;
    UINT8                     Reserved[15];
    UINT8                     CurrentLang;
} SMBIOS_BIOS_LANG_INFO;                                      // TYPE 13
#endif

#if EVENT_LOG_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  EVENT_LOG_DESCRIPTOR
//
// Description: Event Log Descriptor - Part of the System Event Log (Type 15)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT8                     LogType;
    UINT8                     VariableDataFormatType;
} EVENT_LOG_DESCRIPTOR;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_EVENT_LOG_INFO
//
// Description: System Event Log (Type 15)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT16                    LogAreaLength;
    UINT16                    LogHeaderStartOffset;
    UINT16                    LogDataStartOffset;
    UINT8                     AccessMethod;
    UINT8                     LogStatus;
    UINT32                    LogChangeToken;
    UINT32                    AccesMethodAddr;
    UINT8                     LogHeaderFormat;
    UINT8                     NumbetOfLogTypeDesc;
    UINT8                     LengthOfLogTypeDesc;
    EVENT_LOG_DESCRIPTOR      LogDescriptors[NO_OF_SUPPORTED_EVENTS];
} SMBIOS_EVENT_LOG_INFO;                                      // TYPE 15
#endif

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_PHYSICAL_MEM_ARRAY_INFO
//
// Description: Physical Memory Array (Type 16)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Location;
    UINT8                     Use;
    UINT8                     MemErrorCorrection;
    UINT32                    MaxCapacity;
    UINT16                    MemErrInfoHandle;
    UINT16                    NumberOfMemDev;
    UINT64                    ExtMaxCapacity;
} SMBIOS_PHYSICAL_MEM_ARRAY_INFO;                             // TYPE 16

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_MEMORY_DEVICE_INFO
//
// Description: Memory Device (Type 17)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT16                    PhysicalMemArrayHandle;
    UINT16                    MemErrorInfoHandle;
    UINT16                    TotalWidth;
    UINT16                    DataWidth;
    UINT16                    Size;
    UINT8                     FormFactor;
    UINT8                     DeviceSet;
    UINT8                     DeviceLocator;
    UINT8                     BankLocator;
    UINT8                     MemoryType;
    UINT16                    TypeDetail;
    UINT16                    Speed;
    UINT8                     Manufacturer;
    UINT8                     SerialNumber;
    UINT8                     AssetTag;
    UINT8                     PartNumber;
    UINT8                     Attributes;
    UINT32                    ExtendedSize;
    UINT16                    ConfMemClkSpeed;
    UINT16                    MinimumVoltage;
    UINT16                    MaximumVoltage;
    UINT16                    ConfiguredVoltage;
} SMBIOS_MEMORY_DEVICE_INFO;                                  // TYPE 17

#if MEMORY_ERROR_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_MEMORY_ERROR_INFO
//
// Description: 32-bit Memory Error Information (Type 18)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     ErrorType;
    UINT8                     ErrorGranularity;
    UINT8                     ErrorOperation;
    UINT32                    VendorSyndrome;
    UINT32                    MemArrayErrorAddress;
    UINT32                    DeviceErrorAddress;
    UINT32                    ErrorResolution;
} SMBIOS_MEMORY_ERROR_INFO;                                   // TYPE 18
#endif

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_MEM_ARRAY_MAP_ADDR_INFO
//
// Description: Memory Array Mapped Address (Type 19)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT32                    StartingAddress;
    UINT32                    EndingAddress;
    UINT16                    MemoryArrayHandle;
    UINT8                     PartitionWidth;
    UINT64                    ExtendedStartAddr;
    UINT64                    ExtendedEndAddr;
} SMBIOS_MEM_ARRAY_MAP_ADDR_INFO;                             // TYPE 19

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_MEM_DEV_MAP_ADDR_INFO
//
// Description: Memory Device Mapped Address (Type 20)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT32                    StartingAddress;
    UINT32                    EndingAddress;
    UINT16                    MemoryDeviceHandle;
    UINT16                    MemoryArrayMapAddrHandle;
    UINT8                     PartitionRowPosition;
    UINT8                     InterleavePosition;
    UINT8                     InterleaveDataDepth;
    UINT64                    ExtendedStartAddr;
    UINT64                    ExtendedEndAddr;
} SMBIOS_MEM_DEV_MAP_ADDR_INFO;                               // TYPE 20

#if BUILTIN_POINTING_DEVICE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_POINTING_DEV_INFO
//
// Description: Built-in Pointing Device (Type 21)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Type;
    UINT8                     Interface;
    UINT8                     NumberOfButtons;
} SMBIOS_POINTING_DEV_INFO;                                   // TYPE 21
#endif

#if PORTABLE_BATTERY_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_PORTABLE_BATTERY_INFO
//
// Description: Portable Battery (Type 22)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Location;
    UINT8                     Manufacturer;
    UINT8                     ManufacturerData;
    UINT8                     SerialNumber;
    UINT8                     DeviceName;
    UINT8                     DeviceChemistry;
    UINT16                    DesignCapacity;
    UINT16                    DesignVoltage;
    UINT8                     SBDSVersion;
    UINT8                     MaxErrorInBatteryData;
    UINT16                    SBDSSerialNumber;
    UINT16                    SBDSManufacturerDate;
    UINT8                     SBDSDeviceChecmistry;
    UINT8                     DesignCapabilityMult;
    UINT32                    OEMSpecific;
} SMBIOS_PORTABLE_BATTERY_INFO;                               // TYPE 22
#endif

#if SYSTEM_RESET_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SYSTEM_RESET_INFO
//
// Description: System Reset (Type 23)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Capabilities;
    UINT16                    ResetCount;
    UINT16                    ResetLimit;
    UINT16                    TimerInterval;
    UINT16                    TimeOut;
} SMBIOS_SYSTEM_RESET_INFO;                                   // TYPE 23
#endif

#if HARDWARE_SECURITY_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_HARDWARE_SECURITY_INFO
//
// Description: Hardware Security (Type 24)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     HardwareSecSettings;
} SMBIOS_HARDWARE_SECURITY_INFO;                              // TYPE 24
#endif

#if SYSTEM_POWER_CONTROLS_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SYSTEM_PWR_CONTROL_INFO
//
// Description: System Power Control (Type 25)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     NextSchedulePwrOnMonth;
    UINT8                     NextSchedulePwrOnDayOfMonth;
    UINT8                     NextSchedulePwrOnHour;
    UINT8                     NextSchedulePwrOnMinute;
    UINT8                     NextSchedulePwrOnSecond;
} SMBIOS_SYSTEM_PWR_CONTROL_INFO;                             // TYPE 25
#endif

#if VOLTAGE_PROBE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_VOLTAGE_PROBE_INFO
//
// Description: Voltage Probe (Type 26)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Description;
    UINT8                     LocationAndStatus;
    UINT16                    MaxValue;
    UINT16                    MinValue;
    UINT16                    Resolution;
    UINT16                    Tolerance;
    UINT16                    Accuracy;
    UINT32                    OEMDefine;
    UINT16                    NorminalValue;
} SMBIOS_VOLTAGE_PROBE_INFO;                                  // TYPE 26
#endif

#if COOLING_DEVICE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_COOLING_DEV_INFO
//
// Description: Cooling Device (Type 27)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT16                    TempProbeHandle;
    UINT8                     DevTypeAndStatus;
    UINT8                     CoolingUnitGroup;
    UINT32                    OEMDefine;
    UINT16                    NorminalSpeed;
    UINT8                     Description;
} SMBIOS_COOLING_DEV_INFO;                                    // TYPE 27
#endif

#if TEMPERATURE_PROBE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_TEMPERATURE_PROBE_INFO
//
// Description: Temperature Probe (Type 28)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Description;
    UINT8                     LocationAndStatus;
    UINT16                    MaxValue;
    UINT16                    MinValue;
    UINT16                    Resolution;
    UINT16                    Tolerance;
    UINT16                    Accuracy;
    UINT32                    OEMDefine;
    UINT16                    NorminalValue;
} SMBIOS_TEMPERATURE_PROBE_INFO;                              // TYPE 28
#endif

#if ELECTRICAL_PROBE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_ELECT_CURRENT_PROBE_INFO
//
// Description: Electrical Current Probe (Type 29)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Description;
    UINT8                     LocationAndStatus;
    UINT16                    MaxValue;
    UINT16                    MinValue;
    UINT16                    Resolution;
    UINT16                    Tolerance;
    UINT16                    Accuracy;
    UINT32                    OEMDefine;
    UINT16                    NorminalValue;
} SMBIOS_ELECT_CURRENT_PROBE_INFO;                            // TYPE 29
#endif

#if OUT_OF_BAND_REMOTE_ACCESS_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_OUT_OF_BAND_REMOTE_ACCESS_INFO
//
// Description: Out-of-Band Remote Access (Type 30)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     ManufacturerName;
    UINT8                     Connections;
} SMBIOS_OUT_OF_BAND_REMOTE_ACCESS_INFO;                      // TYPE 30
#endif

#if MKF_BIS_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_BIS_ENTRYPOINT_INFO
//
// Description: Boot Integrity Services (BIS) Entry Point (Type 31)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Checksum;
    UINT8                     Reserved_1;
    UINT16                    Reserved_2;
    UINT32                    BISEntrySt;
    UINT32                    BISEntryTt;
    UINT64                    Reserved_3;
    UINT32                    Reserved_4;
} SMBIOS_BIS_ENTRYPOINT_INFO;                                 // TYPE 31
#endif

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SYSTEM_BOOT_INFO
//
// Description: System Boot Information (Type 32)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Reserved[6];
    UINT8                     BootStatus[10];
} SMBIOS_SYSTEM_BOOT_INFO;                                    // TYPE 32

#if SIXTY_FOURBIT_MEMORY_ERROR_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SIXTYFOUR_MEM_ERROR_INFO
//
// Description: 64-bit Memory Error Information (Type 33)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     ErrorType;
    UINT8                     ErrorGranularity;
    UINT8                     ErrorOperation;
    UINT32                    VendorSyndrome;
    UINT64                    MemoryArrayErrAddr;
    UINT64                    DeviceErrAddr;
    UINT32                    ErrorResolution;
} SMBIOS_SIXTYFOUR_MEM_ERROR_INFO;                            // TYPE 33
#endif

#if MANAGEMENT_DEVICE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_MANAGEMENT_DEV_INFO
//
// Description: Management Device (Type 34)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     Description;
    UINT8                     Type;
    UINT32                    Address;
    UINT8                     AddressType;
} SMBIOS_MANAGEMENT_DEV_INFO;                                 // TYPE 34
#endif

#if MEMORY_CHANNEL_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  TYPE37_MEMORY_DEVICE
//
// Description: Type 37 Memory Device
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT8                     MemDevLoad;
    UINT16                    MemDevHandle;
} TYPE37_MEMORY_DEVICE;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_MEMORY_CHANNEL_INFO
//
// Description: Memory Channel (Type 37)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     ChannelType;
    UINT8                     MaxChannelLoad;
    UINT8                     MemDeviceCount;
    TYPE37_MEMORY_DEVICE      MemoryDevice[NUMBER_OF_MEMORY_CHANNELS];
} SMBIOS_MEMORY_CHANNEL_INFO;                                 // TYPE 37
#endif

#if IPMI_DEVICE_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_IPMI_DEV_INFO
//
// Description: IPMI Device Information (Type 38)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     InterfaceType;
    UINT8                     IPMISpecRevision;
    UINT8                     I2CSlaveAddr;
    UINT8                     NVStorageDevAddr;
    UINT64                    BaseAddress;
} SMBIOS_IPMI_DEV_INFO;                                       // TYPE 38
#endif

#if SYSTEM_POWER_SUPPLY_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_SYSTEM_PWR_SUPPY_INFO
//
// Description: System Power Supply (Type 39)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     PwrUnitGroup;
    UINT8                     Location;
    UINT8                     DeviceName;
    UINT8                     Manufacturer;
    UINT8                     SerialNumber;
    UINT8                     AssetTagNumber;
    UINT8                     ModelPartNumber;
    UINT8                     RevisionLevel;
    UINT16                    MaxPwrCapacity;
    UINT16                    PwrSupplyChar;
    UINT16                    InputVoltProbeHandle;
    UINT16                    CoolingDevHandle;
    UINT16                    InputCurrentProbeHandle;
} SMBIOS_SYSTEM_PWR_SUPPY_INFO;                               // TYPE 39
#endif

#if ADDITIONAL_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_ADDITIONAL_INFO
//
// Description: System Power Supply (Type 40)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT8                     EntryLength;
    UINT16                    RefHandle;
    UINT8                     RefOffset;
    UINT8                     StringNum;
    union {
        UINT8                 Value8;
        UINT16                Value16;
        UINT32                Value32;
    };
} ADDITIONAL_INFO_ENTRY;

typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     NumAdditionalInfoEntries;
    ADDITIONAL_INFO_ENTRY     AdditionalEntries[ADDITIONAL_INFO_COUNT];
} SMBIOS_ADDITIONAL_INFO;                                     // TYPE 40
#endif

#if ONBOARD_DEVICE_EXTENDED_INFO
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_ONBOARD_DEVICE_EXTENDED_INFO
//
// Description: Onboard Devices Extended Information (Type 41)
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    SMBIOS_STRUCTURE_HEADER   StructureType;
    UINT8                     RefDesignation;
    UINT8                     DeviceType;
    UINT8                     DeviceTypeInstance;
    UINT16                    SegGroupNumber;
    UINT8                     BusNumber;
    UINT8                     DevFuncNumber;
} SMBIOS_ONBOARD_DEV_EXT_INFO;                                // TYPE 41
#endif

typedef struct _JEDEC_MF_ID {
    UINT8           VendorId;
    CHAR8           *ManufacturerString;
} JEDEC_MF_ID;

typedef struct  {
	UINT8		NumContCode;
	UINT8       ModuleManufacturer;
	UINT8       *Manufacturer;
} JEDEC_DATA;

//**********************************************************************//
// SMBIOS NVRAM DATA
//**********************************************************************//
//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE
//
// Description: DMI Type X data
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[32];
} SMBIOS_NVRAM_TYPE;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE0
//
// Description: DMI Type 0 data
// UINT32   Flag;		// Bit0 = Vendor string changed
//						// Bit1 = BIOS version string changed
//						// Bit2 = BIOS Release Date string changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[3];
} SMBIOS_NVRAM_TYPE0;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE1
//
// Description: DMI Type 1 data
// UINT32   Flag;		// Bit0 = Manufacturer string changed
//						// Bit1 = Product Name string changed
//						// Bit2 = Version string changed
//						// Bit3 = Serial Number string changed
//						// Bit4 = SKU string changed
//						// Bit5 = Family string changed
//						// Bit16 = UUID changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[6];
    EFI_GUID                  Uuid;
} SMBIOS_NVRAM_TYPE1;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE2
//
// Description: DMI Type 2 data
// UINT32   Flag;		// Bit0 = Manufacturer string changed
//						// Bit1 = Product Name string changed
//						// Bit2 = Version string changed
//						// Bit3 = Serial Number string changed
//						// Bit4 = Asset Tag string changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[6];
    UINT16                    Handle;
} SMBIOS_NVRAM_TYPE2;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE3
//
// Description: DMI Type 3 data
// UINT32   Flag;		// Bit0 = Manufacturer string changed
//						// Bit1 = Version string changed
//						// Bit2 = Serial Number string changed
//						// Bit3 = Asset Tag string changed
//                      // Bit4 = SKU Number string changed
//						// Bit16 = Chassis Type changed
//						// Bit17 = OEM-defined changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[5];
    UINT8                     Type;
    UINT32                    OemDefined;
    UINT16                    Handle;
} SMBIOS_NVRAM_TYPE3;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE4
//
// Description: DMI Type 4 data
// UINT32   Flag;		// Bit0 = Serial Number string changed
//						// Bit1 = Asset Tag string changed
//						// Bit2 = Part Number string changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[6];
} SMBIOS_NVRAM_TYPE4;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE11
//
// Description: DMI Type 11 data
// UINT32   Flag;		// Bit(x) = String #(x) changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[32];
} SMBIOS_NVRAM_TYPE11;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE12
//
// Description: DMI Type 12 data
// UINT32   Flag;		// Bit(x) = String #(x) changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[32];
} SMBIOS_NVRAM_TYPE12;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE22
//
// Description: DMI Type 22 data
// UINT8   Flag;		// Bit0 = Location string changed
//						// Bit1 = Manufacturer string changed
//						// Bit2 = Manufacturer Date changed
//						// Bit3 = Serial Number string changed
//						// Bit4 = Device Name string changed
//						// Bit5 = SBDS Version Number string changed
//						// Bit6 = SBDS Device Chemistry string changed
//						// Bit16 = Device Chemistry changed
//						// Bit17 = Design Capacity changed
//						// Bit18 = Design Voltage changed
//						// Bit19 = Maximum Error in Battery Data changed
//						// Bit20 = SBDS Serial Number changed
//						// Bit21 = SBDS Manufacturer Date changed
//						// Bit22 = Design Capacity Multiplier changed
//						// Bit23 = OEM-specific changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[7];
    UINT8                     DeviceChemistry;
    UINT16                    DesignCapacity;
    UINT16                    DesignVoltage;
    UINT8                     MaxErrorInBatteryData;
    UINT16                    SbdsSerialNumber;
    UINT16                    SbdsManufacturerDate;
    UINT8                     DesignCapacityMultiplier;
    UINT32                    OemSpecific;
    UINT16                    Handle;
} SMBIOS_NVRAM_TYPE22;

//<AMI_SHDR_START>
//----------------------------------------------------------------------------
// Name:  SMBIOS_NVRAM_TYPE39
//
// Description: DMI Type 39 data
// UINT8   Flag;		// Bit0 = Location string changed
//						// Bit1 = Device Name string changed
//						// Bit2 = Manufacturer string changed
//						// Bit3 = Serial Number string changed
//						// Bit4 = Asset Tag string changed
//						// Bit5 = Model Part Number string changed
//						// Bit6 = Revision Level string changed
//						// Bit16 = Power Unit Group changed
//						// Bit17 = Max Power Capacity changed
//						// Bit18 = Power Supply Characteristics changed
//						// Bit19 = Input Voltage Probe Handle changed
//						// Bit20 = Cooling Device Handle changed
//						// Bit21 = Input Current Probe Handle changed
//----------------------------------------------------------------------------
//<AMI_SHDR_END>
typedef struct {
    UINT32                    Flag;
    CHAR8                     *StringSet[7];
    UINT8                     PwrUnitGroup;
    UINT16                    MaxPwrCapacity;
    UINT16                    PwrSupplyChar;
    UINT16                    InputVoltageProbeHandle;
    UINT16                    CoolingDevHandle;
    UINT16                    InputCurrentProbeHandle;
    UINT16                    Handle;
} SMBIOS_NVRAM_TYPE39;

typedef struct {
    UINT8                   Type;
	UINT16					Handle;
    UINT8                   Offset;
    UINT8   				Flags;      // Bit0 = Write Once
                        				// Bit1 = Delete Structure
                        				// Bit2 = Add structure
} DMI_VAR;

typedef struct {
    UINT8                   Offset;
    UINT8                   SpecStrNum;
    UINT8                   CurStrValue;
} STRING_TABLE;

#pragma pack()

//**********************************************************************//
// SMBIOS Protocol
//**********************************************************************//

typedef struct _EFI_SMBIOS_PROTOCOL EFI_SMBIOS_PROTOCOL;

typedef VOID* (EFIAPI *EFI_SMBIOS_GET_TABLE_ENTRY) (
);

typedef VOID* (EFIAPI *EFI_SMBIOS_GET_SCRATCH_BUFFER) (
);

typedef UINT16 (EFIAPI *EFI_SMBIOS_GET_BUFFER_MAX_SIZE) (
);

typedef UINT16 (EFIAPI *EFI_SMBIOS_GET_FREE_HANDLE) (
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD_STRUCTURE) (
    IN UINT8                  *Buffer,
    IN UINT16                 Size
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD_STRUC_HANDLE) (
    IN UINT16                 Handle,
    IN UINT8                  *Buffer,
    IN UINT16                 Size
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_DELETE_STRUCTURE) (
    IN UINT16                 Handle
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_READ_STRUCTURE) (
    IN      UINT16            Handle,
    IN OUT  UINT8             **BufferPtr,
    IN OUT  UINT16            *BufferSize
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_READ_STRUC_TYPE) (
    IN UINT8                  Type,
    IN UINT8                  Instance,
    IN UINT8                  **BufferPtr,
    IN UINT16                 *BufferSize
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_WRITE_STRUCTURE) (
    IN UINT16                 Handle,
    IN UINT8                  *BufferPtr,
    IN UINT16                 BufferSize
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_UPDATE_HEADER) (
);

typedef enum {
    ADD_STRUCTURE,
    DELETE_STRUCTURE,
} SMBIOS_OPERATION;

typedef UINT8   EFI_SMBIOS_STRING;
typedef UINT8   EFI_SMBIOS_TYPE;
typedef UINT16  EFI_SMBIOS_HANDLE;

#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) )

#define SMBIOS_MAJOR_VERSION    02
#define SMBIOS_MINOR_VERSION    06

#define EFI_SMBIOS_TYPE_BIOS_INFORMATION                    0
#define EFI_SMBIOS_TYPE_SYSTEM_INFORMATION                  1
#define EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION               2
#define EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE                    3
#define EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION               4
#define EFI_SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION       5
#define EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON            6
#define EFI_SMBIOS_TYPE_CACHE_INFORMATION                   7
#define EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION          8
#define EFI_SMBIOS_TYPE_SYSTEM_SLOTS                        9
#define EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION          10
#define EFI_SMBIOS_TYPE_OEM_STRINGS                         11
#define EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS        12
#define EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION           13
#define EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS                  14
#define EFI_SMBIOS_TYPE_SYSTEM_EVENT_LOG                    15
#define EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY               16
#define EFI_SMBIOS_TYPE_MEMORY_DEVICE                       17
#define EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION      18
#define EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS         19
#define EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS        20
#define EFI_SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE            21
#define EFI_SMBIOS_TYPE_PORTABLE_BATTERY                    22
#define EFI_SMBIOS_TYPE_SYSTEM_RESET                        23
#define EFI_SMBIOS_TYPE_HARDWARE_SECURITY                   24
#define EFI_SMBIOS_TYPE_SYSTEM_POWER_CONTROLS               25
#define EFI_SMBIOS_TYPE_VOLTAGE_PROBE                       26
#define EFI_SMBIOS_TYPE_COOLING_DEVICE                      27
#define EFI_SMBIOS_TYPE_TEMPERATURE_PROBE                   28
#define EFI_SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE            29
#define EFI_SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS           30
#define EFI_SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE              31
#define EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION             32
#define EFI_SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION      33
#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE                   34
#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT         35
#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA    36
#define EFI_SMBIOS_TYPE_MEMORY_CHANNEL                      37
#define EFI_SMBIOS_TYPE_IPMI_DEVICE_INFORMATION             38
#define EFI_SMBIOS_TYPE_SYSTEM_POWER_SUPPLY                 39
#define EFI_SMBIOS_TYPE_INACTIVE                            126
#define EFI_SMBIOS_TYPE_END_OF_TABLE                        127
#define EFI_SMBIOS_OEM_BEGIN                                128
#define EFI_SMBIOS_OEM_END                                  255

#pragma pack(1)

typedef struct {
    EFI_SMBIOS_TYPE         Type;
    UINT8                   Length;
    EFI_SMBIOS_HANDLE       Handle;
} EFI_SMBIOS_TABLE_HEADER;

#define PRODUCER_HANDLE_ELEMENTS  200
typedef struct {
    EFI_SMBIOS_HANDLE       SmbiosHandle;
    EFI_HANDLE              ProducerHandle;
} EFI_PRODUCER_HANDLE;

#pragma pack()

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD) (
    IN CONST EFI_SMBIOS_PROTOCOL    *This,
    IN EFI_HANDLE                   ProducerHandle, OPTIONAL
    IN OUT EFI_SMBIOS_HANDLE        *SmbiosHandle,
    IN EFI_SMBIOS_TABLE_HEADER      *Record
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_UPDATE_STRING) (
    IN CONST EFI_SMBIOS_PROTOCOL    *This,
    IN EFI_SMBIOS_HANDLE            *SmbiosHandle,
    IN UINTN                        *StringNumber,
    IN CHAR8                        *String
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_REMOVE) (
    IN CONST EFI_SMBIOS_PROTOCOL    *This,
    IN UINTN                        SmbiosHandle
);

typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_GET_NEXT) (
    IN CONST EFI_SMBIOS_PROTOCOL    *This,
    IN OUT EFI_SMBIOS_HANDLE        *SmbiosHandle,
    IN EFI_SMBIOS_TYPE              *Type, OPTIONAL
    OUT EFI_SMBIOS_TABLE_HEADER     **Record,
    OUT EFI_HANDLE                  *ProducerHandle OPTIONAL
);
#endif                              // End of SMBIOS_PI_1_1 == 1

typedef struct _EFI_SMBIOS_PROTOCOL {
#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) )
    EFI_SMBIOS_ADD                  Add;
    EFI_SMBIOS_UPDATE_STRING        UpdateString;
    EFI_SMBIOS_REMOVE               Remove;
    EFI_SMBIOS_GET_NEXT             GetNext;
    UINT8                           MajorVersion;
    UINT8                           MinorVersion;
#endif                              // End of SMBIOS_PI_1_1 == 1
    EFI_SMBIOS_GET_TABLE_ENTRY      SmbiosGetTableEntryPoint;   // SMBIOS Table Entry Point
    EFI_SMBIOS_GET_SCRATCH_BUFFER   SmbiosGetScratchBufferPtr;  // Scratch Buffer of maximum table size
    EFI_SMBIOS_GET_BUFFER_MAX_SIZE  SmbiosGetBufferMaxSize;     // Maximum SMBIOS Table Size
    EFI_SMBIOS_GET_FREE_HANDLE      SmbiosGetFreeHandle;        // Get available free handle
    EFI_SMBIOS_ADD_STRUCTURE        SmbiosAddStructure;         // Add structure
    EFI_SMBIOS_ADD_STRUC_HANDLE     SmbiosAddStrucByHandle;     // Add structure
    EFI_SMBIOS_DELETE_STRUCTURE     SmbiosDeleteStructure;      // Delete structure (by handle)
    EFI_SMBIOS_READ_STRUCTURE       SmbiosReadStructure;        // Read structure. Caller is responsible
                                                                // for deallocating the memory
    EFI_SMBIOS_READ_STRUC_TYPE      SmbiosReadStrucByType;      // Read structure by type. Caller is
                                                                // responsible for deallocating the memory
    EFI_SMBIOS_WRITE_STRUCTURE      SmbiosWriteStructure;       // Write structure
    EFI_SMBIOS_UPDATE_HEADER        SmbiosUpdateHeader;         // Update SMBIOS Table Header
};

//**********************************************************************//
// SMBIOS Functions
//**********************************************************************//

VOID*
GetSmbiosTableEntryPoint(
);

VOID*
GetScratchBufferPtr(
);

UINT16
GetBufferMaxSize(
);

UINT16
GetFreeHandle(
);

EFI_STATUS
AddStructure(
    IN UINT8                  *Buffer,
    IN UINT16                 Size
);

EFI_STATUS
AddStructureByHandle(
    IN UINT16                 Handle,
    IN UINT8                  *Buffer,
    IN UINT16                 Size
);

EFI_STATUS
DeleteStructureByHandle(
    IN UINT16                 Handle
);

EFI_STATUS
ReadStructureByHandle(
    IN      UINT16            Handle,
    IN OUT  UINT8             **BufferPtr,
    IN OUT  UINT16            *BufferSize
);

EFI_STATUS
ReadStructureByType(
    IN      UINT8             Type,
    IN      UINT8             Instance,
    IN OUT  UINT8             **BufferPtr,
    IN OUT  UINT16            *BufferSize
);

EFI_STATUS
WriteStructureByHandle(
    IN UINT16                 Handle,
    IN UINT8                  *BufferPtr,
    IN UINT16                 BufferSize
);

EFI_STATUS
UpdateSmbiosTableHeader(
);

UINT16
GetStructureLength(
    IN UINT8    *BufferStart
);

BOOLEAN
FindStructureHandle(
    IN OUT UINT8    **Buffer,
    IN     UINT16   Handle
);

EFI_STATUS
ReplaceString(
    IN UINT8    *DestStructPtr,
    IN UINT8    StringNum,
    IN UINT8    *StringData
);

VOID
ClearStringNumber (
    IN STRING_TABLE     *StringTablePtr,
    IN UINT8            Index
);

#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) )
EFI_STATUS
SmbiosPiAddStructure (
    IN CONST EFI_SMBIOS_PROTOCOL    *This,
    IN EFI_HANDLE                   ProducerHandle, OPTIONAL
    IN OUT EFI_SMBIOS_HANDLE        *SmbiosHandle,
    IN EFI_SMBIOS_TABLE_HEADER      *Record
);

EFI_STATUS
SmbiosPiUpdateString (
    IN CONST EFI_SMBIOS_PROTOCOL    *This,
    IN EFI_SMBIOS_HANDLE            *SmbiosHandle,
    IN UINTN                        *StringNumber,
    IN CHAR8                        *String
);

EFI_STATUS
SmbiosPiRemoveStructure (
    IN CONST EFI_SMBIOS_PROTOCOL    *This,
    IN UINTN                        SmbiosHandle
);

EFI_STATUS
SmbiosPiGetNextStructure (
    IN CONST EFI_SMBIOS_PROTOCOL    *This,
    IN OUT EFI_SMBIOS_HANDLE        *SmbiosHandle,
    IN EFI_SMBIOS_TYPE              *Type, OPTIONAL
    OUT EFI_SMBIOS_TABLE_HEADER     **Record,
    OUT EFI_HANDLE                  *ProducerHandle OPTIONAL
);
#endif                              // End of SMBIOS_PI_1_1 == 1

#endif                              // _Smbios_DRIVER_H

//**********************************************************************//
//**********************************************************************//
//**                                                                  **//
//**        (C)Copyright 1985-2016, American Megatrends, Inc.         **//
//**                                                                  **//
//**                       All Rights Reserved.                       **//
//**                                                                  **//
//**        5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093         **//
//**                                                                  **//
//**                       Phone: (770)-246-8600                      **//
//**                                                                  **//
//**********************************************************************//
//**********************************************************************//