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);
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));
* 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;
}
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 */
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);
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);
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);