From patchwork Tue Aug 19 18:58:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 7 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755630038; bh=FoS03lPqlEai9IsP5Ekzhf8Yc545XGSASa6b7PmSN9M=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=M+UCIIMDg1T1niH/VU8/YKghYV2tpAY2P5bJbkOeSDe5lrO1d6Ko6ahPZs0wA7/JQ c+xQCS2UsB87TfU5QmmuQqu+5VU82NP1dud6n0YQ8A7uTylV19EGiBSkaYkSIH9Gtb xk3JVVAJk5btdWerpR9yQ1okIsiJyZhGrdsPKKF+Roqv54ujFLuuLR3ErrcgOa731y qWTXgGIn7CFmKG5/iOup+9hPvbhkJPu7FlEwohCXpxdVOG4QT5Io3K4VQxYi/ypLHu fO7oG6nosjVcOLZNH05y/lTnPiAfLGTXGHzfCe1VQShmanQtsO1sHO+SZAf2B8PFx8 Q7RYl4WaRVySg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D7EE0675F9 for ; Tue, 19 Aug 2025 13:00:38 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Q6bpxJtcPC1A for ; Tue, 19 Aug 2025 13:00:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755630036; bh=FoS03lPqlEai9IsP5Ekzhf8Yc545XGSASa6b7PmSN9M=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=CFl9SkOL/e+hFYRRNpPUc94cwH3PcPuqN3mGa2G5shivK6tX1edGTjnBJDq9aRhvr MzuzlmEUKEwnLfHFKdtSJa0TOTs7C3Q07/lV6piDZEnF1i4+saiGPFs+2/m5TNT9Bv Z4uziuJkw8GZGAhWnT6hqVBy40shiLX723dp8EwdaBjKA0xo0pm1IMHiC+FxyS+BX8 SITe3ssGgbYAjTxxf5Xs1Uk2U9mNcFU8WF+H7J+KL6DvRy9/+q2t+V9fvlVNr9ZEq3 HSNu4Xx/8CaeRv0f0EWNephyS58BL2Fj5ul4oBLY/XPUhKtOlvrMSnXeDHlY2atBeU 84GrRe+kFA2sQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D5A8067604 for ; Tue, 19 Aug 2025 13:00:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755630035; bh=DbucwXYkbRr42WBu+mj4LSHWMNjgGPAOyie0KaNVcbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j1DsA7S0/rcKRJ3C6YF2VTQbOnRXs6GdVJe4TTfgJsN57GiYGMmJBdSYwm446n1pc dTeYCYN6kcNiOxAxqQ/5hLTC5+F97vybPtJgtvVzw3eKiVbqsCFlqX+XN2eMP9hGwx h46kDhz82DwUyBu8iYQr52qlQu0m3vfqyhgoV1v6JrOP+NvCbXAJS/cRaABpfnL/17 9dBSjmImK5ymxdEFqChujs6rmq52G5yDBhuRZnhFC9QzQUclSO/BQ78/DiYEaUxnKF RjnnX1WUOjgNp0cjhktLRVVWc+g5y70gsK8q9tPxKsW4RA9GNDT09fnJhLtiBSceM9 0jMGdDJuzOuEw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3B33B675DE; Tue, 19 Aug 2025 13:00:35 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id hKoUg_tcBPhq; Tue, 19 Aug 2025 13:00:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755630033; bh=LfH68G/TtQeHYFB7g4oieL1OA6JauIfZiYy2nXO7MAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sfie0oIjCgzOkcp/MR7Q71L46/Cm5ExuEOrXVyR+SkKGXLbvIgOZS3SQMY6OSRMOw lhSuAvXvVnTLC+u7EbnNX6MZoWXQ5qjZYUIGnAFuUrPXqA9XZ58uy3qlVGQ9KnUGzM uY7MrhhbxSdpsCCI7t+iyLSLDTu4F5JCYiSSOWwmSdgYlLouwV3uN4cVtq0eGQ7eNr 64YqgAMDZG0vdJwnm5+FxM2c5FdxLycPFXEJR6LZRc72oBTyOwktJ1NBj1mW5DPnHc +SpURXiPLFI2j43lt4jmCkczCGPxbeqnN71Z+7iyiHjxo/RRoBXv8j4nJDuPkTOXol aj8Rxn1dD0RKg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 66B4D675EE; Tue, 19 Aug 2025 13:00:33 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 12:58:36 -0600 Message-ID: <20250819185900.835939-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250819185900.835939-1-sjg@u-boot.org> References: <20250819185900.835939-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: I64E7SL2RFXGE7BGSKEWZX4WEHC2AA7J X-Message-ID-Hash: I64E7SL2RFXGE7BGSKEWZX4WEHC2AA7J X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 05/22] meminfo: Allow for up to 10 hex digits List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass 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 --- (no changes since v1) cmd/meminfo.c | 9 +++++---- test/cmd/meminfo.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/meminfo.c b/cmd/meminfo.c index 5e83d61c2dd..2f83ca27537 100644 --- a/cmd/meminfo.c +++ b/cmd/meminfo.c @@ -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(), diff --git a/test/cmd/meminfo.c b/test/cmd/meminfo.c index 53b41e3b49e..b2f306d06e2 100644 --- a/test/cmd/meminfo.c +++ b/test/cmd/meminfo.c @@ -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 */