From 02d929bfb25af22171dbd100f38ffd8fa6bf6238 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Jan 2023 08:52:40 -0600 Subject: bootstd: Support creating a boot menu Create an expo to handle the boot menu. For now this is quite simple, with just a header, some menu items and a pointer to show the current one. Signed-off-by: Simon Glass --- include/bootflow.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include') diff --git a/include/bootflow.h b/include/bootflow.h index 8a07ab30191..e7a09568f1b 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -9,6 +9,9 @@ #include +struct bootstd_priv; +struct expo; + /** * enum bootflow_state_t - states that a particular bootflow can be in * @@ -336,4 +339,24 @@ int bootflow_iter_uses_network(const struct bootflow_iter *iter); */ int bootflow_iter_uses_system(const struct bootflow_iter *iter); +/** + * bootflow_menu_new() - Create a new bootflow menu + * + * @expp: Returns the expo created + * Returns 0 on success, -ve on error + */ +int bootflow_menu_new(struct expo **expp); + +/** + * bootflow_menu_run() - Create and run a menu of available bootflows + * + * @std: Bootstd information + * @text_mode: Uses a text-based menu suitable for a serial port + * @bflowp: Returns chosen bootflow (set to NULL if nothing is chosen) + * @return 0 if an option was chosen, -EAGAIN if nothing was chosen, -ve on + * error + */ +int bootflow_menu_run(struct bootstd_priv *std, bool text_mode, + struct bootflow **bflowp); + #endif -- cgit v1.2.3