diff options
author | edisonhello <edisonhello@google.com> | 2021-07-21 14:45:47 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-27 09:32:20 +0000 |
commit | 8fb3795bf355b8d33ed30b7aa9ad3be7804b4fb9 (patch) | |
tree | 7d374852d739f487a97c9d867ff1368873646324 /firmware | |
parent | 1c56856cd7199734aa86359ee17864d86f3a347f (diff) | |
download | vboot-8fb3795bf355b8d33ed30b7aa9ad3be7804b4fb9.tar.gz |
vboot/ui: Use vb2api_gbb_get_flags instead of vb2_get_gbb
Replace direct calls to vb2_get_gbb with vb2api_gbb_get_flags.
This is a preparation work for migrating ui codes from vboot to
depthcharge.
BUG=b:172339016
TEST=export CC=x86_64-pc-linux-gnu-clang DEBUG=1; \
make -j32 test_setup && make -j32 runtests;
TEST=Hayato booted into developer mode
BRANCH=none
Change-Id: I69b1504c236df1c0b656cb1e6e28a4066d9fad63
Signed-off-by: edisonhello <edisonhello@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3041504
Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/2lib/2ui.c | 3 | ||||
-rw-r--r-- | firmware/2lib/2ui_screens.c | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c index 71734507..8b2ebf45 100644 --- a/firmware/2lib/2ui.c +++ b/firmware/2lib/2ui.c @@ -28,7 +28,6 @@ */ vb2_error_t check_shutdown_request(struct vb2_ui_context *ui) { - struct vb2_gbb_header *gbb = vb2_get_gbb(ui->ctx); uint32_t shutdown_request = VbExIsShutdownRequested(); /* @@ -51,7 +50,7 @@ vb2_error_t check_shutdown_request(struct vb2_ui_context *ui) shutdown_request |= VB_SHUTDOWN_REQUEST_POWER_BUTTON; /* If desired, ignore shutdown request due to lid closure. */ - if (gbb->flags & VB2_GBB_FLAG_DISABLE_LID_SHUTDOWN) + if (vb2api_gbb_get_flags(ui->ctx) & VB2_GBB_FLAG_DISABLE_LID_SHUTDOWN) shutdown_request &= ~VB_SHUTDOWN_REQUEST_LID_CLOSED; /* diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c index d2716e32..a029d62b 100644 --- a/firmware/2lib/2ui_screens.c +++ b/firmware/2lib/2ui_screens.c @@ -688,7 +688,7 @@ vb2_error_t developer_mode_init(struct vb2_ui_context *ui) vb2api_get_dev_default_boot_target(ui->ctx); /* Don't show "Return to secure mode" button if GBB forces dev mode. */ - if (vb2_get_gbb(ui->ctx)->flags & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON) + if (vb2api_gbb_get_flags(ui->ctx) & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON) VB2_SET_BIT(ui->state->hidden_item_mask, DEVELOPER_MODE_ITEM_RETURN_TO_SECURE); @@ -846,7 +846,7 @@ static const struct vb2_screen_info developer_mode_screen = { static vb2_error_t developer_to_norm_init(struct vb2_ui_context *ui) { /* Don't allow to-norm if GBB forces dev mode */ - if (vb2_get_gbb(ui->ctx)->flags & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON) { + if (vb2api_gbb_get_flags(ui->ctx) & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON) { VB2_DEBUG("ERROR: to-norm not allowed\n"); return set_ui_error_and_go_back( ui, VB2_UI_ERROR_TO_NORM_NOT_ALLOWED); @@ -861,7 +861,7 @@ static vb2_error_t developer_to_norm_init(struct vb2_ui_context *ui) vb2_error_t developer_to_norm_action(struct vb2_ui_context *ui) { - if (vb2_get_gbb(ui->ctx)->flags & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON) { + if (vb2api_gbb_get_flags(ui->ctx) & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON) { VB2_DEBUG("ERROR: dev mode forced by GBB flag\n"); return VB2_SUCCESS; } |