From 12864a3f3af38ee0ec71b9796bd10ee98b5d32dd Mon Sep 17 00:00:00 2001 From: khali Date: Mon, 27 Apr 2015 08:29:32 +0000 Subject: dmidecode: Add fields from the SMBIOS 3.0.0 specification Add support for 3 new fields in DMI type 4 (Processor Information): extended core and thread counts, for systems with more than 255 of those. --- CHANGELOG | 4 ++++ dmidecode.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7f7f2c6..b992f74 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ 2015-04-27 Jean Delvare + Update to support SMBIOS specification version 3.0.0. + * dmidecode.c: Add preliminary support for the new _SM3_ 64-bit entry point defined in the SMBIOS specification version 3.0.0. * dmidecode.c: Add 3 new chassis types (DMI type 3). @@ -7,6 +9,8 @@ * dmidecode.c: Add 4 new Intel socket types (DMI type 4). * dmidecode.c: Add 13 new slot types (DMI type 9). * dmidecode.c: Add 4 new memory device types (DMI type 17). + * dmidecode.c: Add support for processors with more than 255 cores + or threads (DMI type 4). 2015-04-21 Roy Franz diff --git a/dmidecode.c b/dmidecode.c index 47e7b50..731026a 100644 --- a/dmidecode.c +++ b/dmidecode.c @@ -25,7 +25,7 @@ * are deemed to be part of the source code. * * Unless specified otherwise, all references are aimed at the "System - * Management BIOS Reference Specification, Version 2.8.0" document, + * Management BIOS Reference Specification, Version 3.0.0" document, * available from http://www.dmtf.org/standards/smbios. * * Note to contributors: @@ -69,7 +69,7 @@ #define out_of_spec "" static const char *bad_index = ""; -#define SUPPORTED_SMBIOS_VER 0x0208 +#define SUPPORTED_SMBIOS_VER 0x0300 #define FLAG_NO_FILE_OFFSET (1 << 0) @@ -3394,11 +3394,17 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) dmi_string(h, data[0x22])); if (h->length < 0x28) break; if (data[0x23] != 0) - printf("\tCore Count: %u\n", data[0x23]); + printf("\tCore Count: %u\n", + h->length >= 0x2C && data[0x23] == 0xFF ? + WORD(data + 0x2A) : data[0x23]); if (data[0x24] != 0) - printf("\tCore Enabled: %u\n", data[0x24]); + printf("\tCore Enabled: %u\n", + h->length >= 0x2E && data[0x24] == 0xFF ? + WORD(data + 0x2C) : data[0x24]); if (data[0x25] != 0) - printf("\tThread Count: %u\n", data[0x25]); + printf("\tThread Count: %u\n", + h->length >= 0x30 && data[0x25] == 0xFF ? + WORD(data + 0x2E) : data[0x25]); printf("\tCharacteristics:"); dmi_processor_characteristics(WORD(data + 0x26), "\t\t"); break; -- cgit v1.2.1