summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-05-02 08:46:27 -0600
committerSimon Glass <[email protected]>2025-05-30 09:49:32 +0100
commitb991a0c8bf30095837b096acd691e0d2add07b8c (patch)
treec747f676d09bc5838476b82cd30f613163d1529b /include
parent509852111422454117561c3d4aa4827270ca68d4 (diff)
expo: Split bootflow_menu_run() into two pieces
Split the starting piece of this function into bootflow_menu_start() and the polling part into bootflow_menu_poll() so that it is possible for the caller to be in control of the event loop. Move the expo_destroy() call into the caller. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/bootflow.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/include/bootflow.h b/include/bootflow.h
index fe090d39ffb..8244d4fca18 100644
--- a/include/bootflow.h
+++ b/include/bootflow.h
@@ -502,18 +502,6 @@ int bootflow_menu_new(struct expo **expp);
*/
int bootflow_menu_apply_theme(struct expo *exp, ofnode node);
-/**
- * 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, -EPIPE if nothing was chosen, -ve on
- * error
- */
-int bootflow_menu_run(struct bootstd_priv *std, bool text_mode,
- struct bootflow **bflowp);
-
#define BOOTFLOWCL_EMPTY ((void *)1)
/**
@@ -638,4 +626,25 @@ struct bootflow_img *bootflow_img_add(struct bootflow *bflow, const char *fname,
*/
int bootflow_get_seq(const struct bootflow *bflow);
+/**
+ * bootflow_menu_start() - Start up a menu for bootflows
+ *
+ * @std: bootstd information
+ * @text_mode: true to show the menu in text mode, false to use video display
+ * @expp: Returns the expo created, on success
+ * Return: 0 if OK, -ve on error
+ */
+int bootflow_menu_start(struct bootstd_priv *std, bool text_mode,
+ struct expo **expp);
+
+/**
+ * bootflow_menu_poll() - Poll a menu for user action
+ *
+ * @exp: Expo to poll
+ * @bflowp: Returns chosen bootflow (set to NULL if nothing is chosen)
+ * Return 0 if a bootflow was chosen, -EAGAIN if nothing is chosen yet, -EPIPE
+ * if the user quit
+ */
+int bootflow_menu_poll(struct expo *exp, struct bootflow **bflowp);
+
#endif