nanxiongchao / rpms / dmidecode

Forked from rpms/dmidecode 4 years ago
Clone

Blame SOURCES/dmidecode-2.12-smbios_fix.patch

4f8197
diff -up dmidecode-2.12/CHANGELOG.smbios_fix dmidecode-2.12/CHANGELOG
4f8197
--- dmidecode-2.12/CHANGELOG.smbios_fix	2013-05-09 09:44:35.668592078 +0200
4f8197
+++ dmidecode-2.12/CHANGELOG	2013-05-09 09:44:44.742610559 +0200
4f8197
@@ -1,3 +1,10 @@
4f8197
+2013-04-24  Jean Delvare  <khali@linux-fr.org>
4f8197
+
4f8197
+	* dmidecode.c: Strip trailig zeroes from memory voltage values
4f8197
+	  (DMI type 17).
4f8197
+	* dmidecode.c: Fix support for new processor upgrade types (DMI
4f8197
+	  type 4) and new memory device type (DMI type 17.)
4f8197
+
4f8197
 2013-04-17  Anton Arapov  <anton@redhat.com>
4f8197
 
4f8197
 	Update to support SMBIOS specification version 2.8.0.
4f8197
diff -up dmidecode-2.12/dmidecode.c.smbios_fix dmidecode-2.12/dmidecode.c
4f8197
--- dmidecode-2.12/dmidecode.c.smbios_fix	2013-05-09 09:44:26.404573273 +0200
4f8197
+++ dmidecode-2.12/dmidecode.c	2013-05-09 09:44:44.745610565 +0200
4f8197
@@ -69,7 +69,7 @@
4f8197
 #define out_of_spec "<OUT OF SPEC>"
4f8197
 static const char *bad_index = "<BAD INDEX>";
4f8197
 
4f8197
-#define SUPPORTED_SMBIOS_VER 0x0207
4f8197
+#define SUPPORTED_SMBIOS_VER 0x0208
4f8197
 
4f8197
 /*
4f8197
  * Type-independant Stuff
4f8197
@@ -712,7 +712,6 @@ static const char *dmi_processor_family(
4f8197
 		{ 0x3D, "Opteron 6200" },
4f8197
 		{ 0x3E, "Opteron 4200" },
4f8197
 		{ 0x3F, "FX" },
4f8197
-
4f8197
 		{ 0x40, "MIPS" },
4f8197
 		{ 0x41, "MIPS R4000" },
4f8197
 		{ 0x42, "MIPS R4200" },
4f8197
@@ -729,7 +728,6 @@ static const char *dmi_processor_family(
4f8197
 		{ 0x4D, "Opteron 6300" },
4f8197
 		{ 0x4E, "Opteron 3300" },
4f8197
 		{ 0x4F, "FirePro" },
4f8197
-
4f8197
 		{ 0x50, "SPARC" },
4f8197
 		{ 0x51, "SuperSPARC" },
4f8197
 		{ 0x52, "MicroSPARC II" },
4f8197
@@ -1176,7 +1174,7 @@ static const char *dmi_processor_upgrade
4f8197
 		"Socket LGA1356-3" /* 0x2C */
4f8197
 	};
4f8197
 
4f8197
-	if (code >= 0x01 && code <= 0x2A)
4f8197
+	if (code >= 0x01 && code <= 0x2C)
4f8197
 		return upgrade[code - 0x01];
4f8197
 	return out_of_spec;
4f8197
 }
4f8197
@@ -2236,7 +2234,7 @@ static void dmi_memory_voltage_value(u16
4f8197
 	if (code == 0)
4f8197
 		printf(" Unknown");
4f8197
 	else
4f8197
-		printf(" %.3f V", (float)(i16)code / 1000);
4f8197
+		printf(code % 100 ? " %g V" : " %.1f V", (float)code / 1000);
4f8197
 }
4f8197
 
4f8197
 static const char *dmi_memory_device_form_factor(u8 code)
4f8197
@@ -2338,7 +2336,7 @@ static void dmi_memory_device_type_detai
4f8197
 	{
4f8197
 		int i;
4f8197
 
4f8197
-		for (i = 1; i <= 14; i++)
4f8197
+		for (i = 1; i <= 15; i++)
4f8197
 			if (code & (1 << i))
4f8197
 				printf(" %s", detail[i - 1]);
4f8197
 	}
4f8197
@@ -3657,13 +3655,13 @@ static void dmi_decode(const struct dmi_
4f8197
 			dmi_memory_device_speed(WORD(data + 0x20));
4f8197
 			printf("\n");
4f8197
 			if (h->length < 0x28) break;
4f8197
-			printf("\tMinimum voltage: ");
4f8197
+			printf("\tMinimum Voltage: ");
4f8197
 			dmi_memory_voltage_value(WORD(data + 0x22));
4f8197
 			printf("\n");
4f8197
-			printf("\tMaximum voltage: ");
4f8197
+			printf("\tMaximum Voltage: ");
4f8197
 			dmi_memory_voltage_value(WORD(data + 0x24));
4f8197
 			printf("\n");
4f8197
-			printf("\tConfigured voltage: ");
4f8197
+			printf("\tConfigured Voltage: ");
4f8197
 			dmi_memory_voltage_value(WORD(data + 0x26));
4f8197
 			printf("\n");
4f8197
 			break;