From ccdd7948e22f21d2add8f51c4918a2c576dc5e91 Mon Sep 17 00:00:00 2001 From: Weijie Gao Date: Tue, 29 Oct 2024 17:47:16 +0800 Subject: menu: add support to check if menu needs to be reprinted This patch adds a new callback named need_reprint for menu. The need_reprint will be called before printing the menu. If the callback exists and returns FALSE, menu printing will be canceled. This is very useful if the menu was not changed. It can save time for serial-based menu to handle more input data. Signed-off-by: Weijie Gao Reviewed-by: Daniel Golle Tested-by: Daniel Golle --- cmd/bootmenu.c | 2 +- cmd/eficonfig.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 977a04b7d76..c99605f3398 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -506,7 +506,7 @@ static enum bootmenu_ret bootmenu_show(int delay) menu = menu_create(NULL, bootmenu->delay, 1, menu_display_statusline, bootmenu_print_entry, bootmenu_choice_entry, - bootmenu); + NULL, bootmenu); if (!menu) { bootmenu_destroy(bootmenu); return BOOTMENU_RET_FAIL; diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index 029180250f0..e08b6ba4a5d 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -443,7 +443,7 @@ efi_status_t eficonfig_process_common(struct efimenu *efi_menu, efi_menu->menu_desc = menu_desc; menu = menu_create(NULL, 0, 1, display_statusline, item_data_print, - item_choice, efi_menu); + item_choice, NULL, efi_menu); if (!menu) return EFI_INVALID_PARAMETER; -- cgit v1.2.3