summaryrefslogtreecommitdiff
path: root/cmd/eficonfig.c
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2023-01-06 08:52:26 -0600
committerTom Rini <[email protected]>2023-01-16 14:14:11 -0500
commit32bab0eae51b55898d1e2804e6614d9143840581 (patch)
tree67686cc8705aaf301695e8b66f50f613422b60b9 /cmd/eficonfig.c
parent86cc3c5215fc6e3c2cb77ee162c22ad91dbfaff5 (diff)
menu: Make use of CLI character processing
Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'cmd/eficonfig.c')
-rw-r--r--cmd/eficonfig.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index 96cb1a367f3..d830e4af53b 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -6,6 +6,7 @@
*/
#include <ansi.h>
+#include <cli.h>
#include <common.h>
#include <charset.h>
#include <efi_loader.h>
@@ -184,14 +185,16 @@ static void eficonfig_display_statusline(struct menu *m)
*/
static char *eficonfig_choice_entry(void *data)
{
- int esc = 0;
+ struct cli_ch_state s_cch, *cch = &s_cch;
struct list_head *pos, *n;
struct eficonfig_entry *entry;
enum bootmenu_key key = BKEY_NONE;
struct efimenu *efi_menu = data;
+ cli_ch_init(cch);
+
while (1) {
- key = bootmenu_loop((struct bootmenu_data *)efi_menu, &esc);
+ key = bootmenu_loop((struct bootmenu_data *)efi_menu, cch);
switch (key) {
case BKEY_UP:
@@ -1862,13 +1865,14 @@ static void eficonfig_display_change_boot_order(struct efimenu *efi_menu)
*/
static efi_status_t eficonfig_choice_change_boot_order(struct efimenu *efi_menu)
{
- int esc = 0;
+ struct cli_ch_state s_cch, *cch = &s_cch;
struct list_head *pos, *n;
enum bootmenu_key key = BKEY_NONE;
struct eficonfig_entry *entry, *tmp;
+ cli_ch_init(cch);
while (1) {
- key = bootmenu_loop(NULL, &esc);
+ key = bootmenu_loop(NULL, cch);
switch (key) {
case BKEY_PLUS: