Chameleon

Chameleon Commit Details

Date:2014-02-01 00:39:03 (10 years 2 months ago)
Author:ErmaC
Commit:2366
Parents: 2365
Message:Merge latest Bungo's improvements (smbios) into my branch. Revert back SMBIOS-ORG to SMBIOS from fake_efi
Changes:
M/branches/ErmaC/Enoch/i386/libsaio/smbios.c
M/branches/ErmaC/Enoch/i386/libsaio/smbios_getters.h
M/branches/ErmaC/Enoch/i386/libsaio/smbios_decode.c
M/branches/ErmaC/Enoch/i386/libsaio/smbios.h
M/branches/ErmaC/Enoch/i386/libsaio/cpu.c
M/branches/ErmaC/Enoch/i386/libsaio/fake_efi.c
M/branches/ErmaC/Enoch/i386/libsaio/smbios_getters.c

File differences

branches/ErmaC/Enoch/i386/libsaio/smbios_getters.h
1717
1818
1919
20
21
20
21
2222
2323
2424
......
2727
2828
2929
30
30
3131
3232
3333
kSMBString,
kSMBByte,
kSMBWord,
kSMBDWord
//kSMBQWord
kSMBDWord,
kSMBQWord
} SMBValueType;
typedef union
uint8_tbyte;
uint16_tword;
uint32_tdword;
//uint64_tqword;
uint64_tqword;
} returnType;
extern bool getProcessorInformationExternalClock(returnType *value);
branches/ErmaC/Enoch/i386/libsaio/cpu.c
1919
2020
2121
22
23
24
25
26
27
28
2229
2330
2431
#define DBG(x...)msglog(x)
#endif
#define quad(hi,lo)(((uint64_t)(hi)) << 32 | (lo))
/* Only for 32bit values */
#define bit32(n)(1U << (n))
#define bitmask32(h,l)((bit32(h)|(bit32(h)-1)) & ~(bit32(l)-1))
#define bitfield32(x,h,l)((((x) & bitmask32(h,l)) >> l))
/*
* timeRDTSC()
* This routine sets up PIT counter 2 to count down 1/20 of a second.
branches/ErmaC/Enoch/i386/libsaio/smbios.c
8181
8282
8383
84
84
8585
8686
8787
8888
8989
90
91
90
91
9292
9393
9494
......
125125
126126
127127
128
128
129129
130130
131131
......
320320
321321
322322
323
323
324324
325325
326
326
327327
328328
329329
330330
331
332331
333332
334333
......
336335
337336
338337
339
340338
341339
342340
......
423421
424422
425423
426
424
427425
428426
429427
......
502500
503501
504502
503
505504
506505
507506
......
517516
518517
519518
519
520520
521521
522522
523523
524524
525525
526
527
528
529
530
526531
527532
528533
......
530535
531536
532537
533
538
534539
535540
536541
......
542547
543548
544549
550
551
545552
546553
547554
548555
549556
550557
558
559
551560
552561
553562
......
556565
557566
558567
568
559569
560570
561571
562
572
563573
564574
565575
566
576
567577
568578
569579
......
580590
581591
582592
583
593
584594
585595
586596
......
602612
603613
604614
605
606
615
616
607617
608618
609619
......
639649
640650
641651
642
652
643653
644654
645655
......
681691
682692
683693
694
684695
685696
686697
......
693704
694705
695706
707
696708
697709
698710
......
783795
784796
785797
786
787
788
798
799
800
801
802
789803
790804
791805
......
820834
821835
822836
823
824
825
826
837
838
827839
828840
829841
......
835847
836848
837849
838
850
839851
840852
841853
......
846858
847859
848860
849
861
850862
851863
852864
......
863875
864876
865877
866
867
868
878
879
880
869881
870882
871883
......
881893
882894
883895
884
896
885897
886898
887899
......
891903
892904
893905
894
895
896
906
907
908
897909
898910
899911
......
902914
903915
904916
905
917
906918
907919
908920
......
10271039
10281040
10291041
1030
1042
1043
10311044
10321045
10331046
......
10351048
10361049
10371050
1038
1051
10391052
10401053
10411054
......
10431056
10441057
10451058
1046
1059
10471060
10481061
10491062
......
10641077
10651078
10661079
1067
1080
10681081
10691082
10701083
......
10791092
10801093
10811094
1095
10821096
10831097
10841098
......
10871101
10881102
10891103
1104
10901105
10911106
10921107
......
12121227
12131228
12141229
1215
1230
12161231
12171232
12181233
/* ============================
Processor Information (Type 4)
============================== */
// Bungo:
// Bungo
#define kSMBProcessorInformationSocketKey "SMcpusocket"
#define kSMBProcessorInformationManufacturerKey "SMcpumanufacturer"
#define kSMBProcessorInformationVersionKey "SMcpuversion"
//
#define kSMBProcessorInformationExternalClockKey"SMexternalclock"
#define kSMBProcessorInformationMaximalClockKey"SMmaximalclock"
// Bungo:
#define kSMBProcessorInformationMaximumClockKey"SMmaximalclock"
// Bungo
#define kSMBProcessorInformationCurrentClockKey "SMcurrentclock"
#define kSMBProcessorInformationUpgradeKey "SMcpuupgrade"
#define kSMBProcessorInformationSerialNumberKey "SMcpuserial"
/* ==============================================
OEM Platform Feature (Apple Specific - Type 133)
================================================ */
//#define kSMBOemPlatformFeatureKey
//#define kSMBOemPlatformFeatureKey "SMoemplatformfeature"
/* ==================================================*/
#define getFieldOffset(struct, field)((uint8_t)(uint32_t)&(((struct *)0)->field))
kSMBProcessorInformationExternalClockKey, getProcessorInformationExternalClock,NULL}, // SMcpuexternalclock
{kSMBTypeProcessorInformation,kSMBWord, getFieldOffset(SMBProcessorInformation, maximumClock),
kSMBProcessorInformationMaximalClockKey, getProcessorInformationMaximumClock,NULL}, // SMcpumaximumclock
kSMBProcessorInformationMaximumClockKey, getProcessorInformationMaximumClock,NULL}, // SMcpumaximumclock
// Bungo
{kSMBTypeProcessorInformation,kSMBWord,getFieldOffset(SMBProcessorInformation, currentClock),
kSMBProcessorInformationCurrentClockKey, NULL, NULL}, // SMcpucurrentspeed
kSMBProcessorInformationCurrentClockKey, NULL, NULL}, // SMcpucurrentclock
{kSMBTypeProcessorInformation,kSMBByte,getFieldOffset(SMBProcessorInformation, processorUpgrade),
kSMBProcessorInformationUpgradeKey, NULL, NULL}, // SMcpuupgrade
//
{kSMBTypeProcessorInformation,kSMBString,getFieldOffset(SMBProcessorInformation, serialNumber),
kSMBProcessorInformationSerialNumberKey, NULL, NULL},
{kSMBTypeProcessorInformation,kSMBString,getFieldOffset(SMBProcessorInformation, assetTag),
kSMBProcessorInformationAssetTagKey, NULL, NULL}, // SMcpuassettag
//
{kSMBTypeProcessorInformation,kSMBString,getFieldOffset(SMBProcessorInformation, partNumber),
kSMBProcessorInformationPartNumberKey, NULL, NULL},
//#define KDefaultBoardSerialNumber"C02140302D5DMT31M" // new C07019501PLDCVHAD - C02032101R5DC771H
//=========== Mac mini ===========
#define kDefaultMacMiniFamily"Mac mini"
#define kDefaultMacMiniFamily"Napa Mac" // Macmini2,1 family = "Napa Mac" not "Mac mini"
//#define kDefaultMacMiniBoardAssetTagNumber"Mini-Aluminum"
#define kDefaultMacMini"Macmini2,1"
#define kDefaultiMacBIOSVersion" IM81.88Z.00C1.B00.0903051113"
#define kDefaultiMacBIOSReleaseDate"02/09/08"
#define kDefaultiMacBoardProduct"Mac-F227BEC8"
#define kDefaultMacFamily"Mac" // iMac8,1 family = "Mac" not "iMac"
// iMac10,1
// iMac11,1 core i3/i5/i7
#define kDefaultiMacSandyBIOSVersion" IM121.88Z.0047.B00.1102091756"
#define kDefaultiMacSandyBIOSReleaseDate"01/02/08"
#define kDefaultiMacSandyBoardProduct"Mac-942B5BF58194151B"
// iMac12,2 Mac-942B59F58194171B
//#define kDefaultiMacSandy"iMac12,2"
//#define kDefaultiMacSandyBIOSVersion" IM121.88Z.0047.B1D.1110171110"
//#define kDefaultiMacSandyBIOSReleaseDate"10/17/11"
//#define kDefaultiMacSandyBoardProduct"Mac-942B59F58194171B"
// iMac13,1
// Bios: IM131.88Z.010A.B05.1211151146
// Data: 11/15/2012
// Board: Mac-00BE6ED71E35EB86
// iMac13,2
//#define kDefaultiMacIvy"iMac13,2"
//#define kDefaultiMacIvyBIOSVersion" IM131.88Z.00CE.B00.1203281326"
//#define kDefaultiMacIvyBoardProduct"Mac-FC02E91DDD3FA6A4"
//=========== MacPro ===========
#define kDefaultMacProFamily"Mac Pro"
#define kDefaultMacProFamily"MacPro" // MacPro's family = "MacPro" not "Mac Pro"
//#define KDefauktMacProBoardAssetTagNumber"Pro-Enclosure"
//#define kDefaultMacProBoardType"0xB" // 11
//#define KDefaultMacProBoardSerialNumber"J593902RA4MFE"
// Mac Pro 4,1 core i7/Xeon
#define kDefaultMacProNahWestSystemVersion"0.0"
#define kDefaultMacProNehalem"MacPro4,1"
#define kDefaultMacProNehalemBIOSVersion" MP41.88Z.0081.B07.0910130729"
#define kDefaultMacProNehalemBIOSReleaseDate"10/13/09"
//#define kDefaultMacProNehalemSystemVersion"1.4"
#define kDefaultMacProNehalemBoardProduct"Mac-F221BEC8"
//#define KDefaultMacProNehalemBoardSerialNumber"J593004RB1LUE"
//"J591302R61LUC " // 2-cpu board
//"J591002JV4MFB " // 1-cpu board
// Mac Pro 5,1 core i7/Xeon
#define kDefaultMacProWestmere"MacPro5,1"
//#define kDefaultMacProWestmereSystemVersion"1.2"
#define kDefaultMacProWestmereBoardProduct"Mac-F221BEC8"
//#define KDefaultMacProWestmereBoardSerialNumber"J522700H7BH8C"
//"J503104H1BH8A " // 2-cpu board
// Mac Pro 6,1
#define kDefaultMacProHaswell"MacPro6,1"
#define kDefaultMacProHaswellBIOSVersion" MP61.88Z.0116.B04.1312061508"
#define kDefaultMacProHaswellBIOSVersion"MP61.88Z.0116.B04.1312061508"
#define kDefaultMacProHaswellBIOSReleaseDate"12/06/2013"
//#define kDefaultMacProHaswellSystemVersion"1.?"
#define kDefaultMacProHaswellBoardProduct"Mac-F60DEB81FF30ACF6"
//#define KDefaultMacProHaswellBoardSerialNumber"?????????????"
//#define KDefaultMacProHaswellBoardSerialNumber"F5K3474008JFNN215"
//#define KDefaultBoardSerialNumber"C02140302D5DMT31M" // new C07019501PLDCVHAD - C02032101R5DC771H
// J593902RA4MFE 3,1
bool useSMBIOSdefaults = true; // Bungo
SMBByte PlatformType= 3; // Bungo: same as Platfom.Type in platform.h
SMBByte PlatformType= 1; // Bungo: same as Platfom.Type in platform.h. Because can't get from ACPI FADT PM profile and platformCPUFeature(CPU_FEATURE_MOBILE)) doesn't work as expect, FIXING NEEDED.
/* Rewrite this function */
void setDefaultSMBData(void) // Bungo: setting data from real Macs
defaultChassis.assetTag = kDefaultAssetTag;
defaultChassis.skuNumber = kDefaultSkuNumber;
// if (platformCPUFeature(CPU_FEATURE_MOBILE)) Bungo: doesn't recognise correctly
if (PlatformType == 2) // this method works
// if (platformCPUFeature(CPU_FEATURE_MOBILE)) Bungo: doesn't recognise correctly, need fixing
if (PlatformType == 2) // this works but it's a substitute
{
if (Platform.CPU.NoCores > 1) {
defaultSystemInfo.productName = kDefaultMacBookPro;
defaultBIOSInfo.version = kDefaultiMacBIOSVersion;
defaultBIOSInfo.releaseDate = kDefaultiMacBIOSReleaseDate;
defaultSystemInfo.productName = kDefaultiMac;
defaultSystemInfo.family = kDefaultiMacFamily;
defaultSystemInfo.family = kDefaultMacFamily; // iMac8,1 family = Mac
defaultBaseBoard.product = kDefaultiMacBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardMotherboard;
defaultChassis.chassisType = kSMBchassisAllInOne;
defaultBIOSInfo.version= kDefaultMacProNehalemBIOSVersion;
defaultBIOSInfo.releaseDate= kDefaultMacProNehalemBIOSReleaseDate;
defaultSystemInfo.productName= kDefaultMacProNehalem;
defaultSystemInfo.version = kDefaultMacProNahWestSystemVersion;
defaultSystemInfo.family= kDefaultMacProFamily;
defaultBaseBoard.product = kDefaultMacProNehalemBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardProcessorMemoryModule;
defaultBIOSInfo.version= kDefaultMacProWestmereBIOSVersion;
defaultBIOSInfo.releaseDate= kDefaultMacProWestmereBIOSReleaseDate;
defaultSystemInfo.productName= kDefaultMacProWestmere;
defaultSystemInfo.version = kDefaultMacProNahWestSystemVersion;
defaultSystemInfo.family= kDefaultMacProFamily;
defaultBaseBoard.product = kDefaultMacProWestmereBoardProduct;
defaultBaseBoard.boardType = kSMBBaseBoardProcessorMemoryModule;
strSize = strlen(string);
// remove any spaces found at the end
while ((strSize != 0) && (string[strSize - 1] == ' ')) {
strSize--;
// remove any spaces found at the end but only in MemoryDevice
if (structHeader->type == kSMBTypeMemoryDevice) {
while ((strSize != 0) && (string[strSize - 1] == ' ')) {
strSize--;
}
}
if (strSize == 0) {
{
break;
} else {
if (structPtr->orig->type == kSMBTypeMemoryDevice)// MemoryDevice only
{
if (getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, &string, NULL))
{
if (structPtr->orig->type == kSMBTypeMemoryDevice) {// MemoryDevice only
if (getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, &string, NULL)) {
break;
}
}
break;
}
}
// Bungo
// if ((SMBSetters[idx].defaultValue) && *(SMBSetters[idx].defaultValue)) Bungo
if (useSMBIOSdefaults && SMBSetters[idx].defaultValue && *(SMBSetters[idx].defaultValue)) {
string = *(SMBSetters[idx].defaultValue);
break;
case kSMBByte:
case kSMBWord:
case kSMBDWord:
//case kSMBQWord:
case kSMBQWord:
if (SMBSetters[idx].keyString) {
parsed = getIntForKey(SMBSetters[idx].keyString, &val, SMBPlist);
if (!parsed)
case kSMBWord:
value->word = (uint16_t)val;
break;
//case kSMBQWord:
//value->qword = (uint64_t)val;
//break;
case kSMBQWord:
value->qword = (uint64_t)val;
break;
case kSMBDWord:
default:
value->dword = (uint32_t)val;
}
}
// #if 0 Bungo: enables code below
// Bungo
// if (*(SMBSetters[idx].defaultValue)) Bungo
if (useSMBIOSdefaults && SMBSetters[idx].defaultValue && *(SMBSetters[idx].defaultValue)) {
// value->dword = *(uint32_t *)(SMBSetters[idx].defaultValue); Bungo
switch (SMBSetters[idx].valueType) {
case kSMBWord:
value->word = *(uint16_t *)(SMBSetters[idx].defaultValue);
break;
//case kSMBQWord:
//value->qword = *(uint32_t *)(SMBSetters[idx].defaultValue);
//break;
case kSMBQWord:
value->qword = *(uint64_t *)(SMBSetters[idx].defaultValue);
break;
case kSMBDWord:
default:
value->dword = *(uint32_t *)(SMBSetters[idx].defaultValue);
return true;
}
// #endif Bungo
break;
break;
}
// if (SMBSetters[idx].valueType == kSMBString && string) Bungo: use null string too -> "Not Specified"
SMBWord structSize;
int i;
/* http://forge.voodooprojects.org/p/chameleon/issues/361/ */
/* Bungo: not needed because of tables lengths fix in next lines
// http://forge.voodooprojects.org/p/chameleon/issues/361/
bool forceFullMemInfo = false;
if (structPtr->orig->type == kSMBTypeMemoryDevice) {
if (forceFullMemInfo) {
structPtr->orig->length = 27;
}
}
}*/
stringIndex = 1;
stringsSize = 0;
if (handle < structPtr->orig->handle) {
handle = structPtr->orig->handle;
}
// Bungo: fix unsuported tables lengths from original smbios: extend smaller or truncate bigger
// Bungo: fix unsuported tables lengths from original smbios: extend smaller or truncate bigger - we use SMBIOS rev. 2.4 like Apple uses
switch (structPtr->orig->type) {
case kSMBTypeBIOSInformation:
structSize = sizeof(SMBBIOSInformation);
structSize = sizeof(SMBMemoryDevice);
break;
default:
structSize = structPtr->orig->length; // don't change if not to patch
structSize = structPtr->orig->length; // doesn't change a length for unpatched
break;
}
for (i = 0; i < numOfSetters; i++) {
// Bungo:
//if ((structPtr->orig->type == SMBSetters[i].type) && (SMBSetters[i].fieldOffset < structPtr->orig->length)) {
if ((structPtr->orig->type == SMBSetters[i].type) && (SMBSetters[i].fieldOffset < structSize)) {
setterFound = true;
setSMBValue(structPtr, i, (returnType *)((uint8_t *)structPtr->new + SMBSetters[i].fieldOffset));
if (setterFound) {
// Bungo:
// ptr = (uint8_t *)structPtr->new + structPtr->orig->length;
ptr = (uint8_t *)structPtr->new + structPtr->new->length;
for (; ((uint16_t *)ptr)[0] != 0; ptr++);
{
SMBStructPtrs *structPtr;
uint8_t *buffer;
// bool setSMB = true; Bungo
// bool setSMB = true; Bungo: now we use useSMBIOSdefaults
if (!origeps) {
return;
branches/ErmaC/Enoch/i386/libsaio/smbios_decode.c
2222
2323
2424
25
2625
2726
28
27
2928
3029
3130
......
125124
126125
127126
128
129
127
128
130129
131130
132131
......
168167
169168
170169
171
170
172171
173172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
174192
175193
176194
......
225243
226244
227245
228
246
229247
230248
231249
......
270288
271289
272290
273
291
274292
275293
276294
......
295313
296314
297315
298
316
299317
300318
301319
......
313331
314332
315333
316
334
317335
318336
319337
......
344362
345363
346364
347
365
348366
349367
350368
......
360378
361379
362380
363
381
364382
365383
366384
......
422440
423441
424442
425
443
444
445
446
447
426448
427449
428
429
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
430469
431470
432471
433472
434
473
435474
436475
437476
......
481520
482521
483522
484
523
485524
486525
487526
#endif
extern char *getSMBStringForField(SMBStructHeader *structHeader, uint8_t field);
// Bungo:
#define NotSpecifiedStr "Not Specified" // no string
#define out_of_spec "<OUT OF SPEC>" // value out of smbios spec. range
#define OutOfSpecStr "<OUT OF SPEC>" // value out of smbios spec. range
#define PrivateStr "** PRIVATE **" // masking private data
#define neverMask false
===*/
static const char *SMBProcessorUpgrades[] = // ErmaC: strings for processor upgrade (Table Type 4 - Processor Information)
{
"Other", // 01h
"Unknown",
"Other", /* 01h */
"Unknown", /* 02h */
"Daughter Board",
"ZIF Socket",
"Replaceable Piggy Back",
"Socket FM1",
"Socket FM2",
"Socket LGA2011-3",
"Socket LGA1356-3"// 2Ch
"Socket LGA1356-3" /* 2Ch */
};
static const char *SMBMemoryDeviceFormFactors[] = // Bungo: strings for form factor (Table Type 17 - Memory Device)
{
"Other", /* 01h */
"Unknown", /* 02h */
"SIMM", /* 03h */
"SIP", /* 04h */
"Chip", /* 05h */
"DIP", /* 06h */
"ZIP", /* 07h */
"Proprietary Card", /* 08h */
"DIMM", /* 09h */
"TSOP", /* 0Ah */
"Row of chips", /* 0Bh */
"RIMM", /* 0Ch */
"SODIMM", /* 0Dh */
"SRIMM", /* 0Eh */
"FB-DIMM" /* 0Fh */
};
/*=====
7.18.2
====*/
void printHeader(SMBStructHeader *structHeader)
{
DBG("Handle: 0x%04x, DMI type: %d, %d bytes\n", structHeader->handle, structHeader->type, structHeader->length);
DBG("Handle: 0x%04x, DMI type %d, %d bytes\n", structHeader->handle, structHeader->type, structHeader->length);
}
//-------------------------------------------------------------------------------------------------------------------------
uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]);
}
if (((SMBSystemInformation *)structHeader)->wakeupReason > 8) {
DBG("\tWake-up Type: %s\n", out_of_spec);
DBG("\tWake-up Type: %s\n", OutOfSpecStr);
} else {
DBG("\tWake-up Type: %s\n", SMBWakeUpTypes[((SMBSystemInformation *)structHeader)->wakeupReason]);
}
DBG("\tLocation In Chassis: %s\n", SMBStringForField(structHeader, ((SMBBaseBoard *)structHeader)->locationInChassis, neverMask)); // Part Component
// Chassis Handle (WORD)
if ((((SMBBaseBoard *)structHeader)->boardType < kSMBBaseBoardUnknown) || (((SMBBaseBoard *)structHeader)->boardType > kSMBBaseBoardInterconnect)) {
DBG("\tType: %s\n", out_of_spec);
DBG("\tType: %s\n", OutOfSpecStr);
} else {
DBG("\tType: %s\n", SMBBaseBoardTypes[(((SMBBaseBoard *)structHeader)->boardType - 1)]);
}
DBG("Chassis Information\n");
DBG("\tManufacturer: %s\n", SMBStringForField(structHeader, ((SMBSystemEnclosure *)structHeader)->manufacturer, neverMask));
if ((((SMBSystemEnclosure *)structHeader)->chassisType < kSMBchassisOther) || (((SMBSystemEnclosure *)structHeader)->chassisType > kSMBchassisBladeEnclosing)) {
DBG("\tType: %s\n", out_of_spec);
DBG("\tType: %s\n", OutOfSpecStr);
} else {
DBG("\tType: %s\n", SMBChassisTypes[(((SMBSystemEnclosure *)structHeader)->chassisType - 1)]);
}
DBG("Processor Information\n");
DBG("\tSocket Designation: %s\n", SMBStringForField(structHeader, ((SMBProcessorInformation *)structHeader)->socketDesignation, neverMask));
if ((((SMBProcessorInformation *)structHeader)->processorType < kSMBprocessorTypeOther) || (((SMBProcessorInformation *)structHeader)->processorType > kSMBprocessorTypeGPU)) {
DBG("\tType: %s\n", out_of_spec);
DBG("\tType: %s\n", OutOfSpecStr);
} else {
DBG("\tType: %s\n", SMBProcessorTypes[((SMBProcessorInformation *)structHeader)->processorType - 1]);
}
DBG("\tCurrent Speed: %d MHz\n", ((SMBProcessorInformation *)structHeader)->currentClock);
// Status: Populated/Unpopulated
if ((((SMBProcessorInformation *)structHeader)->processorUpgrade < 1) || (((SMBProcessorInformation *)structHeader)->processorUpgrade > 0x2C)) {
DBG("\tUpgrade: %s\n", out_of_spec);
DBG("\tUpgrade: %s\n", OutOfSpecStr);
} else {
DBG("\tUpgrade: %s\n", SMBProcessorUpgrades[((SMBProcessorInformation *)structHeader)->processorUpgrade - 1]);
}
printHeader(structHeader);
DBG("Memory Device\n");
// Aray Handle
DBG("\tError Information Handle: 0x%x\n", ((SMBMemoryDevice *)structHeader)->errorHandle);
if (((SMBMemoryDevice *)structHeader)->errorHandle == 0xFFFF) {
DBG("\tError Information Handle: No Error\n");
} else {
DBG("\tError Information Handle: 0x%x\n", ((SMBMemoryDevice *)structHeader)->errorHandle);
}
// Total Width:
// Data Width:
// Size:
// Form Factor:
switch (((SMBMemoryDevice *)structHeader)->memorySize) {
case 0:
DBG("\tSize: No Module Installed\n");
break;
case 0x7FFF:
DBG("\tSize: 32GB or more\n");
break;
case 0xFFFF:
DBG("\tSize: Unknown\n");
break;
default:
DBG("\tSize: %d %s\n", ((SMBMemoryDevice *)structHeader)->memorySize & 0x7FFF, ((((SMBMemoryDevice *)structHeader)->memorySize & 0x8000) == 0x8000) ? "kB" : "MB");
break;
}
if ((((SMBMemoryDevice *)structHeader)->formFactor < 0x01) || (((SMBMemoryDevice *)structHeader)->formFactor > 0x0F)) {
DBG("\tForm Factor: %s\n", OutOfSpecStr);
} else {
DBG("\tForm Factor: %s\n", SMBMemoryDeviceFormFactors[((SMBMemoryDevice *)structHeader)->formFactor - 1]);
}
// Set:
DBG("\tLocator: %s\n", SMBStringForField(structHeader, ((SMBMemoryDevice *)structHeader)->deviceLocator, neverMask));
DBG("\tBank Locator: %s\n", SMBStringForField(structHeader, ((SMBMemoryDevice *)structHeader)->bankLocator, neverMask));
if (((SMBMemoryDevice *)structHeader)->memoryType > kSMBMemoryDeviceTypeCount) {
DBG("\tMemory Type: %s\n", out_of_spec);
DBG("\tMemory Type: %s\n", OutOfSpecStr);
} else {
DBG("\tMemory Type: %s\n", SMBMemoryDeviceTypes[((SMBMemoryDevice *)structHeader)->memoryType]);
}
//}
//-------------------------------------------------------------------------------------------------------------------------
// Specific (Type 134)
// Specific (Type 134)
//-------------------------------------------------------------------------------------------------------------------------
//void decodeOem(SMBStructHeader *structHeader)
//{
branches/ErmaC/Enoch/i386/libsaio/smbios.h
2424
2525
2626
27
28
27
28
2929
3030
3131
......
8181
8282
8383
84
85
86
87
84
8885
8986
9087
......
138135
139136
140137
141
142
138
139
143140
144141
145
146
147
142
143
148144
149145
150146
......
163159
164160
165161
166
167
168
162
163
169164
170165
171166
......
182177
183178
184179
185
186
187
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
188203
189204
190205
......
196211
197212
198213
199
214
200215
201
202216
203217
204218
205219
220
206221
207222
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
223
224
227225
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252226
253
227
254228
255229
256230
......
269243
270244
271245
272
246
273247
274
275
276
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
277546
278547
279548
280549
281550
282
283
551
552
284553
285554
286555
......
289558
290559
291560
292
561
293562
294563
295564
......
307576
308577
309578
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
579
580
328581
329582
330583
......
338591
339592
340593
341
342
343
594
595
344596
345597
346598
......
357609
358610
359611
360
361
362
612
613
363614
364615
365616
......
375626
376627
377628
378
379
380
629
630
381631
382632
383633
......
397647
398648
399649
400
401
402
650
651
403652
404653
405654
406655
407656
408657
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
658
659
425660
426
427
428
429
661
662
663
430664
431665
432666
......
435669
436670
437671
438
672
439673
440
441
442
443
674
675
676
444677
445678
446679
......
449682
450683
451684
452
685
453686
454
455
456
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
457704
458705
459706
......
486733
487734
488735
489
490
491
736
737
738
492739
493740
494741
......
502749
503750
504751
505
506
507
752
753
754
508755
509756
510757
......
520767
521768
522769
523
524
525
770
771
526772
527773
528774
......
541787
542788
543789
544
545
546
790
547791
548792
549793
......
555799
556800
557801
802
803
558804
559805
560806
......
564810
565811
566812
567
813
568814
569815
816
817
570818
571819
572820
......
576824
577825
578826
827
828
579829
580830
581831
......
585835
586836
587837
838
839
588840
589841
590842
#define __LIBSAIO_SMBIOS_H
/* Based on System Management BIOS Reference Specification v2.5 */
// http://dmtf.org/sites/default/files/standards/documents/DSP0134_2.8.0.pdf
/* Based on System Management BIOS Reference Specification v2.4 */
// http://dmtf.org/standards/smbios
typedef uint8_t SMBString;
typedef uint8_t SMBByte;
#define SMB_ANCHOR_RESET(x)\
bzero(x, sizeof(typedef struct SMBAnchor));
/*
=======================
SMBIOS structure types.
======================= */
/* ======================= SMBIOS structure types. ======================= */
enum
{
kSMBTypeBIOSInformation= 0, // BIOS information (Type 0)
kSMBTypeFirmwareVolume= 128, // FirmwareVolume (TYPE 128)
kSMBTypeMemorySPD= 130, // MemorySPD (TYPE 130)
kSMBTypeOemProcessorType= 131, // Processor Type (Type 131)
kSMBTypeOemProcessorBusSpeed= 132 // Processor Bus Speed (Type 132)
//kSMBTypeOemPlatformFeature= 133 // Platform Feature (Type 133)
kSMBTypeOemProcessorBusSpeed= 132, // Processor Bus Speed (Type 132)
kSMBTypeOemPlatformFeature= 133 // Platform Feature (Type 133)
};
/* =======================
BIOS Information (Type 0)
========================= */
//----------------------------------------------------------------------------------------------------------
// Struct - BIOS Information (Type 0)
typedef struct SMBBIOSInformation
{
SMB_STRUCT_HEADER
SMBByte ECreleaseMinor; // Embedded Controller firmware release (minor)
} __attribute__((packed)) SMBBIOSInformation;
/* =========================
System Information (Type 1)
=========================== */
//----------------------------------------------------------------------------------------------------------
// Struct - System Information (Type 1)
typedef struct SMBSystemInformation
{
// 2.0+ spec (8 bytes)
SMBString family;
} __attribute__((packed)) SMBSystemInformation;
/* =========================================
Base Board (or Module) Information (Type 2)
=========================================== */
//----------------------------------------------------------------------------------------------------------
// Base Board (or Module) Information (Type 2)
// Base Board - Board Type.
// Values for SMBBaseBoard.boardType
typedef enum
{
kSMBBaseBoardUnknown = 0x01,// Unknow
kSMBBaseBoardOther = 0x02,// Other
kSMBBaseBoardServerBlade = 0x03,// Server Blade
kSMBBaseBoardConnectivitySwitch = 0x04,// Connectivity Switch
kSMBBaseBoardSystemMgmtModule = 0x05,// System Management Module
kSMBBaseBoardProcessorModule = 0x06,// Processor Module
kSMBBaseBoardIOModule = 0x07,// I/O Module
kSMBBaseBoardMemoryModule = 0x08,// Memory Module
kSMBBaseBoardDaughter = 0x09,// Daughter Board
kSMBBaseBoardMotherboard = 0x0A,// Motherboard (includes processor, memory, and I/O)
kSMBBaseBoardProcessorMemoryModule = 0x0B,// Processor/Memory Module
kSMBBaseBoardProcessorIOModule = 0x0C,// Processor/IO Module
kSMBBaseBoardInterconnect = 0x0D// Interconnect board
} BASE_BOARD_TYPE;
// Struct - Base Board (or Module) Information (Type 2)
typedef struct SMBBaseBoard
{
SMB_STRUCT_HEADER // Type 2
SMBByte featureFlags;// Collection of flag that identify features of this baseboard
SMBStringlocationInChassis;
SMBWord chassisHandle;
SMBByte boardType;// Type of board
SMBByte boardType;// Type of board, numeration value from BASE_BOARD_TYPE.
SMBByte numberOfContainedHandles;
//SMBWord containedObjectHandles[1];
// 0 - 255 contained handles go here but we do not include
// them in our structure. Be careful to use numberOfContainedHandles
// times sizeof(SMBWord) when computing the actual record size,
// if you need it.
SMBByte containedObjectHandles;
} __attribute__((packed)) SMBBaseBoard;
/* ====================================
Values for boardType in Type 2 records
====================================== */
enum
{
kSMBBaseBoardUnknown = 0x01,// Unknow
kSMBBaseBoardOther = 0x02,// Other
kSMBBaseBoardServerBlade = 0x03,// Server Blade
kSMBBaseBoardConnectivitySwitch = 0x04,// Connectivity Switch
kSMBBaseBoardSystemMgmtModule = 0x05,// System Management Module
kSMBBaseBoardProcessorModule = 0x06,// Processor Module
kSMBBaseBoardIOModule = 0x07,// I/O Module
kSMBBaseBoardMemoryModule = 0x08,// Memory Module
kSMBBaseBoardDaughter = 0x09,// Daughter Board
kSMBBaseBoardMotherboard = 0x0A,// Motherboard (includes processor, memory, and I/O)
kSMBBaseBoardProcessorMemoryModule = 0x0B,// Processor/Memory Module
kSMBBaseBoardProcessorIOModule = 0x0C,// Processor/IO Module
kSMBBaseBoardInterconnect = 0x0D// Interconnect board
};
//----------------------------------------------------------------------------------------------------------
// System Enclosure (Type 3)
/* =======================
System Enclosure (Type 3)
========================= */
typedef struct SMBSystemEnclosure
{
SMB_STRUCT_HEADER // Type 3
SMBString manufacturer;
SMBByte chassisType;// System Enclosure Indicator
SMBString version;// Board Number?
SMBString serialNumber;
SMBString assetTag;// Bungo: renamed from assetTagNumber folowing convention
SMBByte bootupState;// State of enclosure when when it was last booted
SMBByte powerSupplyState;// State of enclosure's power supply when last booted
SMBByte thermalState;// Thermal state of the enclosure when last booted
SMBByte securityStatus;// Physical security status of the enclosure when last booted
SMBDWord oemDefined;// OEM- or BIOS vendor-specific information
SMBByte height;// Height of the enclosure, in 'U's
SMBByte numberOfPowerCords;// Number of power cords associated with the enclosure or chassis
SMBByte containedElementCount;// Number of Contained Element record that follow, in the range 0 to 255
//SMBByte containedElementRecord;// Byte leght of each Contained Element record that follow, in the range 0 to 255
//SMBBytecontainedElements;// Elements, possibly defined by other SMBIOS structures present in chassis
//SMBString skuNumber;// Number of null-terminated string describing the chassis or enclosure SKU number (2.7+)
} __attribute__((packed)) SMBSystemEnclosure;
// Bungo: values for SMBSystemEnclosure.chassisType
enum {
typedef enum {
kSMBchassisOther = 0x01,
kSMBchassisUnknown = 0x02,
kSMBchassisDesktop = 0x03,
kSMBchassisLunchBox = 0x10,
// ... fill up if needed ;-)
kSMBchassisBladeEnclosing = 0x1D
};
} MISC_CHASSIS_TYPE;
/* ============================
Processor Information (Type 4)
============================== */
// System Enclosure or Chassis States.
// values for SMBSystemEnclosure.bootupState
// values for SMBSystemEnclosure.powerSupplyState
// values for SMBSystemEnclosure.thermalState
typedef enum {
kSMBChassisStateOther = 0x01,
kSMBChassisStateUnknown = 0x02,
kSMBChassisStateSafe = 0x03,
kSMBChassisStateWarning = 0x04,
kSMBChassisStateCritical = 0x05,
kSMBChassisStateNonRecoverable = 0x06
} MISC_CHASSIS_STATE;
// System Enclosure or Chassis Security Status.
// values for SMBSystemEnclosure.securityStatus
typedef enum {
kSMBChassisSecurityStatusOther = 0x01,
kSMBChassisSecurityStatusUnknown = 0x02,
kSMBChassisSecurityStatusNone = 0x03,
kSMBChassisSecurityStatusExternalInterfaceLockedOut = 0x04,
kSMBChassisSecurityStatusExternalInterfaceLockedEnabled = 0x05
} MISC_CHASSIS_SECURITY_STATE;
// Struct - System Enclosure (Type 3)
typedef struct SMBSystemEnclosure
{
SMB_STRUCT_HEADER // Type 3
SMBString manufacturer;
SMBByte chassisType;// System Enclosure Indicator
SMBString version;// Board Number?
SMBString serialNumber;
SMBString assetTag;// Bungo: renamed from assetTagNumber folowing convention
SMBByte bootupState;// State of enclosure when when it was last booted
SMBByte powerSupplyState;// State of enclosure's power supply when last booted
SMBByte thermalState;// Thermal state of the enclosure when last booted
SMBByte securityStatus;// Physical security status of the enclosure when last booted
SMBDWord oemDefined;// OEM- or BIOS vendor-specific information
SMBByte height;// Height of the enclosure, in 'U's
SMBByte numberOfPowerCords;// Number of power cords associated with the enclosure or chassis
SMBByte containedElementCount;// Number of Contained Element record that follow, in the range 0 to 255
//SMBByte containedElementRecord;// Byte leght of each Contained Element record that follow, in the range 0 to 255
//SMBByte containedElements;// Elements, possibly defined by other SMBIOS structures present in chassis
//SMBString skuNumber;// Number of null-terminated string describing the chassis or enclosure SKU number (2.7+)
} __attribute__((packed)) SMBSystemEnclosure;
//----------------------------------------------------------------------------------------------------------
// Processor Information (Type 4)
#define kSMBProcessorInformationMinSize 26
// Processor Information - Processor Type.
// Values for SMBProcessorInformation.processorType
typedef enum
{
kSMBprocessorTypeOther = 0x01,
kSMBprocessorTypeUnknown = 0x02,
kSMBprocessorTypeCPU = 0x03,
kSMBprocessorTypeMPU = 0x04,
kSMBprocessorTypeDSP = 0x05,
kSMBprocessorTypeGPU = 0x06
} PROCESSOR_TYPE_DATA;
// Processor Information - Processor Family.
// Values for SMBProcessorInformation.processorFamily
typedef enum {
kSMBprocessorFamilyOther = 0x01,
kSMBprocessorFamilyUnknown = 0x02,
kSMBprocessorFamily8086 = 0x03,
kSMBprocessorFamily80286 = 0x04,
kSMBprocessorFamilyIntel386 = 0x05,
kSMBprocessorFamilyIntel486 = 0x06,
kSMBprocessorFamily8087 = 0x07,
kSMBprocessorFamily80287 = 0x08,
kSMBprocessorFamily80387 = 0x09,
kSMBprocessorFamily80487 = 0x0A,
kSMBprocessorFamilyPentium = 0x0B,
kSMBprocessorFamilyPentiumPro = 0x0C,
kSMBprocessorFamilyPentiumII = 0x0D,
kSMBprocessorFamilyPentiumMMX = 0x0E,
kSMBprocessorFamilyCeleron = 0x0F,
kSMBprocessorFamilyPentiumIIXeon = 0x10,
kSMBprocessorFamilyPentiumIII = 0x11,
kSMBprocessorFamilyM1 = 0x12,
kSMBprocessorFamilyM2 = 0x13,
kSMBprocessorFamilyIntelCeleronM = 0x14,
kSMBprocessorFamilyIntelPentium4Ht = 0x15,
kSMBprocessorFamilyM1Reserved4 = 0x16,
kSMBprocessorFamilyM1Reserved5 = 0x17,
kSMBprocessorFamilyAmdDuron = 0x18,
kSMBprocessorFamilyK5 = 0x19,
kSMBprocessorFamilyK6 = 0x1A,
kSMBprocessorFamilyK6_2 = 0x1B,
kSMBprocessorFamilyK6_3 = 0x1C,
kSMBprocessorFamilyAmdAthlon = 0x1D,
kSMBprocessorFamilyAmd29000 = 0x1E,
kSMBprocessorFamilyK6_2Plus = 0x1F,
kSMBprocessorFamilyPowerPC = 0x20,
kSMBprocessorFamilyPowerPC601 = 0x21,
kSMBprocessorFamilyPowerPC603 = 0x22,
kSMBprocessorFamilyPowerPC603Plus = 0x23,
kSMBprocessorFamilyPowerPC604 = 0x24,
kSMBprocessorFamilyPowerPC620 = 0x25,
kSMBprocessorFamilyPowerPCx704 = 0x26,
kSMBprocessorFamilyPowerPC750 = 0x27,
kSMBprocessorFamilyIntelCoreDuo = 0x28,
kSMBprocessorFamilyIntelCoreDuoMobile = 0x29,
kSMBprocessorFamilyIntelCoreSoloMobile = 0x2A,
kSMBprocessorFamilyIntelAtom = 0x2B,
kSMBprocessorFamilyAlpha3 = 0x30,
kSMBprocessorFamilyAlpha21064 = 0x31,
kSMBprocessorFamilyAlpha21066 = 0x32,
kSMBprocessorFamilyAlpha21164 = 0x33,
kSMBprocessorFamilyAlpha21164PC = 0x34,
kSMBprocessorFamilyAlpha21164a = 0x35,
kSMBprocessorFamilyAlpha21264 = 0x36,
kSMBprocessorFamilyAlpha21364 = 0x37,
kSMBprocessorFamilyAmdTurionIIUltraDualCoreMobileM = 0x38,
kSMBprocessorFamilyAmdTurionIIDualCoreMobileM = 0x39,
kSMBprocessorFamilyAmdAthlonIIDualCoreM = 0x3A,
kSMBprocessorFamilyAmdOpteron6100Series = 0x3B,
kSMBprocessorFamilyAmdOpteron4100Series = 0x3C,
kSMBprocessorFamilyAmdOpteron6200Series = 0x3D,
kSMBprocessorFamilyAmdOpteron4200Series = 0x3E,
kSMBprocessorFamilyMips = 0x40,
kSMBprocessorFamilyMIPSR4000 = 0x41,
kSMBprocessorFamilyMIPSR4200 = 0x42,
kSMBprocessorFamilyMIPSR4400 = 0x43,
kSMBprocessorFamilyMIPSR4600 = 0x44,
kSMBprocessorFamilyMIPSR10000 = 0x45,
kSMBprocessorFamilyAmdCSeries = 0x46,
kSMBprocessorFamilyAmdESeries = 0x47,
kSMBprocessorFamilyAmdSSeries = 0x48,
kSMBprocessorFamilyAmdGSeries = 0x49,
kSMBprocessorFamilySparc = 0x50,
kSMBprocessorFamilySuperSparc = 0x51,
kSMBprocessorFamilymicroSparcII = 0x52,
kSMBprocessorFamilymicroSparcIIep = 0x53,
kSMBprocessorFamilyUltraSparc = 0x54,
kSMBprocessorFamilyUltraSparcII = 0x55,
kSMBprocessorFamilyUltraSparcIIi = 0x56,
kSMBprocessorFamilyUltraSparcIII = 0x57,
kSMBprocessorFamilyUltraSparcIIIi = 0x58,
kSMBprocessorFamily68040 = 0x60,
kSMBprocessorFamily68xxx = 0x61,
kSMBprocessorFamily68000 = 0x62,
kSMBprocessorFamily68010 = 0x63,
kSMBprocessorFamily68020 = 0x64,
kSMBprocessorFamily68030 = 0x65,
kSMBprocessorFamilyHobbit = 0x70,
kSMBprocessorFamilyCrusoeTM5000 = 0x78,
kSMBprocessorFamilyCrusoeTM3000 = 0x79,
kSMBprocessorFamilyEfficeonTM8000 = 0x7A,
kSMBprocessorFamilyWeitek = 0x80,
kSMBprocessorFamilyItanium = 0x82,
kSMBprocessorFamilyAmdAthlon64 = 0x83,
kSMBprocessorFamilyAmdOpteron = 0x84,
kSMBprocessorFamilyAmdSempron = 0x85,
kSMBprocessorFamilyAmdTurion64Mobile = 0x86,
kSMBprocessorFamilyDualCoreAmdOpteron = 0x87,
kSMBprocessorFamilyAmdAthlon64X2DualCore = 0x88,
kSMBprocessorFamilyAmdTurion64X2Mobile = 0x89,
kSMBprocessorFamilyQuadCoreAmdOpteron = 0x8A,
kSMBprocessorFamilyThirdGenerationAmdOpteron = 0x8B,
kSMBprocessorFamilyAmdPhenomFxQuadCore = 0x8C,
kSMBprocessorFamilyAmdPhenomX4QuadCore = 0x8D,
kSMBprocessorFamilyAmdPhenomX2DualCore = 0x8E,
kSMBprocessorFamilyAmdAthlonX2DualCore = 0x8F,
kSMBprocessorFamilyPARISC = 0x90,
kSMBprocessorFamilyPaRisc8500 = 0x91,
kSMBprocessorFamilyPaRisc8000 = 0x92,
kSMBprocessorFamilyPaRisc7300LC = 0x93,
kSMBprocessorFamilyPaRisc7200 = 0x94,
kSMBprocessorFamilyPaRisc7100LC = 0x95,
kSMBprocessorFamilyPaRisc7100 = 0x96,
kSMBprocessorFamilyV30 = 0xA0,
kSMBprocessorFamilyQuadCoreIntelXeon3200Series = 0xA1,
kSMBprocessorFamilyDualCoreIntelXeon3000Series = 0xA2,
kSMBprocessorFamilyQuadCoreIntelXeon5300Series = 0xA3,
kSMBprocessorFamilyDualCoreIntelXeon5100Series = 0xA4,
kSMBprocessorFamilyDualCoreIntelXeon5000Series = 0xA5,
kSMBprocessorFamilyDualCoreIntelXeonLV = 0xA6,
kSMBprocessorFamilyDualCoreIntelXeonULV = 0xA7,
kSMBprocessorFamilyDualCoreIntelXeon7100Series = 0xA8,
kSMBprocessorFamilyQuadCoreIntelXeon5400Series = 0xA9,
kSMBprocessorFamilyQuadCoreIntelXeon = 0xAA,
kSMBprocessorFamilyDualCoreIntelXeon5200Series = 0xAB,
kSMBprocessorFamilyDualCoreIntelXeon7200Series = 0xAC,
kSMBprocessorFamilyQuadCoreIntelXeon7300Series = 0xAD,
kSMBprocessorFamilyQuadCoreIntelXeon7400Series = 0xAE,
kSMBprocessorFamilyMultiCoreIntelXeon7400Series = 0xAF,
kSMBprocessorFamilyPentiumIIIXeon = 0xB0,
kSMBprocessorFamilyPentiumIIISpeedStep = 0xB1,
kSMBprocessorFamilyPentium4 = 0xB2,
kSMBprocessorFamilyIntelXeon = 0xB3,
kSMBprocessorFamilyAS400 = 0xB4,
kSMBprocessorFamilyIntelXeonMP = 0xB5,
kSMBprocessorFamilyAMDAthlonXP = 0xB6,
kSMBprocessorFamilyAMDAthlonMP = 0xB7,
kSMBprocessorFamilyIntelItanium2 = 0xB8,
kSMBprocessorFamilyIntelPentiumM = 0xB9,
kSMBprocessorFamilyIntelCeleronD = 0xBA,
kSMBprocessorFamilyIntelPentiumD = 0xBB,
kSMBprocessorFamilyIntelPentiumEx = 0xBC,
kSMBprocessorFamilyIntelCoreSolo = 0xBD, ///< SMBIOS spec 2.6 correct this value
kSMBprocessorFamilyReserved = 0xBE,
kSMBprocessorFamilyIntelCore2 = 0xBF,
kSMBprocessorFamilyIntelCore2Solo = 0xC0,
kSMBprocessorFamilyIntelCore2Extreme = 0xC1,
kSMBprocessorFamilyIntelCore2Quad = 0xC2,
kSMBprocessorFamilyIntelCore2ExtremeMobile = 0xC3,
kSMBprocessorFamilyIntelCore2DuoMobile = 0xC4,
kSMBprocessorFamilyIntelCore2SoloMobile = 0xC5,
kSMBprocessorFamilyIntelCoreI7 = 0xC6,
kSMBprocessorFamilyDualCoreIntelCeleron = 0xC7,
kSMBprocessorFamilyIBM390 = 0xC8,
kSMBprocessorFamilyG4 = 0xC9,
kSMBprocessorFamilyG5 = 0xCA,
kSMBprocessorFamilyG6 = 0xCB,
kSMBprocessorFamilyzArchitectur = 0xCC,
kSMBprocessorFamilyIntelCoreI5 = 0xCD,
kSMBprocessorFamilyIntelCoreI3 = 0xCE,
kSMBprocessorFamilyViaC7M = 0xD2,
kSMBprocessorFamilyViaC7D = 0xD3,
kSMBprocessorFamilyViaC7 = 0xD4,
kSMBprocessorFamilyViaEden = 0xD5,
kSMBprocessorFamilyMultiCoreIntelXeon = 0xD6,
kSMBprocessorFamilyDualCoreIntelXeon3Series = 0xD7,
kSMBprocessorFamilyQuadCoreIntelXeon3Series = 0xD8,
kSMBprocessorFamilyViaNano = 0xD9,
kSMBprocessorFamilyDualCoreIntelXeon5Series = 0xDA,
kSMBprocessorFamilyQuadCoreIntelXeon5Series = 0xDB,
kSMBprocessorFamilyDualCoreIntelXeon7Series = 0xDD,
kSMBprocessorFamilyQuadCoreIntelXeon7Series = 0xDE,
kSMBprocessorFamilyMultiCoreIntelXeon7Series = 0xDF,
kSMBprocessorFamilyMultiCoreIntelXeon3400Series = 0xE0,
kSMBprocessorFamilyEmbeddedAmdOpteronQuadCore = 0xE6,
kSMBprocessorFamilyAmdPhenomTripleCore = 0xE7,
kSMBprocessorFamilyAmdTurionUltraDualCoreMobile = 0xE8,
kSMBprocessorFamilyAmdTurionDualCoreMobile = 0xE9,
kSMBprocessorFamilyAmdAthlonDualCore = 0xEA,
kSMBprocessorFamilyAmdSempronSI = 0xEB,
kSMBprocessorFamilyAmdPhenomII = 0xEC,
kSMBprocessorFamilyAmdAthlonII = 0xED,
kSMBprocessorFamilySixCoreAmdOpteron = 0xEE,
kSMBprocessorFamilyAmdSempronM = 0xEF,
kSMBprocessorFamilyi860 = 0xFA,
kSMBprocessorFamilyi960 = 0xFB,
kSMBprocessorFamilyIndicatorFamily2 = 0xFE,
kSMBprocessorFamilyReserved1 = 0xFF
} PROCESSOR_FAMILY_DATA;
// Processor Information - Processor Upgrade.
// Values for SMBProcessorInformation.processorUpgrade
typedef enum {
kSMBprocessorUpgradeOther = 0x01,
kSMBprocessorUpgradeUnknown = 0x02,
kSMBprocessorUpgradeDaughterBoard = 0x03,
kSMBprocessorUpgradeZIFSocket = 0x04,
kSMBprocessorUpgradePiggyBack = 0x05, ///< Replaceable.
kSMBprocessorUpgradeNone = 0x06,
kSMBprocessorUpgradeLIFSocket = 0x07,
kSMBprocessorUpgradeSlot1 = 0x08,
kSMBprocessorUpgradeSlot2 = 0x09,
kSMBprocessorUpgrade370PinSocket = 0x0A,
kSMBprocessorUpgradeSlotA = 0x0B,
kSMBprocessorUpgradeSlotM = 0x0C,
kSMBprocessorUpgradeSocket423 = 0x0D,
kSMBprocessorUpgradeSocketA = 0x0E, ///< Socket 462.
kSMBprocessorUpgradeSocket478 = 0x0F,
kSMBprocessorUpgradeSocket754 = 0x10,
kSMBprocessorUpgradeSocket940 = 0x11,
kSMBprocessorUpgradeSocket939 = 0x12,
kSMBprocessorUpgradeSocketmPGA604 = 0x13,
kSMBprocessorUpgradeSocketLGA771 = 0x14,
kSMBprocessorUpgradeSocketLGA775 = 0x15,
kSMBprocessorUpgradeSocketS1 = 0x16,
kSMBprocessorUpgradeAM2 = 0x17,
kSMBprocessorUpgradeF1207 = 0x18,
kSMBprocessorUpgradeSocketLGA1366 = 0x19,
kSMBprocessorUpgradeSocketG34 = 0x1A,
kSMBprocessorUpgradeSocketAM3 = 0x1B,
kSMBprocessorUpgradeSocketC32 = 0x1C,
kSMBprocessorUpgradeSocketLGA1156 = 0x1D,
kSMBprocessorUpgradeSocketLGA1567 = 0x1E,
kSMBprocessorUpgradeSocketPGA988A = 0x1F,
kSMBprocessorUpgradeSocketBGA1288 = 0x20,
kSMBprocessorUpgradeSocketrPGA988B = 0x21,
kSMBprocessorUpgradeSocketBGA1023 = 0x22,
kSMBprocessorUpgradeSocketBGA1224 = 0x23,
kSMBprocessorUpgradeSocketBGA1155 = 0x24,
kSMBprocessorUpgradeSocketLGA1356 = 0x25,
kSMBprocessorUpgradeSocketLGA2011 = 0x26,
kSMBprocessorUpgradeSocketFS1 = 0x27,
kSMBprocessorUpgradeSocketFS2 = 0x28,
kSMBprocessorUpgradeSocketFM1 = 0x29,
kSMBprocessorUpgradeSocketFM2 = 0x2A
} PROCESSOR_UPGRADE;
// Struct - Processor Information (Type 4).
typedef struct SMBProcessorInformation
{
// 2.0+ spec (26 bytes)
SMB_STRUCT_HEADER // Type 4
SMBString socketDesignation;
SMBByte processorType; // CPU = 3
SMBByte processorFamily; // processor family enum
SMBByte processorType; // The enumeration value from PROCESSOR_TYPE_DATA.
SMBByte processorFamily; // The enumeration value from PROCESSOR_FAMILY_DATA.
SMBString manufacturer;
SMBQWord processorID; // based on CPUID
SMBString processorVersion;
SMBWord maximumClock; // max internal clock in MHz
SMBWord currentClock; // current internal clock in MHz
SMBByte status;
SMBByte processorUpgrade; // processor upgrade enum
SMBByte processorUpgrade; // The enumeration value from PROCESSOR_UPGRADE.
// 2.1+ spec (32 bytes)
SMBWord L1CacheHandle;
SMBWord L2CacheHandle;
//SMBWord processorFamily2;
} __attribute__((packed)) SMBProcessorInformation;
#define kSMBProcessorInformationMinSize 26
/* ========================================
Values for processorType in Type 4 records
======================================== */
enum
{
kSMBprocessorTypeOther = 0x01,
kSMBprocessorTypeUnknown = 0x02,
kSMBprocessorTypeCPU = 0x03,
kSMBprocessorTypeMPU = 0x04,
kSMBprocessorTypeDSP = 0x05,
kSMBprocessorTypeGPU = 0x06
};
/* ======================================================================
Memory Controller Information (Type 5) Obsolete since SMBIOS version 2.1
======================================================================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Controller Information (Type 5) Obsolete since SMBIOS version 2.1
typedef struct SMBMemoryControllerInfo {
SMB_STRUCT_HEADER
SMBByteerrorDetectingMethod;
SMBBytenumberOfMemorySlots;
} __attribute__((packed)) SMBMemoryControllerInfo;
/* ==================================================================
Memory Module Information (Type 6) Obsolete since SMBIOS version 2.1
==================================================================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Module Information (Type 6) Obsolete since SMBIOS version 2.1
typedef struct SMBMemoryModule
{
SMB_STRUCT_HEADER // Type 6
#define kSMBMemoryModuleSizeNotEnabled 0x7E
#define kSMBMemoryModuleSizeNotInstalled 0x7F
/* ========================
Cache Information (Type 7)
========================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Cache Information (Type 7)
typedef struct SMBCacheInformation
{
SMB_STRUCT_HEADER // Type 7
SMBByte associativity;
} __attribute__((packed)) SMBCacheInformation;
/* ===================
System Slots (Type 9)
===================== */
//----------------------------------------------------------------------------------------------------------
// Struct - System Slots (Type 9)
typedef struct SMBSystemSlot
{
// 2.0+ spec (12 bytes)
//SMBBytedeviceFunctionNumber;
} __attribute__((packed)) SMBSystemSlot;
/* ===================
OEM Strings (Type 11)
===================== */
//----------------------------------------------------------------------------------------------------------
// Struct - OEM Strings (Type 11)
typedef struct SMBOEMStrings
{
SMB_STRUCT_HEADER // Type 11
SMBBytecount;// number of strings
} __attribute__((packed)) SMBOEMStrings;
/* =============================
Physical Memory Array (Type 16)
=============================== */
typedef struct SMBPhysicalMemoryArray
{
// 2.1+ spec (15 bytes)
SMB_STRUCT_HEADER // Type 16
SMBByte physicalLocation; // physical location
SMBByte arrayUse; // the use for the memory array
SMBByte errorCorrection; // error correction/detection method
SMBDWord maximumCapacity; // maximum memory capacity in kilobytes
SMBWord errorHandle; // handle of a previously detected error
SMBWord numMemoryDevices; // number of memory slots or sockets
// 2.7+ spec
//SMBQWord extMaximumCapacity;// maximum memory capacity in bytes
} __attribute__((packed)) SMBPhysicalMemoryArray;
//----------------------------------------------------------------------------------------------------------
// Physical Memory Array (Type 16)
/* ================
Memory Array - Use
================== */
enum
// Physical Memory Array - Use.
// Values for SMBPhysicalMemoryArray.arrayUse
typedef enum
{
kSMBMemoryArrayUseOther = 0x01,
kSMBMemoryArrayUseUnknown = 0x02,
kSMBMemoryArrayUseFlashMemory = 0x05,
kSMBMemoryArrayUseNonVolatileMemory = 0x06,
kSMBMemoryArrayUseCacheMemory = 0x07
};
} MEMORY_ARRAY_USE;
/* ===================================
Memory Array - Error Correction Types
===================================== */
enum
// Physical Memory Array - Error Correction Types.
// Values for SMBPhysicalMemoryArray.errorCorrection
typedef enum
{
kSMBMemoryArrayErrorCorrectionTypeOther = 0x01,
kSMBMemoryArrayErrorCorrectionTypeUnknown = 0x02,
kSMBMemoryArrayErrorCorrectionTypeSingleBitECC = 0x05,
kSMBMemoryArrayErrorCorrectionTypeMultiBitECC = 0x06,
kSMBMemoryArrayErrorCorrectionTypeCRC = 0x07
};
} MEMORY_ERROR_CORRECTION;
/* =====================
Memory Device (Type 17)
======================= */
// Struct - Physical Memory Array (Type 16)
typedef struct SMBPhysicalMemoryArray
{
// 2.1+ spec (15 bytes)
SMB_STRUCT_HEADER // Type 16
SMBByte physicalLocation; // physical location
SMBByte arrayUse; // the use for the memory array, The enumeration value from MEMORY_ARRAY_USE.
SMBByte errorCorrection; // error correction/detection method, The enumeration value from MEMORY_ERROR_CORRECTION.
SMBDWord maximumCapacity; // maximum memory capacity in kilobytes
SMBWord errorHandle; // handle of a previously detected error
SMBWord numMemoryDevices; // number of memory slots or sockets
// 2.7+ spec
//SMBQWord extMaximumCapacity;// maximum memory capacity in bytes
} __attribute__((packed)) SMBPhysicalMemoryArray;
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Device (Type 17)
typedef struct SMBMemoryDevice
{
// 2.1+ spec (21 bytes)
//SMBWord configuredVolt;
} __attribute__((packed)) SMBMemoryDevice;
/* ===================================
Memory Array Mapped Address (Type 19)
===================================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Array Mapped Address (Type 19)
//typedef struct SMBMemoryArrayMappedAddress
//{
// 2.1+ spec
//SMBQWord extEndAddress;
//} __attribute__((packed)) SMBMemoryArrayMappedAddress;
/* ====================================
Memory Device Mapped Address (Type 20)
====================================== */
//----------------------------------------------------------------------------------------------------------
// Struct - Memory Device Mapped Address (Type 20)
//typedef struct SMBMemoryDeviceMappedAddress
//{
// 2.1+ spec
//SMBQWord extEndAddress;
//} __attribute__((packed)) SMBMemoryDeviceMappedAddress;
/* =====================================================
Firmware Volume Description (Apple Specific - Type 128)
======================================================= */
//----------------------------------------------------------------------------------------------------------
// Firmware Volume Description (Apple Specific - Type 128)
enum
{
FW_REGION_RESERVED = 0,
SMBDWord EndAddress;
} __attribute__((packed)) FW_REGION_INFO;
/* ========
(Type 128)
========== */
// Struct - Firmware Volume Description (Apple Specific - Type 128)
typedef struct SMBFirmwareVolume
{
SMB_STRUCT_HEADER// Type 128
FW_REGION_INFO FlashMap[ NUM_FLASHMAP_ENTRIES ];
} __attribute__((packed)) SMBFirmwareVolume;
//----------------------------------------------------------------------------------------------------------
/* ===========================================
Memory SPD Data (Apple Specific - Type 130)
============================================= */
SMBWord Type17Handle;
SMBWord Offset;
SMBWord Size;
SMBWord Data[];
SMBWord Data[1];
} __attribute__((packed)) SMBMemorySPD;
//----------------------------------------------------------------------------------------------------------
/* ============================================
OEM Processor Type (Apple Specific - Type 131)
============================================== */
SMBWord ProcessorType;
} __attribute__((packed)) SMBOemProcessorType;
//----------------------------------------------------------------------------------------------------------
/* =================================================
OEM Processor Bus Speed (Apple Specific - Type 132)
=================================================== */
SMBWord ProcessorBusSpeed; // MT/s unit
} __attribute__((packed)) SMBOemProcessorBusSpeed;
//----------------------------------------------------------------------------------------------------------
/* ==============================================
OEM Platform Feature (Apple Specific - Type 133)
================================================ */
branches/ErmaC/Enoch/i386/libsaio/fake_efi.c
776776
777777
778778
779
779
780780
781781
782782
}
memcpy(tableAddress, (void *)origeps->dmi.tableAddress, origeps->dmi.tableLength);
DT__AddProperty(node, "SMBIOS-ORIG", origeps->dmi.tableLength, tableAddress); // Bungo: changed from SMBIOS to SMBIOS-ORIG to differentiate
DT__AddProperty(node, "SMBIOS", origeps->dmi.tableLength, tableAddress);
}
/*
branches/ErmaC/Enoch/i386/libsaio/smbios_getters.c
113113
114114
115115
116
116
117117
118
119
118
119
120120
121121
122122
......
136136
137137
138138
139
139
140140
141
141
142142
143143
144
144
145145
146146
147147
......
155155
156156
157157
158
158
159159
160
160161
161162
162163
163
164
164165
165
166
167
166168
167169
170
171
168172
169
170
173
171174
172175
176
173177
174
175
176
177
178178
179179
180
180
181
181182
182
183
184
185
186
187
188
189
183190
184191
185192
186193
187194
188195
189
190
191
192
193
194
195
196
197196
197
198198
199
199
200
200201
201
202
202
203
204
203205
204206
205207
208
206209
207
208
209
210
211
212
213
214
215
216210
217
211
212
218213
219214
220
215
221216
222217
223218
224219
220
221
222
223
224
225
225226
226
227
228
227229
228230
229
231
232
230233
231
232
233
234234
235
235
236
236237
237238
238
239
239240
240241
241242
242
243
244
245
246
247
248
249
250
251
252243
253244
254245
255
246
247
256248
257249
258
250
251
259252
260253
261
254
255
262256
263257
264
258
259
265260
266261
267
262
268263
269264
270265
271266
267
268
269
270
272271
273
272
273
274274
275275
276
276
277
277278
278279
279
280
281
280282
281283
282
284
283285
284286
285287
286
287
288
289
288290
289291
290292
291293
292294
293295
296
297
298
299
294300
295
301
302
296303
297304
298
305
306
299307
300308
301
309
310
302311
303312
304
313
305314
306315
307316
308317
309
318
310319
311320
312321
313322
314
323
315324
316325
317326
......
330339
331340
332341
342
343
344
345
333346
334347
335348
......
340353
341354
342355
343
356
357
344358
345359
346360
......
356370
357371
358372
373
374
375
376
359377
360378
361379
......
366384
367385
368386
369
387
388
370389
371390
372391
......
376395
377396
378397
398
399
400
401
379402
380403
381404
......
386409
387410
388411
389
390
391
392412
393413
394414
......
398418
399419
400420
421
422
423
424
401425
402426
403427
......
411435
412436
413437
414
415
416
417438
418439
419440
......
423444
424445
425446
447
448
449
450
426451
427452
428453
......
433458
434459
435460
436
437
438
439461
440462
441463
qpimult = pci_config_read32(PCIADDR(nhm_bus, 2, 1), 0x50);
qpimult &= 0x7F;
DBG("qpimult %d\n", qpimult);
qpibusspeed = (qpimult * 2 * (Platform.CPU.FSBFrequency/1000000LL));
qpibusspeed = (qpimult * 2 * (Platform.CPU.FSBFrequency / 1000000LL));
// Rek: rounding decimals to match original mac profile info
if (qpibusspeed%100 != 0) {
qpibusspeed = ((qpibusspeed+50)/100)*100;
if (qpibusspeed % 100 != 0) {
qpibusspeed = ((qpibusspeed + 50) / 100) * 100;
}
DBG("qpibusspeed %d\n", qpibusspeed);
value->word = qpibusspeed;
uint16_t simpleGetSMBOemProcessorType(void)
{
if (Platform.CPU.NoCores >= 4) {
return 0x0501;// Quad-Core Xeon
return 0x501;// 1281 - Quad-Core Xeon
} else if (Platform.CPU.NoCores == 1) {
return 0x0201;// Core Solo
return 0x201;// 513 - Core Duo
};
return 0x0301;// Core 2 Duo
return 0x301;// 769 - Core 2 Duo
}
bool getSMBOemProcessorType(returnType *value)
verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, (uint32_t)Platform.CPU.Family, (uint32_t)Platform.CPU.Model);
done = true;
}
// Bungo: fixes Oem Processor Type - better matching IMHO
// Bungo: fixes Oem Processor Type - better matching IMHO, needs testing
switch (Platform.CPU.Family) {
case 0x0F:
case 0x06:
{
switch (Platform.CPU.Model) {
case CPU_MODEL_PENTIUM_M:
case CPU_MODEL_DOTHAN:// 0x0D - Intel Pentium M model D
value->word = 0x101;
case CPU_MODEL_PRESCOTT:
case CPU_MODEL_NOCONA:
return true;
case CPU_MODEL_PRESLER:
case CPU_MODEL_CELERON:
case CPU_MODEL_YONAH:// 0x0E - Intel Mobile Core Solo, Duo
case CPU_MODEL_CELERON:
value->word = 0x201;
value->word = 0x201;// 513
return true;
case CPU_MODEL_MEROM:// 0x0F - Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx
case CPU_MODEL_XEON_MP:// 0x1D - Six-Core Xeon 7400, "Dunnington", 45nm
value->word = 0x401;
return true;
case CPU_MODEL_MEROM:// 0x0F - Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx
case CPU_MODEL_PENRYN:// 0x17 - Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0x402;// Xeon
value->word = 0x402;// 1026 - Xeon
return true;
}
case CPU_MODEL_PENTIUM_M:// 0x09 - Banias
if (Platform.CPU.NoCores <= 2) {
value->word = 0x301;// 769 - Core 2 Duo
} else {
value->word = 0x402;// 1026 - Core 2 Quad as Xeon
}
return true;
case CPU_MODEL_LINCROFT:// 0x27 - Intel Atom, "Lincroft", 45nm
case CPU_MODEL_ATOM:// 0x1C - Intel Atom (45nm)
return true;
case CPU_MODEL_NEHALEM_EX:// 0x2E - Nehalem-ex, "Beckton", 45nm
case CPU_MODEL_NEHALEM:// 0x1A - Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm)
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0x501;// Xeon
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) {
value->word = 0x701;// Core i7
}
return true;
case CPU_MODEL_FIELDS:// 0x1E - Intel Core i5, i7, Xeon X34xx LGA1156 (45nm)
case CPU_MODEL_DALES:// 0x1F - Intel Core i5, i7 LGA1156 (45nm) (Havendale, Auburndale)
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0x501;// Lynnfiled Quad-Core Xeon
value->word = 0x501;// 1281 - Lynnfiled Quad-Core Xeon
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) {
value->word = 0x701;// Core i7
if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) {
value->word = 0x901;// 2305 - Core i3
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) {
value->word = 0x601;// Core i5
return true;
}
return true;
case CPU_MODEL_DALES:// 0x1F - Intel Core i5, i7 LGA1156 (45nm) (Havendale, Auburndale)
if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) {
value->word = 0x901;// Core i3
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) {
value->word = 0x602;// Core i5
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) {
value->word = 0x702;// Core i7
value->word = 0x701;// 1793 - Core i7
return true;
}
if (Platform.CPU.NoCores <= 2) {
value->word = 0x602;// Core i5
value->word = 0x901;// - Core i3
}
return true;
case CPU_MODEL_DALES_32NM:// 0x25 - Intel Core i3, i5 LGA1156 (32nm) (Clarkdale, Arrandale)
case CPU_MODEL_WESTMERE:// 0x2C - Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core
case CPU_MODEL_WESTMERE_EX:// 0x2F - Intel Xeon E7
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0x501;// 1281 - Xeon
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) {
value->word = 0x901;// Core i3
value->word = 0x901;// 2305 - Core i3
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) {
value->word = 0x601;// Core i5
value->word = 0x602;// 1538 - Core i5
return true;
}
if(strstr(Platform.CPU.BrandString, "Core(TM) i5 CPU M 540")) {
value->word = 0x602;// Core i5
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) {
value->word = 0x701;// Core i7
value->word = 0x702;// 1794 -Core i7
return true;
}
if (Platform.CPU.NoCores <= 2) {
value->word = 0x602;// Core i5
value->word = 0x901;// - Core i3
}
return true;
case CPU_MODEL_WESTMERE:// 0x2C - Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core
case CPU_MODEL_WESTMERE_EX:// 0x2F - Intel Xeon E7
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0x501;// Xeon
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) {
value->word = 0x701;// Core i7
}
return true;
case CPU_MODEL_JAKETOWN:// 0x2D - Intel Core i7, Xeon E5-xxxx LGA2011 (32nm)
case CPU_MODEL_SANDYBRIDGE:// 0x2A - Intel Core i3, i5, i7 LGA1155 (32nm)
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0x501;// Xeon
value->word = 0x501;// 1281 - Xeon
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) {
value->word = 0x903;// Core i3
value->word = 0x902;// 2306 -Core i3
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) {
value->word = 0x603;// Core i5
value->word = 0x603;// 1539 - Core i5
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) {
value->word = 0x703;// Core i7
value->word = 0x703;// 1795 - Core i7
return true;
}
if (Platform.CPU.NoCores <= 2) {
value->word = 0x603;// Core i5
value->word = 0x902;// - Core i5
}
return true;
case CPU_MODEL_IVYBRIDGE:// 0x3A - Intel Core i3, i5, i7 LGA1155 (22nm)
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0xA01;// 2561 - Xeon
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) {
value->word = 0x903;// Core i3 - Apple doesn't use it
value->word = 0x903;// 2307 - Core i3 - Apple doesn't use it
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) {
value->word = 0x604;// Core i5
value->word = 0x604;// 1540 - Core i5
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) {
value->word = 0x704;// Core i7
value->word = 0x704;// 1796 - Core i7
return true;
}
if (Platform.CPU.NoCores <= 2) {
value->word = 0x604;// Core i5
value->word = 0x903;// - Core i5
}
return true;
case CPU_MODEL_IVYBRIDGE_XEON:// 0x3E - Mac Pro 6,1 - shouldn't be Sandy Bridge EP refering to intel spec.?
value->word = 0xA01;
case CPU_MODEL_IVYBRIDGE_XEON:// 0x3E - Mac Pro 6,1
value->word = 0xA01;// 2561 - Xeon
return true;
case CPU_MODEL_HASWELL:// 0x3C -
case CPU_MODEL_HASWELL_SVR:// 0x3F -
case CPU_MODEL_HASWELL_ULT:// 0x45 -
case CPU_MODEL_CRYSTALWELL:// 0x46
if (strstr(Platform.CPU.BrandString, "Xeon(R)")) {
value->word = 0xA01;// 2561 - Xeon
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) {
value->word = 0x905;// Core i3 - Apple doesn't use it
value->word = 0x904;// 2308 - Core i3 - Apple doesn't use it - but we yes:-)
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) {
value->word = 0x605;// Core i5
value->word = 0x605;// 1541 - Core i5
return true;
}
if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) {
value->word = 0x705;// Core i7
value->word = 0x705;// 1797 - Core i7
return true;
}
if (Platform.CPU.NoCores <= 2) {
value->word = 0x605;// Core i5
value->word = 0x904;// - Core i3
}
return true;
case 0x15:// EP80579 integrated processor
value->word = 0x301;//
value->word = 0x301;// 769
return true;
case 0x13:// Core i5, Xeon MP, "Havendale", "Auburndale", 45nm
case 0x19:// Intel Core i5 650 @3.20 Ghz
value->word = 0x601;// Core i5
value->word = 0x601;// 1537 - Core i5
return true;
default:
break; //Unsupported CPU type
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
return false;
value->byte = 2; // means Unknown
return true;
//value->byte = SMB_MEM_TYPE_DDR2;
//return true;
}
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
return false;
value->dword = 0; // means Unknown
return true;
//value->dword = 800;
//return true;
}
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
if (!bootInfo->memDetect) {
return false;
}
value->string = NOT_AVAILABLE;
return true;
}
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
DBG("getSMBMemoryDeviceSerialNumber index: %d, MAX_RAM_SLOTS: %d\n",idx,MAX_RAM_SLOTS);
}
}
if (!bootInfo->memDetect) {
return false;
}
value->string = NOT_AVAILABLE;
return true;
}
static int idx = -1;
intmap;
if (!bootInfo->memDetect) {
return false;
}
idx++;
if (idx < MAX_RAM_SLOTS) {
map = Platform.DMI.DIMM[idx];
}
}
if (!bootInfo->memDetect) {
return false;
}
value->string = NOT_AVAILABLE;
return true;
}

Archive Download the corresponding diff file

Revision: 2366