qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 04/10] SMBIOS: Fix type 17 field sizes


From: Michael S. Tsirkin
Subject: [Qemu-devel] [PULL 04/10] SMBIOS: Fix type 17 field sizes
Date: Thu, 5 Jun 2014 20:17:19 +0300

From: "Gabriel L. Somlo" <address@hidden>

Fields for configured_clock_speed and various voltage values
introduced in spec v2.7+ should be "word", i.e. 16 bits.

Reported-by: Laszlo Ersek <address@hidden>
Signed-off-by: Gabriel Somlo <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
 include/hw/i386/smbios.h | 8 ++++----
 hw/i386/smbios.c         | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/hw/i386/smbios.h b/include/hw/i386/smbios.h
index 5583f60..a3f4d88 100644
--- a/include/hw/i386/smbios.h
+++ b/include/hw/i386/smbios.h
@@ -182,10 +182,10 @@ struct smbios_type_17 {
     uint8_t part_number_str;
     uint8_t attributes;
     uint32_t extended_size;
-    uint32_t configured_clock_speed;
-    uint32_t minimum_voltage;
-    uint32_t maximum_voltage;
-    uint32_t configured_voltage;
+    uint16_t configured_clock_speed;
+    uint16_t minimum_voltage;
+    uint16_t maximum_voltage;
+    uint16_t configured_voltage;
 } QEMU_PACKED;
 
 /* SMBIOS type 19 - Memory Array Mapped Address (v2.7) */
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index 1793821..b3bedde 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -683,10 +683,10 @@ static void smbios_build_type_17_table(unsigned instance, 
ram_addr_t size)
     SMBIOS_TABLE_SET_STR(17, asset_tag_number_str, type17.asset);
     SMBIOS_TABLE_SET_STR(17, part_number_str, type17.part);
     t->attributes = 0; /* Unknown */
-    t->configured_clock_speed = cpu_to_le32(0); /* Unknown */
-    t->minimum_voltage = cpu_to_le32(0); /* Unknown */
-    t->maximum_voltage = cpu_to_le32(0); /* Unknown */
-    t->configured_voltage = cpu_to_le32(0); /* Unknown */
+    t->configured_clock_speed = cpu_to_le16(0); /* Unknown */
+    t->minimum_voltage = cpu_to_le16(0); /* Unknown */
+    t->maximum_voltage = cpu_to_le16(0); /* Unknown */
+    t->configured_voltage = cpu_to_le16(0); /* Unknown */
 
     SMBIOS_BUILD_TABLE_POST;
 }
-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]