diff options
author | Erwan Velu <erwan.velu@free.fr> | 2009-11-30 13:26:39 +0100 |
---|---|---|
committer | Erwan Velu <erwan.velu@free.fr> | 2009-12-04 10:11:16 +0100 |
commit | 5e22b9c7fc046100f26974536333149eecd60164 (patch) | |
tree | fa93706a500c492ee85da25f19ae2032c1145f11 | |
parent | 0d9d74e42beb2154f59cedb0109aed65f0b54fc7 (diff) | |
download | syslinux-5e22b9c7fc046100f26974536333149eecd60164.tar.gz |
hdt: Adding cpu voltage
Impact: Adding cpu voltage
Adding cpu voltage via DMI
-rw-r--r-- | com32/hdt/hdt-cli-cpu.c | 16 | ||||
-rw-r--r-- | com32/hdt/hdt-menu-processor.c | 17 |
2 files changed, 25 insertions, 8 deletions
diff --git a/com32/hdt/hdt-cli-cpu.c b/com32/hdt/hdt-cli-cpu.c index 683a6b38..aa7ec8f7 100644 --- a/com32/hdt/hdt-cli-cpu.c +++ b/com32/hdt/hdt-cli-cpu.c @@ -92,10 +92,18 @@ static void show_cpu(int argc __unused, char **argv __unused, more_printf("Family ID : %d\n", hardware->cpu.family); more_printf("Model ID : %d\n", hardware->cpu.model_id); more_printf("Stepping : %d\n", hardware->cpu.stepping); - more_printf("FSB : %d MHz\n", hardware->dmi.processor.external_clock); - more_printf("Cur. Speed: %d MHz\n", hardware->dmi.processor.current_speed); - more_printf("Max Speed : %d MHz\n", hardware->dmi.processor.max_speed); - more_printf("Upgrade : %s\n", hardware->dmi.processor.upgrade); + if (hardware->is_dmi_valid) { + more_printf("FSB : %d MHz\n", + hardware->dmi.processor.external_clock); + more_printf("Cur. Speed: %d MHz\n", + hardware->dmi.processor.current_speed); + more_printf("Max Speed : %d MHz\n", hardware->dmi.processor.max_speed); + more_printf("Upgrade : %s\n", hardware->dmi.processor.upgrade); + more_printf("Voltage : %d.%02d\n", + hardware->dmi.processor.voltage_mv / 1000, + hardware->dmi.processor.voltage_mv - + ((hardware->dmi.processor.voltage_mv / 1000) * 1000)); + } if (hardware->cpu.flags.smp) { more_printf("SMP : yes\n"); } else { diff --git a/com32/hdt/hdt-menu-processor.c b/com32/hdt/hdt-menu-processor.c index abb9a1af..f303eb6a 100644 --- a/com32/hdt/hdt-menu-processor.c +++ b/com32/hdt/hdt-menu-processor.c @@ -63,10 +63,8 @@ void compute_processor(struct s_my_menu *menu, struct s_hardware *hardware) add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0); menu->items_count++; - snprintf(buffer, sizeof buffer, "Model : %s", - hardware->cpu.model); - snprintf(statbuffer, sizeof statbuffer, "Model: %s", - hardware->cpu.model); + snprintf(buffer, sizeof buffer, "Model : %s", hardware->cpu.model); + snprintf(statbuffer, sizeof statbuffer, "Model: %s", hardware->cpu.model); add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0); menu->items_count++; @@ -141,6 +139,17 @@ void compute_processor(struct s_my_menu *menu, struct s_hardware *hardware) hardware->dmi.processor.upgrade); add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0); menu->items_count++; + + snprintf(buffer, sizeof buffer, "Voltage : %d.%02d", + hardware->dmi.processor.voltage_mv / 1000, + hardware->dmi.processor.voltage_mv - + ((hardware->dmi.processor.voltage_mv / 1000) * 1000)); + snprintf(statbuffer, sizeof statbuffer, "Voltage (V) : %d.%02d", + hardware->dmi.processor.voltage_mv / 1000, + hardware->dmi.processor.voltage_mv - + ((hardware->dmi.processor.voltage_mv / 1000) * 1000)); + add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0); + menu->items_count++; } if (hardware->cpu.flags.smp) { |