[PATCH v3 09/11] efi_loader: move efi_main and command loop to efi_app_common
Simon Glass
sjg at chromium.org
Wed Jul 1 14:00:47 CEST 2026
On 2026-06-28T08:27:58, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
> efi_loader: move efi_main and command loop to efi_app_common
>
> Add the remaining shared code to efi_app_common to complete the
> refactoring:
>
> * efi_main() - common entry point; calls efi_app_init(), prints
> app_banner, calls command_loop(), then clears the screen on exit.
> * struct efi_app_cmd - table entry holding the keyword, help text,
> and a handler of type void (*fn)(u16 *args).
> * command_loop() - iterates app_cmds[], matches keywords with
> starts_with(), and falls back to efi_app_help() on no match.
> * efi_app_help() - prints each table entry's help line plus the
> built-in 'exit' line.
>
> Each dump app is updated accordingly:
> * efi_main is removed; command_loop becomes non-static.
> * app_banner[] is defined at file scope with the application's
> title string.
> * Per-app duplicate state (bs, handle, systable) is removed; apps
> now use the common module's state.
> [...]
>
> lib/efi_loader/dbginfodump.c | 100 +++++++---------------------------
> lib/efi_loader/dtbdump.c | 109 ++++++++-----------------------------
> lib/efi_loader/efi_app_common.c | 108 ++++++++++++++++++++++++++++++++++-
> lib/efi_loader/efi_app_common.h | 38 +++++++++----
> lib/efi_loader/initrddump.c | 95 ++++++--------------------------
> lib/efi_loader/smbiosdump.c | 116 ++++++++++------------------------------
> 6 files changed, 222 insertions(+), 344 deletions(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list