From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 6/8] cmd: efishell: add dh command
Date: Tue, 25 Dec 2018 14:32:17 +0900 [thread overview]
Message-ID: <20181225053215.GA14405@linaro.org> (raw)
In-Reply-To: <b4b6217c-29f0-ec3f-5762-63bd2b8c32cd@gmx.de>
On Thu, Dec 20, 2018 at 08:49:25AM +0100, Heinrich Schuchardt wrote:
> On 12/18/18 6:05 AM, AKASHI Takahiro wrote:
> > "dh" command prints all the uefi handles used in the system.
> > => efishell dh
> > (T.B.D.)
> > 0: (protocol info not available)
> > 1: (protocol info not available)
> > 2: (protocol info not available)
> > 3: (protocol info not available)
> > 4: (protocol info not available)
> > 5: (protocol info not available)
> > 6: (protocol info not available)
> > 7: (protocol info not available)
> > 8: (protocol info not available)
> > 9: (protocol info not available)
> > 10: (protocol info not available)
> > 11: (protocol info not available)
> > 12: (protocol info not available)
> > 13: (protocol info not available)
> > 14: (protocol info not available)
> > 15: (protocol info not available)
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> > cmd/efishell.c | 33 ++++++++++++++++++++++++++++++++-
> > 1 file changed, 32 insertions(+), 1 deletion(-)
> >
> > diff --git a/cmd/efishell.c b/cmd/efishell.c
> > index 5a81a627d616..47ad77606062 100644
> > --- a/cmd/efishell.c
> > +++ b/cmd/efishell.c
> > @@ -511,6 +511,33 @@ static int do_efi_show_memmap(int argc, char * const argv[])
> > return CMD_RET_SUCCESS;
> > }
> >
> > +static char *efi_get_proto_info(efi_handle_t handle)
> > +{
> > + return strdup("(protocol info not available)");
> Shouldn't this enumerate all protocol GUIDs installed on the handles by
> calling ProtocolsPerHandle()?
Okay.
> Also instances of installed drivers identifiable by the driver binding
> protocol might be interesting.
Getting a driver name from driver binding protocol can be a bit hard.
See my reply to your comment on "efishell drivers."
Thanks,
-Takahiro Akashi
> Best regards
>
> Heinrich
>
> > +}
> > +
> > +static int do_efi_show_handles(int argc, char * const argv[])
> > +{
> > + efi_handle_t *handles = NULL, *handle;
> > + char *info;
> > + int i;
> > +
> > + handles = efi_get_handles_by_proto(NULL);
> > + if (!handles)
> > + return CMD_RET_SUCCESS;
> > +
> > + for (handle = handles, i = 0; *handle; handle++, i++) {
> > + /* TODO: depends on protocols */
> > + info = efi_get_proto_info(*handle);
> > + printf("%d: %s\n", i, info ?: "");
> > + free(info);
> > + }
> > +
> > + free(handles);
> > +
> > + return CMD_RET_SUCCESS;
> > +}
> > +
> > static int do_efi_boot_add(int argc, char * const argv[])
> > {
> > int id;
> > @@ -900,6 +927,8 @@ static int do_efishell(cmd_tbl_t *cmdtp, int flag,
> > return do_efi_show_images(argc, argv);
> > else if (!strcmp(command, "memmap"))
> > return do_efi_show_memmap(argc, argv);
> > + else if (!strcmp(command, "dh"))
> > + return do_efi_show_handles(argc, argv);
> > else
> > return CMD_RET_USAGE;
> > }
> > @@ -929,7 +958,9 @@ static char efishell_help_text[] =
> > "efishell images\n"
> > " - show loaded images\n"
> > "efishell memmap\n"
> > - " - show uefi memory map\n";
> > + " - show uefi memory map\n"
> > + "efishell dh\n"
> > + " - show uefi handles\n";
> > #endif
> >
> > U_BOOT_CMD(
> >
>
next prev parent reply other threads:[~2018-12-25 5:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 5:05 [U-Boot] [PATCH v3 0/8] cmd: add efishell for efi environment AKASHI Takahiro
2018-12-18 5:05 ` [U-Boot] [PATCH v3 1/8] cmd: add efishell command AKASHI Takahiro
2018-12-30 15:44 ` Heinrich Schuchardt
2018-12-30 17:10 ` Heinrich Schuchardt
2019-01-07 5:08 ` AKASHI Takahiro
2019-01-08 9:57 ` Alexander Graf
2019-01-07 5:06 ` AKASHI Takahiro
2018-12-30 23:47 ` Heinrich Schuchardt
2019-01-07 5:13 ` AKASHI Takahiro
2018-12-18 5:05 ` [U-Boot] [PATCH v3 2/8] cmd: efishell: add devices command AKASHI Takahiro
2018-12-18 5:05 ` [U-Boot] [PATCH v3 3/8] cmd: efishell: add drivers command AKASHI Takahiro
2018-12-20 7:51 ` Heinrich Schuchardt
2018-12-25 7:22 ` AKASHI Takahiro
2018-12-25 12:07 ` Heinrich Schuchardt
2018-12-18 5:05 ` [U-Boot] [PATCH v3 4/8] cmd: efishell: add images command AKASHI Takahiro
2018-12-18 5:05 ` [U-Boot] [PATCH v3 5/8] cmd: efishell: add memmap command AKASHI Takahiro
2018-12-18 5:05 ` [U-Boot] [PATCH v3 6/8] cmd: efishell: add dh command AKASHI Takahiro
2018-12-20 7:49 ` Heinrich Schuchardt
2018-12-25 5:32 ` AKASHI Takahiro [this message]
2018-12-18 5:05 ` [U-Boot] [PATCH v3 7/8] cmd: efishell: export uefi variable helper functions AKASHI Takahiro
2018-12-18 5:05 ` [U-Boot] [PATCH v3 8/8] cmd: env: add "-e" option for handling UEFI variables AKASHI Takahiro
2018-12-18 6:07 ` Heinrich Schuchardt
2018-12-19 1:49 ` AKASHI Takahiro
2018-12-19 12:23 ` Heinrich Schuchardt
2018-12-23 1:56 ` Alexander Graf
2018-12-25 8:44 ` AKASHI Takahiro
2018-12-26 21:20 ` Alexander Graf
2019-01-07 7:47 ` AKASHI Takahiro
2019-01-08 7:29 ` AKASHI Takahiro
2019-01-08 8:58 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181225053215.GA14405@linaro.org \
--to=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.