summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2api.h
diff options
context:
space:
mode:
authorShelley Chen <shchen@google.com>2020-06-11 22:41:14 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-27 22:53:26 +0000
commit65d69f12712d262724edf1337c8055adc9edaa9d (patch)
treef4c9057b6b5cc21cd63d9790b56660a8791572a9 /firmware/2lib/include/2api.h
parent0776fb3aab035d32fd1148627953e2aedd08c987 (diff)
downloadvboot-65d69f12712d262724edf1337c8055adc9edaa9d.tar.gz
firmware/2lib: Add visual/audio error handling
Adding an enum parameter to vb2ex_display_ui to facilitate printing errors to the screen. Currently, errors are only printed to the serial console. Also adding in beep if an error is displayed. BUG=b:144969091,b:158635317,b:158639298,b:146399181 BRANCH=None TEST=Boot into dev warning screen and try to hit ctrl-u when no USB is plugged in. Ensure error beep occurs. Ensure in dev mode. Boot into recovery and press ctrl-d. Ensure that error message is printed to the screen and beep occurs. make runtests Cq-Depend: chromium:2243513 Change-Id: I548d624532ad8816497c37a726275b33171e28dc Signed-off-by: Shelley Chen <shchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2243196 Tested-by: Shelley Chen <shchen@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Shelley Chen <shchen@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2api.h')
-rw-r--r--firmware/2lib/include/2api.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 9131dea0..69fd1458 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -1234,21 +1234,36 @@ enum vb2_screen {
VB2_SCREEN_DEVELOPER_INVALID_DISK = 0x330,
};
+enum vb2_ui_error {
+ /* No error */
+ VB2_UI_ERROR_NONE = 0,
+ /* Dev mode already enabled */
+ VB2_UI_ERROR_DEV_MODE_ALREADY_ENABLED,
+ /* Dev mode internal boot not allowed */
+ VB2_UI_ERROR_DEV_INTERNAL_NOT_ALLOWED,
+ /* Dev mode external boot not allowed */
+ VB2_UI_ERROR_DEV_EXTERNAL_NOT_ALLOWED,
+ /* Dev mode external boot failed */
+ VB2_UI_ERROR_DEV_EXTERNAL_BOOT_FAILED,
+};
+
/**
* Display UI screen.
*
* @param screen Screen to display.
+ * @param locale_id Id of current locale.
* @param selected_item Index of the selected menu item. If the screen
* doesn't have a menu, this value will be ignored.
* @param disabled_item_mask Mask for disabled menu items. Bit (1 << idx)
* indicates whether item 'idx' is disabled.
- * @param locale_id Id of current locale.
+ * @param error_code Error code if an error occurred.
* @return VB2_SUCCESS, or error code on error.
*/
vb2_error_t vb2ex_display_ui(enum vb2_screen screen,
uint32_t locale_id,
uint32_t selected_item,
- uint32_t disabled_item_mask);
+ uint32_t disabled_item_mask,
+ enum vb2_ui_error error_code);
/**
* Check that physical presence button is currently pressed by the user.