diff options
author | Erwan Velu <erwan.velu@free.fr> | 2009-11-18 10:51:36 +0100 |
---|---|---|
committer | Erwan Velu <erwan.velu@free.fr> | 2009-11-18 10:51:36 +0100 |
commit | 806dfd8ea1e11c1f3ee9175862d34affe8a16071 (patch) | |
tree | ddbddfc8ea94028b88747be20003f9b271479c1a /com32/hdt/hdt-menu-summary.c | |
parent | 9e2a3aa979a6da423034c4c4088d0cd2d748c1c8 (diff) | |
download | syslinux-806dfd8ea1e11c1f3ee9175862d34affe8a16071.tar.gz |
hdt: Summary mode use type6 as workaround
Impact: Avoid empty field
The summary mode should also use type6 as fallback of type 17
Diffstat (limited to 'com32/hdt/hdt-menu-summary.c')
-rw-r--r-- | com32/hdt/hdt-menu-summary.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/com32/hdt/hdt-menu-summary.c b/com32/hdt/hdt-menu-summary.c index e8e2fc65..8378c1b8 100644 --- a/com32/hdt/hdt-menu-summary.c +++ b/com32/hdt/hdt-menu-summary.c @@ -97,10 +97,10 @@ void compute_summarymenu(struct s_my_menu *menu, struct s_hardware *hardware) menu->items_count++; add_item("", "", OPT_SEP, "", 0); - - for (int i = 0; i < hardware->dmi.memory_count; i++) { + /*if type 17 is available */ + if (hardware->dmi.memory_count>0) { + for (int i = 0; i < hardware->dmi.memory_count; i++) { if (hardware->dmi.memory[i].filled == true) { - /* When discovering the first item, let's clear the screen */ memset(bank_number, 0, sizeof(bank_number)); snprintf(bank_number, sizeof(bank_number), "%d ", i); @@ -123,6 +123,31 @@ void compute_summarymenu(struct s_my_menu *menu, struct s_hardware *hardware) menu->items_count++; } } + } + } else if (hardware->dmi.memory_module_count>0) { + /* Let's use type 6 as a fallback of type 17*/ + for (int i = 0; i < hardware->dmi.memory_module_count; i++) { + if (hardware->dmi.memory_module[i].filled == true) { + memset(bank_number, 0, sizeof(bank_number)); + snprintf(bank_number, sizeof(bank_number), + "%d ", i); + snprintf(buffer, sizeof buffer, + "Mem bank %02d : %s %s@%s", + i, + hardware->dmi.memory_module[i].enabled_size, + hardware->dmi.memory_module[i].type, + hardware->dmi.memory_module[i].speed); + snprintf(statbuffer, sizeof statbuffer, + "Memory bank %02d : %s %s@%s", + i, + hardware->dmi.memory_module[i].enabled_size, + hardware->dmi.memory_module[i].type, + hardware->dmi.memory_module[i].speed); + add_item(buffer, statbuffer, + OPT_INACTIVE, NULL, 0); + menu->items_count++; + } + } } add_item("", "", OPT_SEP, "", 0); |