diff options
author | Masahisa Kojima | 2022-04-28 17:09:45 +0900 |
---|---|---|
committer | Heinrich Schuchardt | 2022-05-07 23:17:26 +0200 |
commit | 3ae6cf5400ee004c309f73f358c1043cf6d8eecc (patch) | |
tree | e26fc87f501b266147b4de02149ad1d995a94a44 /include/menu.h | |
parent | 6ae494831d13e96e5bc82b70c8061f5771219c3c (diff) |
bootmenu: factor out the user input handling
This commit moves the user input handling from cmd/bootmenu.c
to common/menu.c to reuse it from other modules.
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'include/menu.h')
-rw-r--r-- | include/menu.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/menu.h b/include/menu.h index ad5859437ea..e74616cae87 100644 --- a/include/menu.h +++ b/include/menu.h @@ -35,4 +35,24 @@ int menu_default_choice(struct menu *m, void **choice); */ int menu_show(int bootdelay); +struct bootmenu_data { + int delay; /* delay for autoboot */ + int active; /* active menu entry */ + int count; /* total count of menu entries */ + struct bootmenu_entry *first; /* first menu entry */ +}; + +enum bootmenu_key { + KEY_NONE = 0, + KEY_UP, + KEY_DOWN, + KEY_SELECT, + KEY_QUIT, +}; + +void bootmenu_autoboot_loop(struct bootmenu_data *menu, + enum bootmenu_key *key, int *esc); +void bootmenu_loop(struct bootmenu_data *menu, + enum bootmenu_key *key, int *esc); + #endif /* __MENU_H__ */ |