aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt
diff options
context:
space:
mode:
authorErwan Velu <erwanaliasr1@gmail.com>2011-01-30 15:06:40 +0100
committerErwan Velu <erwanaliasr1@gmail.com>2011-01-30 15:06:40 +0100
commit98d58026c4bf38e42adcfbd5f92da29fb582d41a (patch)
treef6b81269e20a166e7c37917e2f51e905120d9b3d /com32/hdt
parent7444a40f48c3f70a34ddb9a95945a5d709058038 (diff)
downloadsyslinux-98d58026c4bf38e42adcfbd5f92da29fb582d41a.tar.gz
syslinux-98d58026c4bf38e42adcfbd5f92da29fb582d41a.tar.xz
syslinux-98d58026c4bf38e42adcfbd5f92da29fb582d41a.zip
hdt: Improving CPU displayhdt/0.4.0-beta1
Diffstat (limited to 'com32/hdt')
-rw-r--r--com32/hdt/hdt-cli-cpu.c3
-rw-r--r--com32/hdt/hdt-common.c5
-rw-r--r--com32/hdt/hdt-common.h1
-rw-r--r--com32/hdt/hdt-menu-processor.c3
-rw-r--r--com32/hdt/hdt-menu-summary.c7
5 files changed, 12 insertions, 7 deletions
diff --git a/com32/hdt/hdt-cli-cpu.c b/com32/hdt/hdt-cli-cpu.c
index de0c9cde..ca095a6c 100644
--- a/com32/hdt/hdt-cli-cpu.c
+++ b/com32/hdt/hdt-cli-cpu.c
@@ -45,8 +45,7 @@ void main_show_cpu(int argc __unused, char **argv __unused,
if (hardware->acpi.madt.processor_local_apic_count > 0) {
more_printf("CPU (%d logical / %d phys)\n",
hardware->acpi.madt.processor_local_apic_count,
- hardware->acpi.madt.processor_local_apic_count /
- hardware->cpu.num_cores);
+ hardware->physical_cpu_count);
} else
more_printf("CPU\n");
more_printf(" Manufacturer : %s \n", hardware->cpu.vendor);
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index ded079ed..5953be3b 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -184,6 +184,7 @@ void init_hardware(struct s_hardware *hardware)
hardware->is_acpi_valid = false;
hardware->pci_domain = NULL;
hardware->detected_memory_size = 0;
+ hardware->physical_cpu_count =1; /* we have at least one cpu */
/* Cleaning structures */
memset(hardware->disk_info, 0, sizeof(hardware->disk_info));
@@ -563,6 +564,10 @@ void cpu_detect(struct s_hardware *hardware)
* That makes some weird display in console/menu
* Let's remove that mulitple spaces */
strlcpy(hardware->cpu.model,del_multi_spaces(hardware->cpu.model),sizeof(hardware->cpu.model));
+
+ if ((hardware->is_acpi_valid) && (hardware->acpi.madt.valid)) {
+ hardware->physical_cpu_count=hardware->acpi.madt.processor_local_apic_count / hardware->cpu.num_cores;
+ }
hardware->cpu_detection = true;
}
diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h
index 3aa5a506..df7d2c98 100644
--- a/com32/hdt/hdt-common.h
+++ b/com32/hdt/hdt-common.h
@@ -173,6 +173,7 @@ struct s_vesa {
struct s_hardware {
s_dmi dmi; /* DMI table */
s_cpu cpu; /* CPU information */
+ uint8_t physical_cpu_count; /* Number of physical cpu */
s_vpd vpd; /* VPD information */
s_acpi acpi;
struct pci_domain *pci_domain; /* PCI Devices */
diff --git a/com32/hdt/hdt-menu-processor.c b/com32/hdt/hdt-menu-processor.c
index ca3e154e..ad4a8bae 100644
--- a/com32/hdt/hdt-menu-processor.c
+++ b/com32/hdt/hdt-menu-processor.c
@@ -58,8 +58,7 @@ void compute_processor(struct s_my_menu *menu, struct s_hardware *hardware)
snprintf(buffer, sizeof buffer,
" Main Processors (%d logical / %d phys. ) ",
hardware->acpi.madt.processor_local_apic_count,
- hardware->acpi.madt.processor_local_apic_count /
- hardware->cpu.num_cores);
+ hardware->physical_cpu_count);
menu->menu = add_menu(buffer, -1);
menu->items_count = 0;
set_menu_pos(SUBMENU_Y, SUBMENU_X);
diff --git a/com32/hdt/hdt-menu-summary.c b/com32/hdt/hdt-menu-summary.c
index e9d56caf..d02f3c30 100644
--- a/com32/hdt/hdt-menu-summary.c
+++ b/com32/hdt/hdt-menu-summary.c
@@ -34,7 +34,8 @@ void compute_summarymenu(struct s_my_menu *menu, struct s_hardware *hardware)
char buffer[SUBMENULEN + 1];
char statbuffer[STATLEN + 1];
- menu->menu = add_menu(" Summary ", -1);
+ snprintf(buffer, sizeof(buffer), " Summary (%d CPU) ", hardware->physical_cpu_count);
+ menu->menu = add_menu(buffer, -1);
menu->items_count = 0;
set_menu_pos(SUBMENU_Y, SUBMENU_X);
@@ -60,9 +61,9 @@ void compute_summarymenu(struct s_my_menu *menu, struct s_hardware *hardware)
else
strcat(features, ", 32bit");
if (hardware->cpu.flags.smp)
- strcat(features, ", SMP ");
+ strcat(features, ", SMP");
if (hardware->cpu.flags.vmx || hardware->cpu.flags.svm)
- strcat(features, ", HwVIRT ");
+ strcat(features, ", HwVIRT");
snprintf(buffer, sizeof buffer, "%s", features);
snprintf(statbuffer, sizeof statbuffer, "Features : %s", features);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);