mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
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>
This commit is contained in:
parent
6ae494831d
commit
3ae6cf5400
3 changed files with 148 additions and 141 deletions
|
@ -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__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue