From patchwork Mon Sep 22 18:01:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 406 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=1758564167; bh=WHOKhP45eS7/MSYLHlMQFB+Ks78SS72d/rf0mLmALog=; 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=eerSc0t7m7lMuVLdS4AHD5AoFVPd2/RlkKOkZjt+eKTnDRpTwy8xaOqQQzHHMTIip gk7kAinRua0EBj5QYpsYNzXFARrLavG6OEbZkGlab/2AcIDEf81Drgx1JHVqQCzo6V PDDMRvv3ekEbtALc+0S8qL6vGe1YCYdvvKX9Q7ASVkUKHNiUqtKD/+PGZG3nSI/8vn 1MH59Y14e0jJjb9tYVwVKuGijv/yeXBUtMYdmcHxFgIBGncEmy515nUWNv5G14Z4UB Q06U95tpaZhNkJwktqnyWos1r51BOFJRcDrP2A2G2ABrTXoWyYvWwPynjCKKplVYqn QKu2wG72ElF0w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0444467CE6 for ; Mon, 22 Sep 2025 12:02:47 -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 NIToYiWagX_m for ; Mon, 22 Sep 2025 12:02:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564166; bh=WHOKhP45eS7/MSYLHlMQFB+Ks78SS72d/rf0mLmALog=; 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=VGVK9Yv0DpuD0o0xKRTQz62BztLyH6ucIp0EZvXL1JyawbosSO5RVTPMuCjrostDu pZzSrorB50IrtMZLhe3UdY38/mWBdfrOyBiQI7bL63vD36CmUf99dfesLsizv0QuTi a4dpzL1G4YUtDweq/8eMeUe6fOBJBpzMys4VZ8uS2Va+JnjgdLa3Z99ozwhrrv8oO3 Tf+8PVSTr0knACEo+dPLP8hna+EuDt3g2yGD/rWyaMWwvP3dRQnyMRt/PQVfWVRgn1 Bs4VzbL3IP4wxbIxmbFFPopZCryZAulB8mbT+AE3ti5jK8LoiF2uBzBuPDDDS/sBtz emqZJKUm9EnAw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0415A67C52 for ; Mon, 22 Sep 2025 12:02:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564163; bh=wvBb9/S4WutmGwM/gyTkKXoRo9CqUjG06o6kYIBJjtE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dltrfy/Nr8fbfz9y1S+cAdN9Lb/X6L2sKDksFs6tYg0k+U+jlqFksOiFhGBYmmEvW Fe0V6yqvDYAIGskTKceZgRiW5jycUGKl0/u/ho83Myu4XpQylwywFQQz1ak4ysUbDP mP6x4dvdhBIwrOmqxSsgHKRDXujkc7mN31P4W+NmKyADabDQkj2H4ngxWGprNsOxw5 iHRzatLVFQ+e23m/FrJR+XI/HpGY58Yu3EpluLovCxIkAkKwYw3kqW8XKfPxrgizV/ 7J/73XWZPg/gqgUp3pmWzZNkRPyIIru54lcR0t2UjUgcp37IMNNG6GzhbO8hVbF5xb KKQFogOSJcG+w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8D32567B36; Mon, 22 Sep 2025 12:02:43 -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 z0kDrlQYfeFQ; Mon, 22 Sep 2025 12:02:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564162; bh=co+Ger9/B+XSt7nQLEQmFoSTGsYNS5FJyfemMoE+wAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P77y4VOgcjP6d32q/AyJosdkQhAYyeZSAHII/Btv1id0AFL7Ba29T378jUmaKIJ+9 XHMsBUNWD2LWw1AekmDNbH6zPSaMDeJiFEQiP2Y+jBObL/cR8IKmVYWNVo34TgdlT2 YKUsjHTlHBiHro59OKYCClCgwGzVTKlzkMFEwyzfrMydF3akmyHcMxec6fxU2aJUtd e8Z2DxhRYtqsvF9h3zLjMOP4e99Wkj9ig3poeYFBdz9ia1xqAi/g3COv3l9L+mvN2O NQuXHwwOLkddyjZYWKrQjsDLGB6fW982VUpfwpgx6cco6aaAvw6gcsfNBd8zlt5po7 5IynQRGPlMekg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BE6335FE1A; Mon, 22 Sep 2025 12:02:41 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:06 -0600 Message-ID: <20250922180116.3088502-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JUJSLTK4PTM26RYEUJ3FNHDZJ4X3BFRT X-Message-ID-Hash: JUJSLTK4PTM26RYEUJ3FNHDZJ4X3BFRT 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 22/24] efi: app: Call efi_exit() if board_init_r() returns 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 Move the efi_exit() function further up the file and call it if the board_init_r() function returns. Signed-off-by: Simon Glass --- lib/efi_client/efi_app.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c index 25fc2e9cade..b99de578fac 100644 --- a/lib/efi_client/efi_app.c +++ b/lib/efi_client/efi_app.c @@ -185,6 +185,14 @@ static void find_protocols(struct efi_priv *priv) boot->locate_protocol(&guid, NULL, (void **)&priv->efi_dp_to_text); } +static void efi_exit(void) +{ + struct efi_priv *priv = efi_get_priv(); + + printf("U-Boot EFI exiting\n"); + priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL); +} + /** * efi_main() - Start an EFI image * @@ -237,18 +245,11 @@ efi_status_t EFIAPI efi_main(efi_handle_t image, gd = gd->new_gd; board_init_r(NULL, 0); free_memory(priv); + efi_exit(); return EFI_SUCCESS; } -static void efi_exit(void) -{ - struct efi_priv *priv = efi_get_priv(); - - printf("U-Boot EFI exiting\n"); - priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL); -} - static int efi_sysreset_request(struct udevice *dev, enum sysreset_t type) { struct efi_priv *priv = efi_get_priv();