diff options
Diffstat (limited to 'firmware/2lib/include/2api.h')
-rw-r--r-- | firmware/2lib/include/2api.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index b6c9bea4..649ee096 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -1269,6 +1269,8 @@ enum vb2_screen { VB2_SCREEN_ADVANCED_OPTIONS = 0x120, /* Language selection screen */ VB2_SCREEN_LANGUAGE_SELECT = 0x130, + /* Debug info */ + VB2_SCREEN_DEBUG_INFO = 0x140, /* First recovery screen to select recovering from disk or phone */ VB2_SCREEN_RECOVERY_SELECT = 0x200, /* Invalid recovery media inserted */ @@ -1297,6 +1299,8 @@ enum vb2_ui_error { VB2_UI_ERROR_NONE = 0, /* Dev mode already enabled */ VB2_UI_ERROR_DEV_MODE_ALREADY_ENABLED, + /* Debug info screen initialization failed */ + VB2_UI_ERROR_DEBUG_LOG, }; /** @@ -1310,6 +1314,9 @@ enum vb2_ui_error { * indicates whether item 'idx' is disabled. * @param timer_disabled Whether timer is disabled or not. Some screen * descriptions will depend on this value. + * @param current_page Current page number for a log screen. If the + * screen doesn't show logs, this value will be + * ignored. * @param error_code Error code if an error occurred. * @return VB2_SUCCESS, or error code on error. */ @@ -1318,6 +1325,7 @@ vb2_error_t vb2ex_display_ui(enum vb2_screen screen, uint32_t selected_item, uint32_t disabled_item_mask, int timer_disabled, + uint32_t current_page, enum vb2_ui_error error_code); /** @@ -1354,6 +1362,44 @@ void vb2ex_msleep(uint32_t msec); */ void vb2ex_beep(uint32_t msec, uint32_t frequency); +/** + * Get the full debug info string. + * + * Return a pointer to the full debug info string which is guaranteed to be + * null-terminated. The function implementation should manage string memory + * internally. Subsequent calls may update the string and return the same + * pointer, or return a new pointer if necessary. + * + * @param ctx Vboot context + * @return The pointer to the full debug info string. NULL on error. + */ +const char *vb2ex_get_debug_info(struct vb2_context *ctx); + +/** + * Get the vboot debug info. + * + * Return a pointer to the vboot debug info string which is guaranteed to be + * null-terminated. The caller owns the string and should call free() when + * finished with it. + * + * @param ctx Vboot context + * @return The pointer to the vboot debug info string. NULL on error. + */ +char *vb2api_get_debug_info(struct vb2_context *ctx); + +/** + * Specify the string to be used for an upcoming log screen display. + * + * Before a vb2ex_display_ui() call is made for a screen which displays logs, + * the log string should be provided via this function. The total number of + * pages in the log string is returned. If the log string ever changes, this + * function should be called again before the next vb2ex_display_ui() call. + * + * @param str The log string to display. + * @return The number of pages after pagination. 0 if none or error. + */ +uint32_t vb2ex_prepare_log_screen(const char *str); + /*****************************************************************************/ /* Timer. */ |