On 2026-06-28T08:27:58, Heinrich Schuchardt <[email protected]> wrote: > efi_loader: add efi_app_common skeleton > > The EFI dump applications (acpidump, dbginfodump, dtbdump, initrddump, > smbiosdump) each contain duplicate copies of the same output and > input helpers, and each has its own command loop. This patch series > deduplicates that code by introducing a shared module. > > Create lib/efi_loader/efi_app_common.c and efi_app_common.h to hold > utilities shared across the EFI dump applications. > > This first patch adds the module skeleton: > > * State variables (app_handle, cout, bs, nocolor, systable) owned by > the common module. (Removing bs, handle, systable duplication in > the apps is left to a later patch.) > * efi_app_init() to initialize them from sys_table and image_handle, > including detecting the 'nocolor' load option via get_load_options() > and starts_with(). > * Output helpers: print(), printx(), color(), cls(), error(). > * starts_with() - test whether a UTF-16 string begins with a keyword. > [...] > > lib/efi_loader/Makefile | 13 +++- > lib/efi_loader/dbginfodump.c | 43 +------------ > lib/efi_loader/dtbdump.c | 133 > ++-------------------------------------- > lib/efi_loader/efi_app_common.c | 106 ++++++++++++++++++++++++++++++++ > lib/efi_loader/efi_app_common.h | 67 ++++++++++++++++++++ > lib/efi_loader/initrddump.c | 126 +------------------------------------ > lib/efi_loader/smbiosdump.c | 100 +----------------------------- > 7 files changed, 196 insertions(+), 392 deletions(-)
Reviewed-by: Simon Glass <[email protected]>

