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 <sjg@chromium.org>
diff --git a/include/bootflow.h b/include/bootflow.h
index 8a07ab3..e7a0956 100644
--- a/include/bootflow.h
+++ b/include/bootflow.h
@@ -9,6 +9,9 @@
#include <linux/list.h>
+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_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