From patchwork Thu Aug 28 02:07:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 150 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=1756346882; bh=0+1bUYbU4ECedm3fYYzMy4Sh/OO4a+KdpISucIrI7T4=; 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=wk/8rUVr8JO2SvWahudALCnvEcODIyTwCoORgCYcLh1H4bncC7eQfqkkDyck+Nego iUrKW0ybrCp02GR1zo/+UwPd0/ndvj8IDkpvhKPEftfJ09C/q9cC2yBWH3jsacfNdl mVQIJOC5JgfeLZ8K9iDOwphiFd/Gwd3CdLpynu3+RKNnnkcHoXDf0UWJZ+LpoLOG+u CkgIhBfHgZb+dD0A5ULvlzeLtcYDKV+RSD/FHaeeX/YKRQqyfIveicugFmb7iuWTdn T0xsKwfEkwl26FVxMgZekMwSoBW/64oVXPaKt3gDGwp8UiEiOf1KqsaWbliz+8o981 UhKKvvoWyxYKA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6287867823 for ; Wed, 27 Aug 2025 20:08:02 -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 L_s0yAkcbbkk for ; Wed, 27 Aug 2025 20:08:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346882; bh=0+1bUYbU4ECedm3fYYzMy4Sh/OO4a+KdpISucIrI7T4=; 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=wk/8rUVr8JO2SvWahudALCnvEcODIyTwCoORgCYcLh1H4bncC7eQfqkkDyck+Nego iUrKW0ybrCp02GR1zo/+UwPd0/ndvj8IDkpvhKPEftfJ09C/q9cC2yBWH3jsacfNdl mVQIJOC5JgfeLZ8K9iDOwphiFd/Gwd3CdLpynu3+RKNnnkcHoXDf0UWJZ+LpoLOG+u CkgIhBfHgZb+dD0A5ULvlzeLtcYDKV+RSD/FHaeeX/YKRQqyfIveicugFmb7iuWTdn T0xsKwfEkwl26FVxMgZekMwSoBW/64oVXPaKt3gDGwp8UiEiOf1KqsaWbliz+8o981 UhKKvvoWyxYKA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 46D32677CB for ; Wed, 27 Aug 2025 20:08:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346879; bh=UENNzyBI1NdVP2V+pIZf5H2m+pgNANidKXUlaBQ14Uw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RSez+pz5GnbZv5IdQMPMhXLwIDcin9ZESlKrrh7vSuLrqtx2R82LwFYtwpyLrFjtR lFLDJA4MtZhrf3pMoqISHEjyVLVT4Ctm4BhdbE4Px15wVilAd9iqHDvUBu8e/bjzQj MP5ezdZA3Nb7nG8YT70FbNwZAR/hDjEfEnnv1kc2Ik9JX9EkBPgv++JFjLWp0XiHKe sMoskQ4dIisKj1BItDncZunfvogP7H8DvmtwUKPNPSEiiCo8fim8gdcRPRb7qNVaxD KsS/Ti9ji39oRgA0pOIvlQFfkn/wBaxEBzQfNrIzE5uXbHDm5jP3DO6oyFeYrkA4ar OrrI2yJYvm2GA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CEC566780C; Wed, 27 Aug 2025 20:07:59 -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 aQ9iqxbNuyoo; Wed, 27 Aug 2025 20:07:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346876; bh=WOXsOV6STCKaXYQiPkS8oMgxlErU+wE6DgRGdDpstyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ekdiMDTVATKzq2/6DqU28JFVDxfS2cyjcqY6WOBceN6ZPZMvRxkYFLunlwkniotLT EO2yoQeHtE58MClBnNzcQ6Ivg/lV6ISToklcs325QuDbCL/AxaE/BUaFINt41uFtqK LQfM1BPJi9z/7oL0hPd+C2f+ZrQXiqUCuTe5ZHIbTDFi+xUGGDach/Iab9xlDRVc4Y w/evSdkLpcAsKoxQ1GW3Cpo7RLxM+iOKPbKOTPCGaCl7Y1LYdJ06+6Gp8KJ4wXLrPo m7QGQfXbvtk5VIp4V5EGcnqQEK1QpmyxBw531REKPzvGwK0j5IglX6dLqMCdimC2J3 vZttzyftrkFJA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9B7D767829; Wed, 27 Aug 2025 20:07:56 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 27 Aug 2025 20:07:11 -0600 Message-ID: <20250828020732.981415-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828020732.981415-1-sjg@u-boot.org> References: <20250828020732.981415-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4IC72EU6OIHP5P5C4SQ4YZ4LLBBPKWEQ X-Message-ID-Hash: 4IC72EU6OIHP5P5C4SQ4YZ4LLBBPKWEQ 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 08/20] efi: Implement efidebug show drivers in the app 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 Adjust the code slightly to support the final subcommand in efidebug that is currently unavailable in the app: 'efidebug drivers'. Drop the now-unused app_not_supported() function. Signed-off-by: Simon Glass --- cmd/efidebug.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 9c0b6b084cb..f88da42c2c4 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -28,16 +28,6 @@ #include #include -static bool app_not_supported(const char *cmd) -{ - if (!IS_ENABLED(CONFIG_EFI_APP)) - return false; - - printf("Command '%s' is not yet supported in the app\n", cmd); - - return true; -} - #ifdef CONFIG_EFI_HAVE_CAPSULE_SUPPORT /** * do_efi_capsule_update() - process a capsule update @@ -372,7 +362,7 @@ static const char sep[] = "================"; static int efi_get_driver_handle_info(efi_handle_t handle, u16 **driver_name, u16 **image_path) { - struct efi_handler *handler; + struct efi_boot_services *boot = efi_get_boot(); struct efi_loaded_image *image; efi_status_t ret; @@ -383,13 +373,13 @@ static int efi_get_driver_handle_info(efi_handle_t handle, u16 **driver_name, *driver_name = NULL; /* image name */ - ret = efi_search_protocol(handle, &efi_guid_loaded_image, &handler); + ret = boot->handle_protocol(handle, &efi_guid_loaded_image, + (void **)&image); if (ret != EFI_SUCCESS) { *image_path = NULL; return 0; } - image = handler->protocol_interface; *image_path = efi_dp_str(image->file_path); return 0; @@ -410,17 +400,15 @@ static int efi_get_driver_handle_info(efi_handle_t handle, u16 **driver_name, static int do_efi_show_drivers(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { + struct efi_boot_services *boot = efi_get_boot(); efi_handle_t *handles; efi_uintn_t num, i; u16 *driver_name, *image_path_text; efi_status_t ret; - if (app_not_supported("show_drivers")) - return CMD_RET_FAILURE; - - ret = EFI_CALL(efi_locate_handle_buffer( - BY_PROTOCOL, &efi_guid_driver_binding_protocol, - NULL, &num, &handles)); + ret = boot->locate_handle_buffer(BY_PROTOCOL, + &efi_guid_driver_binding_protocol, + NULL, &num, &handles); if (ret != EFI_SUCCESS) return CMD_RET_FAILURE;