// SPDX-License-Identifier: GPL-2.0+
/*
- * (C) Copyright 2011-2013 Pali Rohár <pali.rohar@gmail.com>
+ * (C) Copyright 2011-2013 Pali Rohár <pali@kernel.org>
*/
#include <common.h>
#include <command.h>
#include <ansi.h>
+#include <env.h>
+#include <log.h>
#include <menu.h>
#include <watchdog.h>
#include <malloc.h>
+#include <linux/delay.h>
#include <linux/string.h>
/* maximum bootmenu entries */
return NULL;
}
+static void menu_display_statusline(struct menu *m)
+{
+ struct bootmenu_entry *entry;
+ struct bootmenu_data *menu;
+
+ if (menu_default_choice(m, (void *)&entry) < 0)
+ return;
+
+ menu = entry->menu;
+
+ printf(ANSI_CURSOR_POSITION, 1, 1);
+ puts(ANSI_CLEAR_LINE);
+ printf(ANSI_CURSOR_POSITION, 2, 1);
+ puts(" *** U-Boot Boot Menu ***");
+ puts(ANSI_CLEAR_LINE_TO_END);
+ printf(ANSI_CURSOR_POSITION, 3, 1);
+ puts(ANSI_CLEAR_LINE);
+
+ /* First 3 lines are bootmenu header + 2 empty lines between entries */
+ printf(ANSI_CURSOR_POSITION, menu->count + 5, 1);
+ puts(ANSI_CLEAR_LINE);
+ printf(ANSI_CURSOR_POSITION, menu->count + 6, 1);
+ puts(" Press UP/DOWN to move, ENTER to select");
+ puts(ANSI_CLEAR_LINE_TO_END);
+ printf(ANSI_CURSOR_POSITION, menu->count + 7, 1);
+ puts(ANSI_CLEAR_LINE);
+}
+
static void bootmenu_show(int delay)
{
int init = 0;
if (!bootmenu)
return;
- menu = menu_create(NULL, bootmenu->delay, 1, bootmenu_print_entry,
- bootmenu_choice_entry, bootmenu);
+ menu = menu_create(NULL, bootmenu->delay, 1, menu_display_statusline,
+ bootmenu_print_entry, bootmenu_choice_entry,
+ bootmenu);
if (!menu) {
bootmenu_destroy(bootmenu);
return;
#endif
}
-void menu_display_statusline(struct menu *m)
-{
- struct bootmenu_entry *entry;
- struct bootmenu_data *menu;
-
- if (menu_default_choice(m, (void *)&entry) < 0)
- return;
-
- menu = entry->menu;
-
- printf(ANSI_CURSOR_POSITION, 1, 1);
- puts(ANSI_CLEAR_LINE);
- printf(ANSI_CURSOR_POSITION, 2, 1);
- puts(" *** U-Boot Boot Menu ***");
- puts(ANSI_CLEAR_LINE_TO_END);
- printf(ANSI_CURSOR_POSITION, 3, 1);
- puts(ANSI_CLEAR_LINE);
-
- /* First 3 lines are bootmenu header + 2 empty lines between entries */
- printf(ANSI_CURSOR_POSITION, menu->count + 5, 1);
- puts(ANSI_CLEAR_LINE);
- printf(ANSI_CURSOR_POSITION, menu->count + 6, 1);
- puts(" Press UP/DOWN to move, ENTER to select");
- puts(ANSI_CLEAR_LINE_TO_END);
- printf(ANSI_CURSOR_POSITION, menu->count + 7, 1);
- puts(ANSI_CLEAR_LINE);
-}
-
#ifdef CONFIG_AUTOBOOT_MENU_SHOW
int menu_show(int bootdelay)
{
}
#endif
-int do_bootmenu(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_bootmenu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *delay_str = NULL;
int delay = 10;