meminfo: Allow for up to 10 hex digits

On platforms where most of the memory is above 4GB, the EFI app may find
itself using addresses with 9 or even 10 digits. Expand the width of the
columns to cope with this.

Add some double bars across digits 9 and 8 so that it is easier to make
the value.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-08-14 13:55:51 -06:00
parent f1f8a0c61b
commit f6acb6e003
2 changed files with 6 additions and 5 deletions

View File

@@ -19,9 +19,9 @@ static void print_region(const char *name, ulong base, ulong size, ulong *uptop)
{
ulong end = base + size;
printf("%-12s %8lx %8lx %8lx", name, base, size, end);
printf("%-12s %10lx %10lx %10lx", name, base, size, end);
if (*uptop)
printf(" %8lx", *uptop - end);
printf(" %10lx", *uptop - end);
putc('\n');
*uptop = base;
}
@@ -58,9 +58,10 @@ static int do_meminfo(struct cmd_tbl *cmdtp, int flag, int argc,
if (!IS_ENABLED(CONFIG_CMD_MEMINFO_MAP))
return 0;
printf("\n%-12s %8s %8s %8s %8s\n", "Region", "Base", "Size", "End",
printf("\n%-12s %10s %10s %10s %10s\n", "Region", "|| Base",
"|| Size", "|| End",
"Gap");
printf("------------------------------------------------\n");
printf("--------------------------------------------------------\n");
upto = 0;
if (IS_ENABLED(CONFIG_VIDEO))
print_region("video", gd_video_bottom(),

View File

@@ -17,7 +17,7 @@ static int cmd_test_meminfo(struct unit_test_state *uts)
ut_assert_nextline("DRAM: 256 MiB");
ut_assert_nextline_empty();
ut_assert_nextline("Region Base Size End Gap");
ut_assert_nextline("Region || Base || Size || End Gap");
ut_assert_nextlinen("-");
/* For now we don't worry about checking the values */