From f1f66949529c9efea6343313f532dd1fbb119806 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Fri, 27 Nov 2009 15:53:07 +0100 Subject: [PATCH] hdt: Adding cpu core management Impact: we now display the number of cores CPU cores are now displayed --- com32/hdt/hdt-cli-cpu.c | 2 ++ com32/hdt/hdt-menu-processor.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/com32/hdt/hdt-cli-cpu.c b/com32/hdt/hdt-cli-cpu.c index 432e98f..d4c9fba 100644 --- a/com32/hdt/hdt-cli-cpu.c +++ b/com32/hdt/hdt-cli-cpu.c @@ -43,6 +43,7 @@ void main_show_cpu(int argc __unused, char **argv __unused, more_printf("CPU\n"); more_printf(" Manufacturer : %s \n", hardware->cpu.vendor); more_printf(" Product : %s \n", del_multi_spaces(hardware->cpu.model)); + more_printf(" Number Cores : %d \n", hardware->cpu.num_cores); memset(features,0,sizeof(features)); snprintf(features, sizeof(features)," Features : %d Mhz : ",hardware->dmi.processor.current_speed); @@ -79,6 +80,7 @@ static void show_cpu(int argc __unused, char **argv __unused, more_printf("CPU\n"); more_printf("Vendor : %s\n", hardware->cpu.vendor); more_printf("Model : %s\n", hardware->cpu.model); + more_printf("Num. Cores: %d\n", hardware->cpu.num_cores); more_printf("Vendor ID : %d\n", hardware->cpu.vendor_id); more_printf("Family ID : %d\n", hardware->cpu.family); more_printf("Model ID : %d\n", hardware->cpu.model_id); diff --git a/com32/hdt/hdt-menu-processor.c b/com32/hdt/hdt-menu-processor.c index 1751ff6..a538e4d 100644 --- a/com32/hdt/hdt-menu-processor.c +++ b/com32/hdt/hdt-menu-processor.c @@ -70,6 +70,12 @@ 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, "Cores : %d", hardware->cpu.num_cores); + snprintf(statbuffer, sizeof statbuffer, "Number of cores: %d", + hardware->cpu.num_cores); + add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0); + menu->items_count++; + snprintf(buffer, sizeof buffer, "Vendor ID : %d", hardware->cpu.vendor_id); snprintf(statbuffer, sizeof statbuffer, "Vendor ID: %d", hardware->cpu.vendor_id); -- 2.7.4