Index: branches/ErmaC/Enoch/i386/libsaio/smbios_getters.h =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/smbios_getters.h (revision 2365) +++ branches/ErmaC/Enoch/i386/libsaio/smbios_getters.h (revision 2366) @@ -17,8 +17,8 @@ kSMBString, kSMBByte, kSMBWord, - kSMBDWord -// kSMBQWord + kSMBDWord, + kSMBQWord } SMBValueType; typedef union @@ -27,7 +27,7 @@ uint8_t byte; uint16_t word; uint32_t dword; -// uint64_t qword; + uint64_t qword; } returnType; extern bool getProcessorInformationExternalClock(returnType *value); Index: branches/ErmaC/Enoch/i386/libsaio/cpu.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/cpu.c (revision 2365) +++ branches/ErmaC/Enoch/i386/libsaio/cpu.c (revision 2366) @@ -19,6 +19,13 @@ #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. Index: branches/ErmaC/Enoch/i386/libsaio/smbios.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/smbios.c (revision 2365) +++ branches/ErmaC/Enoch/i386/libsaio/smbios.c (revision 2366) @@ -81,14 +81,14 @@ /* ============================ 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" @@ -125,7 +125,7 @@ /* ============================================== OEM Platform Feature (Apple Specific - Type 133) ================================================ */ -//#define kSMBOemPlatformFeatureKey +//#define kSMBOemPlatformFeatureKey "SMoemplatformfeature" /* ==================================================*/ #define getFieldOffset(struct, field) ((uint8_t)(uint32_t)&(((struct *)0)->field)) @@ -320,15 +320,14 @@ 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}, @@ -336,7 +335,6 @@ {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, assetTag), kSMBProcessorInformationAssetTagKey, NULL, NULL}, // SMcpuassettag // - {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, partNumber), kSMBProcessorInformationPartNumberKey, NULL, NULL}, @@ -423,7 +421,7 @@ //#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" @@ -502,6 +500,7 @@ #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 @@ -517,12 +516,18 @@ #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" @@ -530,7 +535,7 @@ //#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 @@ -542,12 +547,16 @@ //#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" @@ -556,14 +565,15 @@ //#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 @@ -580,7 +590,7 @@ 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 @@ -602,8 +612,8 @@ 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; @@ -639,7 +649,7 @@ 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; @@ -681,6 +691,7 @@ defaultBIOSInfo.version = kDefaultMacProNehalemBIOSVersion; defaultBIOSInfo.releaseDate = kDefaultMacProNehalemBIOSReleaseDate; defaultSystemInfo.productName = kDefaultMacProNehalem; + defaultSystemInfo.version = kDefaultMacProNahWestSystemVersion; defaultSystemInfo.family = kDefaultMacProFamily; defaultBaseBoard.product = kDefaultMacProNehalemBoardProduct; defaultBaseBoard.boardType = kSMBBaseBoardProcessorMemoryModule; @@ -693,6 +704,7 @@ defaultBIOSInfo.version = kDefaultMacProWestmereBIOSVersion; defaultBIOSInfo.releaseDate = kDefaultMacProWestmereBIOSReleaseDate; defaultSystemInfo.productName = kDefaultMacProWestmere; + defaultSystemInfo.version = kDefaultMacProNahWestSystemVersion; defaultSystemInfo.family = kDefaultMacProFamily; defaultBaseBoard.product = kDefaultMacProWestmereBoardProduct; defaultBaseBoard.boardType = kSMBBaseBoardProcessorMemoryModule; @@ -783,9 +795,11 @@ 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) { @@ -820,10 +834,8 @@ { 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; } } @@ -835,7 +847,7 @@ break; } } - // Bungo + // if ((SMBSetters[idx].defaultValue) && *(SMBSetters[idx].defaultValue)) Bungo if (useSMBIOSdefaults && SMBSetters[idx].defaultValue && *(SMBSetters[idx].defaultValue)) { string = *(SMBSetters[idx].defaultValue); break; @@ -846,7 +858,7 @@ case kSMBByte: case kSMBWord: case kSMBDWord: - //case kSMBQWord: + case kSMBQWord: if (SMBSetters[idx].keyString) { parsed = getIntForKey(SMBSetters[idx].keyString, &val, SMBPlist); if (!parsed) @@ -863,9 +875,9 @@ 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; @@ -881,7 +893,7 @@ } } // #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) { @@ -891,9 +903,9 @@ 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); @@ -902,7 +914,7 @@ return true; } // #endif Bungo - break; + break; } // if (SMBSetters[idx].valueType == kSMBString && string) Bungo: use null string too -> "Not Specified" @@ -1027,7 +1039,8 @@ 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) { @@ -1035,7 +1048,7 @@ if (forceFullMemInfo) { structPtr->orig->length = 27; } - } + }*/ stringIndex = 1; stringsSize = 0; @@ -1043,7 +1056,7 @@ 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); @@ -1064,7 +1077,7 @@ 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; } @@ -1079,6 +1092,7 @@ 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)); @@ -1087,6 +1101,7 @@ 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++); @@ -1212,7 +1227,7 @@ { SMBStructPtrs *structPtr; uint8_t *buffer; - // bool setSMB = true; Bungo + // bool setSMB = true; Bungo: now we use useSMBIOSdefaults if (!origeps) { return; Index: branches/ErmaC/Enoch/i386/libsaio/smbios_decode.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/smbios_decode.c (revision 2365) +++ branches/ErmaC/Enoch/i386/libsaio/smbios_decode.c (revision 2366) @@ -22,10 +22,9 @@ #endif extern char *getSMBStringForField(SMBStructHeader *structHeader, uint8_t field); - // Bungo: #define NotSpecifiedStr "Not Specified" // no string -#define out_of_spec "" // value out of smbios spec. range +#define OutOfSpecStr "" // value out of smbios spec. range #define PrivateStr "** PRIVATE **" // masking private data #define neverMask false @@ -125,8 +124,8 @@ ===*/ 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", @@ -168,9 +167,28 @@ "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 ====*/ @@ -225,7 +243,7 @@ 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); } //------------------------------------------------------------------------------------------------------------------------- @@ -270,7 +288,7 @@ 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]); } @@ -295,7 +313,7 @@ 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)]); } @@ -313,7 +331,7 @@ 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)]); } @@ -344,7 +362,7 @@ 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]); } @@ -360,7 +378,7 @@ 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]); } @@ -422,16 +440,37 @@ 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]); } @@ -481,7 +520,7 @@ //} //------------------------------------------------------------------------------------------------------------------------- -// Specific (Type 134) +// Specific (Type 134) //------------------------------------------------------------------------------------------------------------------------- //void decodeOem(SMBStructHeader *structHeader) //{ Index: branches/ErmaC/Enoch/i386/libsaio/smbios.h =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/smbios.h (revision 2365) +++ branches/ErmaC/Enoch/i386/libsaio/smbios.h (revision 2366) @@ -24,8 +24,8 @@ #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; @@ -81,10 +81,7 @@ #define SMB_ANCHOR_RESET(x) \ bzero(x, sizeof(typedef struct SMBAnchor)); -/* - ======================= - SMBIOS structure types. - ======================= */ +/* ======================= SMBIOS structure types. ======================= */ enum { kSMBTypeBIOSInformation = 0, // BIOS information (Type 0) @@ -138,13 +135,12 @@ 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 @@ -163,9 +159,8 @@ 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) @@ -182,9 +177,29 @@ 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 @@ -196,61 +211,20 @@ SMBByte featureFlags; // Collection of flag that identify features of this baseboard SMBString locationInChassis; 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 -// 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; - // Bungo: values for SMBSystemEnclosure.chassisType -enum { +typedef enum { kSMBchassisOther = 0x01, kSMBchassisUnknown = 0x02, kSMBchassisDesktop = 0x03, @@ -269,18 +243,313 @@ 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; @@ -289,7 +558,7 @@ 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; @@ -307,24 +576,8 @@ // 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 SMBByte errorDetectingMethod; @@ -338,9 +591,8 @@ SMBByte numberOfMemorySlots; } __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 @@ -357,9 +609,8 @@ #define kSMBMemoryModuleSizeNotEnabled 0x7E #define kSMBMemoryModuleSizeNotInstalled 0x7F -/* ======================== - Cache Information (Type 7) - ========================== */ +//---------------------------------------------------------------------------------------------------------- +// Struct - Cache Information (Type 7) typedef struct SMBCacheInformation { SMB_STRUCT_HEADER // Type 7 @@ -375,9 +626,8 @@ SMBByte associativity; } __attribute__((packed)) SMBCacheInformation; -/* =================== - System Slots (Type 9) - ===================== */ +//---------------------------------------------------------------------------------------------------------- +// Struct - System Slots (Type 9) typedef struct SMBSystemSlot { // 2.0+ spec (12 bytes) @@ -397,36 +647,20 @@ // SMBByte deviceFunctionNumber; } __attribute__((packed)) SMBSystemSlot; -/* =================== - OEM Strings (Type 11) - ===================== */ +//---------------------------------------------------------------------------------------------------------- +// Struct - OEM Strings (Type 11) typedef struct SMBOEMStrings { SMB_STRUCT_HEADER // Type 11 SMBByte count; // 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, @@ -435,12 +669,11 @@ 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, @@ -449,11 +682,25 @@ 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) @@ -486,9 +733,9 @@ // SMBWord configuredVolt; } __attribute__((packed)) SMBMemoryDevice; -/* =================================== - Memory Array Mapped Address (Type 19) - ===================================== */ +//---------------------------------------------------------------------------------------------------------- + +// Struct - Memory Array Mapped Address (Type 19) //typedef struct SMBMemoryArrayMappedAddress //{ // 2.1+ spec @@ -502,9 +749,9 @@ // SMBQWord extEndAddress; //} __attribute__((packed)) SMBMemoryArrayMappedAddress; -/* ==================================== - Memory Device Mapped Address (Type 20) - ====================================== */ +//---------------------------------------------------------------------------------------------------------- + +// Struct - Memory Device Mapped Address (Type 20) //typedef struct SMBMemoryDeviceMappedAddress //{ // 2.1+ spec @@ -520,9 +767,8 @@ // SMBQWord extEndAddress; //} __attribute__((packed)) SMBMemoryDeviceMappedAddress; -/* ===================================================== - Firmware Volume Description (Apple Specific - Type 128) - ======================================================= */ +//---------------------------------------------------------------------------------------------------------- +// Firmware Volume Description (Apple Specific - Type 128) enum { FW_REGION_RESERVED = 0, @@ -541,9 +787,7 @@ 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 @@ -555,6 +799,8 @@ FW_REGION_INFO FlashMap[ NUM_FLASHMAP_ENTRIES ]; } __attribute__((packed)) SMBFirmwareVolume; +//---------------------------------------------------------------------------------------------------------- + /* =========================================== Memory SPD Data (Apple Specific - Type 130) ============================================= */ @@ -564,9 +810,11 @@ SMBWord Type17Handle; SMBWord Offset; SMBWord Size; - SMBWord Data[]; + SMBWord Data[1]; } __attribute__((packed)) SMBMemorySPD; +//---------------------------------------------------------------------------------------------------------- + /* ============================================ OEM Processor Type (Apple Specific - Type 131) ============================================== */ @@ -576,6 +824,8 @@ SMBWord ProcessorType; } __attribute__((packed)) SMBOemProcessorType; +//---------------------------------------------------------------------------------------------------------- + /* ================================================= OEM Processor Bus Speed (Apple Specific - Type 132) =================================================== */ @@ -585,6 +835,8 @@ SMBWord ProcessorBusSpeed; // MT/s unit } __attribute__((packed)) SMBOemProcessorBusSpeed; +//---------------------------------------------------------------------------------------------------------- + /* ============================================== OEM Platform Feature (Apple Specific - Type 133) ================================================ */ Index: branches/ErmaC/Enoch/i386/libsaio/fake_efi.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/fake_efi.c (revision 2365) +++ branches/ErmaC/Enoch/i386/libsaio/fake_efi.c (revision 2366) @@ -776,7 +776,7 @@ } 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); } /* Index: branches/ErmaC/Enoch/i386/libsaio/smbios_getters.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/smbios_getters.c (revision 2365) +++ branches/ErmaC/Enoch/i386/libsaio/smbios_getters.c (revision 2366) @@ -113,10 +113,10 @@ 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; @@ -136,12 +136,12 @@ 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) @@ -155,163 +155,172 @@ 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 @@ -330,6 +339,10 @@ static int idx = -1; int map; + if (!bootInfo->memDetect) { + return false; + } + idx++; if (idx < MAX_RAM_SLOTS) { map = Platform.DMI.DIMM[idx]; @@ -340,7 +353,8 @@ } } - return false; + value->byte = 2; // means Unknown + return true; // value->byte = SMB_MEM_TYPE_DDR2; // return true; } @@ -356,6 +370,10 @@ static int idx = -1; int map; + if (!bootInfo->memDetect) { + return false; + } + idx++; if (idx < MAX_RAM_SLOTS) { map = Platform.DMI.DIMM[idx]; @@ -366,7 +384,8 @@ } } - return false; + value->dword = 0; // means Unknown + return true; // value->dword = 800; // return true; } @@ -376,6 +395,10 @@ static int idx = -1; int map; + if (!bootInfo->memDetect) { + return false; + } + idx++; if (idx < MAX_RAM_SLOTS) { map = Platform.DMI.DIMM[idx]; @@ -386,9 +409,6 @@ } } - if (!bootInfo->memDetect) { - return false; - } value->string = NOT_AVAILABLE; return true; } @@ -398,6 +418,10 @@ static int idx = -1; int map; + if (!bootInfo->memDetect) { + return false; + } + idx++; DBG("getSMBMemoryDeviceSerialNumber index: %d, MAX_RAM_SLOTS: %d\n",idx,MAX_RAM_SLOTS); @@ -411,9 +435,6 @@ } } - if (!bootInfo->memDetect) { - return false; - } value->string = NOT_AVAILABLE; return true; } @@ -423,6 +444,10 @@ static int idx = -1; int map; + if (!bootInfo->memDetect) { + return false; + } + idx++; if (idx < MAX_RAM_SLOTS) { map = Platform.DMI.DIMM[idx]; @@ -433,9 +458,6 @@ } } - if (!bootInfo->memDetect) { - return false; - } value->string = NOT_AVAILABLE; return true; }