summaryrefslogtreecommitdiff
path: root/com32/hdt/hdt-cli-memory.c
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-11-24 10:24:49 +0100
committerErwan Velu <erwan.velu@free.fr>2009-11-24 10:24:49 +0100
commit990205b434e7652c835cdb2dd86ef1c43eab7b44 (patch)
tree1b6b13f1871dc6f9e6e100109a8981ac134bc176 /com32/hdt/hdt-cli-memory.c
parent0179ef2c03b7e9ec5d5dd23fa178387515384fa4 (diff)
downloadsyslinux-990205b434e7652c835cdb2dd86ef1c43eab7b44.tar.gz
hdt: Running Nindent
Impact: Visual cleanup HDT now uses the same indent as syslinux
Diffstat (limited to 'com32/hdt/hdt-cli-memory.c')
-rw-r--r--com32/hdt/hdt-cli-memory.c143
1 files changed, 73 insertions, 70 deletions
diff --git a/com32/hdt/hdt-cli-memory.c b/com32/hdt/hdt-cli-memory.c
index 650c6898..51d087e8 100644
--- a/com32/hdt/hdt-cli-memory.c
+++ b/com32/hdt/hdt-cli-memory.c
@@ -34,98 +34,101 @@
static void show_memory_e820(int argc __unused, char **argv __unused,
struct s_hardware *hardware __unused)
{
- struct e820entry map[E820MAX];
- unsigned long memsize=0;
- int count = 0;
- char type[14];
+ struct e820entry map[E820MAX];
+ unsigned long memsize = 0;
+ int count = 0;
+ char type[14];
- detect_memory_e820(map, E820MAX, &count);
- memsize=memsize_e820(map,count);
- reset_more_printf();
- 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);
- more_printf("%016llx - %016llx %016llx (%s)\n",
- map[i].addr, map[i].size, map[i].addr+map[i].size,
- remove_spaces(type));
- }
- struct e820entry nm[E820MAX];
+ detect_memory_e820(map, E820MAX, &count);
+ memsize = memsize_e820(map, count);
+ reset_more_printf();
+ 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);
+ more_printf("%016llx - %016llx %016llx (%s)\n",
+ map[i].addr, map[i].size, map[i].addr + map[i].size,
+ remove_spaces(type));
+ }
+ struct e820entry nm[E820MAX];
- /* Clean up, adjust and copy the BIOS-supplied E820-map. */
- int nr = sanitize_e820_map(map, nm, count);
+ /* Clean up, adjust and copy the BIOS-supplied E820-map. */
+ int nr = sanitize_e820_map(map, nm, count);
- more_printf("\n");
- more_printf("Sanitized e820 map:\n");
- for (int i = 0; i < nr; i++) {
- get_type(nm[i].type, type, 14);
- more_printf("%016llx - %016llx %016llx (%s)\n",
- nm[i].addr, nm[i].size, nm[i].addr+nm[i].size,
- remove_spaces(type));
- }
+ more_printf("\n");
+ more_printf("Sanitized e820 map:\n");
+ for (int i = 0; i < nr; i++) {
+ get_type(nm[i].type, type, 14);
+ more_printf("%016llx - %016llx %016llx (%s)\n",
+ nm[i].addr, nm[i].size, nm[i].addr + nm[i].size,
+ remove_spaces(type));
+ }
}
static void show_memory_e801(int argc __unused, char **argv __unused,
struct s_hardware *hardware __unused)
{
- int mem_low, mem_high = 0;
+ int mem_low, mem_high = 0;
- reset_more_printf();
- if (detect_memory_e801(&mem_low, &mem_high)) {
- more_printf("e801 bogus!\n");
- } else {
- more_printf("Detected RAM : %d MiB(%d KiB)\n",(mem_low>>10) + (mem_high>>4),mem_low+(mem_high << 6));
- more_printf("e801 details : %d Kb (%d MiB) - %d Kb (%d MiB)\n",
- mem_low, mem_low >> 10, mem_high << 6, mem_high >> 4);
- }
+ reset_more_printf();
+ if (detect_memory_e801(&mem_low, &mem_high)) {
+ more_printf("e801 bogus!\n");
+ } else {
+ more_printf("Detected RAM : %d MiB(%d KiB)\n",
+ (mem_low >> 10) + (mem_high >> 4),
+ mem_low + (mem_high << 6));
+ more_printf("e801 details : %d Kb (%d MiB) - %d Kb (%d MiB)\n", mem_low,
+ mem_low >> 10, mem_high << 6, mem_high >> 4);
+ }
}
static void show_memory_88(int argc __unused, char **argv __unused,
struct s_hardware *hardware __unused)
{
- int mem_size = 0;
+ int mem_size = 0;
- reset_more_printf();
- if (detect_memory_88(&mem_size)) {
- more_printf("8800h bogus!\n");
- } else {
- more_printf("8800h memory size: %d Kb (%d MiB)\n", mem_size,
- mem_size >> 10);
- }
+ reset_more_printf();
+ if (detect_memory_88(&mem_size)) {
+ more_printf("8800h bogus!\n");
+ } else {
+ more_printf("8800h memory size: %d Kb (%d MiB)\n", mem_size,
+ mem_size >> 10);
+ }
}
struct cli_callback_descr list_memory_show_modules[] = {
- {
- .name = "e820",
- .exec = show_memory_e820,
- },
- {
- .name = "e801",
- .exec = show_memory_e801,
- },
- {
- .name = "88",
- .exec = show_memory_88,
- },
- {
- .name = CLI_DMI_MEMORY_BANK,
- .exec = show_dmi_memory_bank,
- },
- {
- .name = NULL,
- .exec = NULL,
- },
+ {
+ .name = "e820",
+ .exec = show_memory_e820,
+ },
+ {
+ .name = "e801",
+ .exec = show_memory_e801,
+ },
+ {
+ .name = "88",
+ .exec = show_memory_88,
+ },
+ {
+ .name = CLI_DMI_MEMORY_BANK,
+ .exec = show_dmi_memory_bank,
+ },
+ {
+ .name = NULL,
+ .exec = NULL,
+ },
};
struct cli_module_descr memory_show_modules = {
- .modules = list_memory_show_modules,
- .default_callback = show_dmi_memory_modules,
+ .modules = list_memory_show_modules,
+ .default_callback = show_dmi_memory_modules,
};
struct cli_mode_descr memory_mode = {
- .mode = MEMORY_MODE,
- .name = CLI_MEMORY,
- .default_modules = NULL,
- .show_modules = &memory_show_modules,
- .set_modules = NULL,
+ .mode = MEMORY_MODE,
+ .name = CLI_MEMORY,
+ .default_modules = NULL,
+ .show_modules = &memory_show_modules,
+ .set_modules = NULL,
};