summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-11-23 15:16:32 +0100
committerErwan Velu <erwan.velu@free.fr>2009-11-23 15:16:32 +0100
commit06a7af2737be560f651f72e36c424affbba5fc43 (patch)
tree2de5246a31855e19b93ca586f4d70e04074e8a95
parentbb88c66722eedcf2a2e5fb03051c6cef4c9ad5a3 (diff)
downloadsyslinux-06a7af2737be560f651f72e36c424affbba5fc43.tar.gz
hdt: Rounding detected memory size
Impact: Visual Rounding values to have more realistic values
-rw-r--r--com32/hdt/hdt-cli-dmi.c2
-rw-r--r--com32/hdt/hdt-cli-memory.c2
-rw-r--r--com32/hdt/hdt-menu-memory.c2
-rw-r--r--com32/hdt/hdt-menu-summary.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/com32/hdt/hdt-cli-dmi.c b/com32/hdt/hdt-cli-dmi.c
index 766a3cba..d00489bc 100644
--- a/com32/hdt/hdt-cli-dmi.c
+++ b/com32/hdt/hdt-cli-dmi.c
@@ -530,7 +530,7 @@ void show_dmi_memory_modules(int argc __unused, char** argv __unused,
detect_dmi(hardware);
more_printf("Memory Size : %lu MB (%lu KB)\n",
- hardware->detected_memory_size>>10,
+ (hardware->detected_memory_size + (1<<9)) >>10,
hardware->detected_memory_size);
if ((hardware->dmi.memory_count <= 0) && (hardware->dmi.memory_module_count <= 0)) {
diff --git a/com32/hdt/hdt-cli-memory.c b/com32/hdt/hdt-cli-memory.c
index a51569fc..6f2004ca 100644
--- a/com32/hdt/hdt-cli-memory.c
+++ b/com32/hdt/hdt-cli-memory.c
@@ -42,7 +42,7 @@ static void show_memory_e820(int argc __unused, char **argv __unused,
detect_memory_e820(map, E820MAX, &count);
memsize=memsize_e820(map,count);
reset_more_printf();
- more_printf("Detected RAM : %lu MiB (%lu KiB)\n",memsize>>10,memsize);
+ more_printf("Detected RAM : %lu MiB (%lu KiB)\n",(memsize+(1<<9))>>10,memsize);
more_printf("BIOS-provided physical RAM e820 map:\n");
for (int i = 0; i < count; i++) {
get_type(map[i].type, type, 14);
diff --git a/com32/hdt/hdt-menu-memory.c b/com32/hdt/hdt-menu-memory.c
index a85b1fa2..6eac9969 100644
--- a/com32/hdt/hdt-menu-memory.c
+++ b/com32/hdt/hdt-menu-memory.c
@@ -346,7 +346,7 @@ void compute_memory(struct s_hdt_menu *menu, s_dmi * dmi, struct s_hardware *har
menu->memory_menu.items_count = 0;
snprintf(buffer, sizeof(buffer), " %lu MB detected ",
- hardware->detected_memory_size>>10);
+ (hardware->detected_memory_size+(1<<9))>>10);
add_item(buffer, "Detected Memory", OPT_INACTIVE, NULL,menu->memory_sub_menu[0].menu);
menu->memory_menu.items_count++;
diff --git a/com32/hdt/hdt-menu-summary.c b/com32/hdt/hdt-menu-summary.c
index 2cc0c8b9..bd10cb23 100644
--- a/com32/hdt/hdt-menu-summary.c
+++ b/com32/hdt/hdt-menu-summary.c
@@ -99,10 +99,10 @@ void compute_summarymenu(struct s_my_menu *menu, struct s_hardware *hardware)
add_item("", "", OPT_SEP, "", 0);
snprintf(buffer, sizeof buffer, "Memory Size : %lu MiB (%lu KiB)",
- hardware->detected_memory_size>>10,
+ (hardware->detected_memory_size + (1<<9))>>10,
hardware->detected_memory_size);
snprintf(statbuffer, sizeof statbuffer, "Detected Memory Size: %lu MiB (%lu KiB)",
- hardware->detected_memory_size>>10, hardware->detected_memory_size);
+ (hardware->detected_memory_size+(1<<9))>>10, hardware->detected_memory_size);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu->items_count++;