]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd/meminfo: display of addresses above 4 GiB
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 21 Dec 2025 01:58:56 +0000 (02:58 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 19 Jan 2026 09:31:21 +0000 (10:31 +0100)
Addresses above 4 GiB don't fit into 8 digits.
Use 13 digits which encompass up to 15 TiB.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <simon.glass@canonical.com>
cmd/meminfo.c
test/cmd/meminfo.c

index aa3b5bafe176000da7e91a6eb424321858182832..b731280d106c08b967ac2ff6ae2eadd96e0c6a9f 100644 (file)
@@ -23,9 +23,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 %13lx %13lx %13lx", name, base, size, end);
        if (*uptop)
-               printf(" %8lx", *uptop - end);
+               printf(" %13lx", *uptop - end);
        putc('\n');
        *uptop = base;
 }
@@ -64,9 +64,9 @@ static int do_meminfo(struct cmd_tbl *cmdtp, int flag, int argc,
 
        arch_dump_mem_attrs();
 
-       printf("\n%-12s %8s %8s %8s %8s\n", "Region", "Base", "Size", "End",
+       printf("\n%-12s %13s %13s %13s %13s\n", "Region", "Base", "Size", "End",
               "Gap");
-       printf("------------------------------------------------\n");
+       printf("--------------------------------------------------------------------\n");
        upto = 0;
        if (IS_ENABLED(CONFIG_VIDEO))
                print_region("video", gd_video_bottom(),
index 40c3520496ed2f60914200170acd110e2478270d..9224b9589f3b89905d1a4987aea03ba83ed92566 100644 (file)
@@ -17,7 +17,7 @@ static int cmd_test_meminfo(struct unit_test_state *uts)
        ut_assert_nextlinen("DRAM:  ");
        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 */