From nobody Fri Jan 14 13:42:10 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EC71E1940D11; Fri, 14 Jan 2022 13:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jb2Xh1l8gz50Vp; Fri, 14 Jan 2022 13:42:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642167732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxhroqzSuTv1ZcMc7rdsVpDQMX31QAUGAItYfR/CMTg=; b=PYP2PA+JcxU34rrcrc01uVozHbkqz2/kUtOvpT7rIvNnqpNU1xaa5gOapmMokWGvWfcnH6 W3iXW3X55bBpcU1F+KNCznNvRzCseZ/cUyFODrCMNhr+AqG146iluBHEEoc0rhQHAxT609 r7hVzheFP8ZAe9HnX5zQ3Q+opQYMFr0nx1RehKG4xV1YHkt0hiUKAUal21qm3ca1GmRy14 yU0wA64dM8XZZhyVQwfmm13Xtf2CQvHM57OVc7hUi/pmD36gVhFzSxgUcq5iSoHd87LnYC LkTp/cWN/ezken3iX20RW13mtIjSveTIPlaU+6XiCHq1+WLX18K6SB7FDg/drQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34CC214DD1; Fri, 14 Jan 2022 13:42:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20EDgAqN034415; Fri, 14 Jan 2022 13:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20EDgABP034414; Fri, 14 Jan 2022 13:42:10 GMT (envelope-from git) Date: Fri, 14 Jan 2022 13:42:10 GMT Message-Id: <202201141342.20EDgABP034414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 50af79ac2d71 - stable/13 - loader: lsefi: Print more information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 50af79ac2d711daf1c37aacfd1ef7cbb3b3f10a7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642167732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxhroqzSuTv1ZcMc7rdsVpDQMX31QAUGAItYfR/CMTg=; b=tSXmI8dN8/hOavIFVjNKZigLAL2bMEXtNWhebSyx+gefOXXpG5Qd3pTlACep0EtaOcDl4M WKN1OLH92FShsQgTWAWR6O3OzdvbYZbbLYh2QZj/yCYb5OMMK555663vr4ypkANR+Qby0K AdomzYlixfmbUhM/KfmhfjAXhn5Imb3JGZQkNwESBSrVQK5l4eT18v5gL3Cmh3HS+n2Zc9 vVMFnDcq9ybsN9Dt8NDqFRkDq1P5bDImnDiPqdxSqGVna+H/a2EWZ/y764D8fEoQUpn+7/ gRPw2O8u5f5acrBMUtzbgSyCIkQGZIk4SHb0WXBFiuqK2NsNHOlgjRVSYl8Cng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642167732; a=rsa-sha256; cv=none; b=GMyrBXbDb9eg91I+rqOSKSIaus43n69zeID9/6mha1tFF+zbEsgJiWBJuUo/ZObGV1JSga SKkIOnoZOr73bLX7toD/093z3ioKMv9Mv/P4jvJ/EehkLhaKmHkzxQI3FULiAul3YeVQbU ZU3x6uy+ajlw7ibABtr9YbB8PjJpEKkWd8m3mkw0Hurd9GlcPL+iN2wEZwM71zvrCONdbC FokRl6p+DLiTzPHNL6KlcHMD29Qt4qQbrSB0u8SCKihlZ81SRByQm0m+Pu6zapwLiTPS9O 254dae/ltBChopRSKP/e83cPpB3V/WLqdPhloXSDjQ5Aa2DsbN3omXfXfMXohw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=50af79ac2d711daf1c37aacfd1ef7cbb3b3f10a7 commit 50af79ac2d711daf1c37aacfd1ef7cbb3b3f10a7 Author: Emmanuel Vadot AuthorDate: 2021-11-15 11:12:50 +0000 Commit: Emmanuel Vadot CommitDate: 2022-01-14 13:38:25 +0000 loader: lsefi: Print more information Printing the EFI_HANDLE pointer isn't very useful. If the handle have a IMAGE_DEVICE_PATH or a DEVICE_PATH protocol print it. This makes it easier to see which devices are present and what protocol they expose. Reviewed by: imp, tsoome Differential Revision: https://reviews.freebsd.org/D32991 Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 2e0d67c3ed7ec760b2d54f8258304b2e6359418b) --- stand/efi/loader/main.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 97bdb7f31e97..a1a62381e45c 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -1378,6 +1378,30 @@ command_mode(int argc, char *argv[]) COMMAND_SET(lsefi, "lsefi", "list EFI handles", command_lsefi); +static void +lsefi_print_handle_info(EFI_HANDLE handle) +{ + EFI_DEVICE_PATH *devpath; + EFI_DEVICE_PATH *imagepath; + CHAR16 *dp_name; + + imagepath = efi_lookup_image_devpath(handle); + if (imagepath != NULL) { + dp_name = efi_devpath_name(imagepath); + printf("Handle for image %S", dp_name); + efi_free_devpath_name(dp_name); + return; + } + devpath = efi_lookup_devpath(handle); + if (devpath != NULL) { + dp_name = efi_devpath_name(devpath); + printf("Handle for device %S", dp_name); + efi_free_devpath_name(dp_name); + return; + } + printf("Handle %p", handle); +} + static int command_lsefi(int argc __unused, char *argv[] __unused) { @@ -1413,7 +1437,7 @@ command_lsefi(int argc __unused, char *argv[] __unused) EFI_GUID **protocols = NULL; handle = buffer[i]; - printf("Handle %p", handle); + lsefi_print_handle_info(handle); if (pager_output("\n")) break; /* device path */