From patchwork Wed Aug 20 14:46:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 86 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=1755701220; bh=QGuowB/43o4kQyaZdnwhJxBbrjiupWimHyB6Q4lmtUU=; 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=BAjNbqu1NrmUogA3BjoeWAj59wMvBq0sUWsHgALK4BXW5aFo+oLmnXOE2Rbj5ZjHm Daj6tNooQNr0pgSHSFKdpXzu5FwJK05QpQMA++r3zpUDRQWGZleqk8GxWYwfWjcdwl 9pQy0kI4h3W0FHqY/r30q4vCbvMdjq/SiNnemznkBrJRMslzckt7bSv8PJO+zUxnqR 6GVOzUSlVPPLVcVsJ4l3AZQ947cbnFMk1oOXRUg01O8JeyU7bkQz+cm4klSxQ6pXKo bp/8Mfzx79EqBQAmSVs9Z5lX7IRp0Pw4Ku6GYXMa50MRf3LRRG/Smm/acFc191luNt y/o+VR+Ru13kw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6B5416769C for ; Wed, 20 Aug 2025 08:47:00 -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 8JFwl-q1FtJN for ; Wed, 20 Aug 2025 08:47:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701220; bh=QGuowB/43o4kQyaZdnwhJxBbrjiupWimHyB6Q4lmtUU=; 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=BAjNbqu1NrmUogA3BjoeWAj59wMvBq0sUWsHgALK4BXW5aFo+oLmnXOE2Rbj5ZjHm Daj6tNooQNr0pgSHSFKdpXzu5FwJK05QpQMA++r3zpUDRQWGZleqk8GxWYwfWjcdwl 9pQy0kI4h3W0FHqY/r30q4vCbvMdjq/SiNnemznkBrJRMslzckt7bSv8PJO+zUxnqR 6GVOzUSlVPPLVcVsJ4l3AZQ947cbnFMk1oOXRUg01O8JeyU7bkQz+cm4klSxQ6pXKo bp/8Mfzx79EqBQAmSVs9Z5lX7IRp0Pw4Ku6GYXMa50MRf3LRRG/Smm/acFc191luNt y/o+VR+Ru13kw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3F9A967696 for ; Wed, 20 Aug 2025 08:47:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701217; bh=bVskN/s5pJGVnwD1J6W/lA42+FC6gyc/uaDVZzfET6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPgGnoCh8hbZJ8yc3t9uAknYxH44HRAuyLPLKz/wmlT0Hp0RcIO9BflF8ahKk4EvB 865vU5FU0H9mWTALmRg9KnfmcLbky/8tk4Zm+XOZWzya8d9639G12krrV75ekGgn53 PLq+l8doaQZ1I0DgZXAqBTM0Cr80uZTJlG1IY28dpLcx8xDVGEjqEKgJdP6+mUaKBz Sb9u/MFdDySBeNhraOA++oVppdjXcPDWA8U14iZWiY/2OzrYiu64HqLUvMSAwntlox PqJtMMJOBu0h3PGz1qlpAZGFAPZV15Mmb8OfwCvlbqokVntcaVeke1EFCX/H9dUj/3 8BXaQ5E8EJ4+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9F9CA676A1; Wed, 20 Aug 2025 08:46:57 -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 B6oxWZ61zRiQ; Wed, 20 Aug 2025 08:46:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701209; bh=sVpWwmWuhZPyLY6SIdm1nhSatblcXSBoDuHhUBGF9ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KeILtu1oXQAbu2FZ9yz0FF3Mh56mEEy30I3htDoST1JKX8owbEFAQGHkmGtEYB8YS ZPaEKq+YQwjjtlV2k1yI+8THJncQG11F8LkCIqyCzNL23h8wzO23Kr/82yBfhbe1Pf Xig3tVdSSJ3P/WQk4QIQD7tjb2Bbl+QWNdwbWkcOA8XolFmbYiwR7dzwZm4Cv6wl8p lcE2jQbeHkoFiT+MSHBMm1pMUnHBnRyNOPR3OrZp0iKywi7UZsxc5k8vOaF8uPi9e9 Fx1/qw+iCCKQFVvfWrNM7gZ9/9SnmKYYynDxKWfAi3SVRVBnJnaSkWskq9E6UWiDkw 6BPdDZP2bUSAg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4BBFF676A4; Wed, 20 Aug 2025 08:46:49 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:10 -0600 Message-ID: <20250820144621.1073679-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7U2S5BMMGZG2GZI6SN2D7KE637IEFY55 X-Message-ID-Hash: 7U2S5BMMGZG2GZI6SN2D7KE637IEFY55 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/14] efi: Update efidebug dh to work with 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 Make use of the boot-time services rather than internal functions, so that the app can implement this command. Signed-off-by: Simon Glass --- cmd/efidebug.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index cec4165a5e1..dee0fc7efc2 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -464,15 +464,14 @@ static int do_efi_show_drivers(struct cmd_tbl *cmdtp, int flag, static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { + struct efi_boot_services *boot = efi_get_boot(); efi_handle_t *handles; efi_guid_t **guid; efi_uintn_t num, count, i, j; efi_status_t ret; - if (app_not_supported("show_handles")) - return CMD_RET_FAILURE; - - ret = efi_locate_handle_buffer(ALL_HANDLES, NULL, NULL, &num, &handles); + ret = boot->locate_handle_buffer(ALL_HANDLES, NULL, NULL, &num, + &handles); if (ret != EFI_SUCCESS) return CMD_RET_FAILURE; @@ -486,19 +485,20 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, * not U-Boot */ efi_handle_t handle = handles[i]; - struct efi_handler *handler; + void *iface; printf("\n%p", handle); if (!IS_ENABLED(CONFIG_EFI_APP) && handle->dev) printf(" (%s)", handle->dev->name); printf("\n"); /* Print device path */ - ret = efi_search_protocol(handle, &efi_guid_device_path, - &handler); - if (ret == EFI_SUCCESS) - printf(" %pD\n", handler->protocol_interface); - ret = efi_get_boot()->protocols_per_handle(handle, &guid, - &count); + ret = boot->handle_protocol(handle, &efi_guid_device_path, + &iface); + if (!ret) + printf(" %pD\n", iface); + else + printf(" (no device-path)\n"); + ret = boot->protocols_per_handle(handle, &guid, &count); /* Print other protocols */ for (j = 0; j < count; j++) { if (guidcmp(guid[j], &efi_guid_device_path))