dmi: Switching processor voltage from V to mV
authorErwan Velu <erwan.velu@free.fr>
Mon, 30 Nov 2009 12:25:00 +0000 (13:25 +0100)
committerErwan Velu <erwan.velu@free.fr>
Fri, 4 Dec 2009 09:11:16 +0000 (10:11 +0100)
Impact: Changing units

Processor voltage is now millivolts

com32/gplinclude/dmi/dmi_processor.h
com32/gpllib/dmi/dmi.c

index de2f4e4..63b8767 100644 (file)
@@ -84,7 +84,7 @@ typedef struct {
     char family[PROCESSOR_FAMILY_SIZE];
     char manufacturer[PROCESSOR_MANUFACTURER_SIZE];
     char version[PROCESSOR_VERSION_SIZE];
-    float voltage;
+    uint16_t voltage_mv;
     uint16_t external_clock;
     uint16_t max_speed;
     uint16_t current_speed;
index 55b625a..d3a43a8 100644 (file)
@@ -298,19 +298,19 @@ static void dmi_base_board_features(uint8_t code, s_dmi * dmi)
 static void dmi_processor_voltage(uint8_t code, s_dmi * dmi)
 {
     /* 3.3.5.4 */
-    static const float voltage[] = {
-       5.0,
-       3.3,
-       2.9
+    static const uint16_t voltage[] = {
+       5000,
+       3300,
+       2900
     };
     int i;
 
     if (code & 0x80)
-       dmi->processor.voltage = ((float)(code & 0x7f) / 10);
+       dmi->processor.voltage_mv = (code & 0x7f) * 100;
     else {
        for (i = 0; i <= 2; i++)
            if (code & (1 << i))
-               dmi->processor.voltage = voltage[i];
+               dmi->processor.voltage_mv = voltage[i];
     }
 }