From patchwork Sat Jan 10 20:28:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1461 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=1768077031; bh=R3QT0tAbRMFpnt324kO7fF2mS2ttuBs+sG2MRD0gLSQ=; 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=aPhaDUR90vB6AepR5Irl3Ekuos79Cq9MLVnz3mywCd59++/nPbhptmW5GcSX9oKlt sGHjhlrVwWEiOEO/hxV8O8lzxZMmMTm7Q9SZMbqcSLzWYkxFOzbRAXMkvilmUx5Wmy cfyDdj+dugG/5ENCz3IqYAf+dUviEDkIkSvlSf6RMqFQOnQKPfheA1d7D/evHW0Swu eAxOHaes2JHS3Bk920kmN8pikgk+gHi2jP/GWPDp1RYEyDiqkY1j2HsVk65Ogv0AYI 2N1f0jRJ6fpzgklfoxmrgXYtV3CPgw2sjsH66UXx387NNajVYd748N+Arn2efz4Dnj Sfq7KA/4YkVPA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5042469296 for ; Sat, 10 Jan 2026 13:30:31 -0700 (MST) 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 cWiwgCmW1pK2 for ; Sat, 10 Jan 2026 13:30:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077031; bh=R3QT0tAbRMFpnt324kO7fF2mS2ttuBs+sG2MRD0gLSQ=; 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=aPhaDUR90vB6AepR5Irl3Ekuos79Cq9MLVnz3mywCd59++/nPbhptmW5GcSX9oKlt sGHjhlrVwWEiOEO/hxV8O8lzxZMmMTm7Q9SZMbqcSLzWYkxFOzbRAXMkvilmUx5Wmy cfyDdj+dugG/5ENCz3IqYAf+dUviEDkIkSvlSf6RMqFQOnQKPfheA1d7D/evHW0Swu eAxOHaes2JHS3Bk920kmN8pikgk+gHi2jP/GWPDp1RYEyDiqkY1j2HsVk65Ogv0AYI 2N1f0jRJ6fpzgklfoxmrgXYtV3CPgw2sjsH66UXx387NNajVYd748N+Arn2efz4Dnj Sfq7KA/4YkVPA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3CEBD69290 for ; Sat, 10 Jan 2026 13:30:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077029; bh=mUsmWKKm2+7fxGa84IoGm7PGooQPTURwv0xyg/ZlBjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZsAIyHJAS+oyb8S5nsiB0IatN1RhYPT21xfdSgguJ1Z8dTZoPljw/PLFgHJ3kk95u ZjsfpoVVZJUDBpYw0ZcGznIVo+fdJhJ+73ab/J6A4lKgZHnF12LdGPg9apr6f/VfW1 r3vJ1/ehksYeM80BdcxodDutTV8MEIMlA/q+TbEuhKLz7moEdELCIut7vyazIGDzLz vPeSS3SZczT4nNb2pV7hnfgOTkkCl1DRhoTGVWC604ChsyDd9jN7nURYsiZvbInHj0 4NJPzQafzI+SPgLAX4omlQA1ZQCWgsjGtGmeojuf8r2a5NxGAocprzEkMsW22KY5cO muIxHXsz5vybw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 389116927E; Sat, 10 Jan 2026 13:30:29 -0700 (MST) 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 KA31_rZVgv0b; Sat, 10 Jan 2026 13:30:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077023; bh=fK6aoLHVX9e3r+bPhpOEjuaZWbBXESp92NDyJEcb1Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LFdNecvMoTtyybs9TXEJqm2IAyISsDWrGNShdjJHtbnm1+PzF4of6i+4I4FTEaLYB 411z/vfU1WAYdRae8eHeG0+Z/96bAkynWPiayZty4D2bWLvHEL+7xtg2R92tZuVKRy w0AcJScBxpaBCJcSXv5qXCJKiN2rMGlgQN8X5Ys3BlYW90tFP7zbRpUxAuGxGGzaz6 2yw3ISHByipE21ComJsy+Hi+/HKVEyKM/hCWDVGVNN7M/+1/ytg6bYCf9UTmRE9hs0 +N9bm6kIYWl/1ugqbstKRc2kM+gLq5X7ePdm+Rlz2aKiWbnypynMgkWYp+FPDxfQS1 P9bl4wZ+5VlQw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3429369290; Sat, 10 Jan 2026 13:30:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 13:28:47 -0700 Message-ID: <20260110202906.187370-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260110202906.187370-1-sjg@u-boot.org> References: <20260110202906.187370-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ISAYWR2U3NV7CLLIDYZY6B4WBTD3ZHVC X-Message-ID-Hash: ISAYWR2U3NV7CLLIDYZY6B4WBTD3ZHVC 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: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/26] boot: pxe: Set pxe_file_size in get_pxe_file() 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 Currently pxe_file_size is only set by the cmd/pxe.c callback, so other callers of get_pxe_file() (like tests) do not have access to the file size. Add an assignment into get_pxe_file() so the size is always available in the context after loading a PXE config file. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/pxe_utils.c | 1 + test/boot/pxe.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index a2a2b986de1..2d9081e6e9b 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -151,6 +151,7 @@ int get_pxe_file(struct pxe_context *ctx, const char *file_path, buf = map_sysmem(file_addr + size, 1); *buf = '\0'; unmap_sysmem(buf); + ctx->pxe_file_size = size; return 1; } diff --git a/test/boot/pxe.c b/test/boot/pxe.c index 2d690141349..a1ce27ea2a7 100644 --- a/test/boot/pxe.c +++ b/test/boot/pxe.c @@ -1178,7 +1178,7 @@ static int pxe_test_alloc_norun(struct unit_test_state *uts) ut_asserteq_ptr(&info, ctx.userdata); ut_asserteq(true, ctx.allow_abs_path); ut_assertnonnull(ctx.bootdir); - ut_asserteq(0, ctx.pxe_file_size); /* only set by cmd/pxe.c */ + ut_assert(ctx.pxe_file_size); /* set by get_pxe_file() */ ut_asserteq(false, ctx.use_ipv6); ut_asserteq(false, ctx.use_fallback); ut_asserteq(true, ctx.no_boot);