diff options
author | Aaron Durbin <adurbin@chromium.org> | 2015-10-06 17:29:03 -0500 |
---|---|---|
committer | Aaron Durbin <adurbin@gmail.com> | 2015-10-11 23:55:55 +0000 |
commit | b5a20b29b7a2709b120e3c8258c2f16d9c38b590 (patch) | |
tree | f7d2538122d8a16ce730362992454e9a326f6ff0 /src/vendorcode/google/chromeos/vboot2/vboot_logic.c | |
parent | e957832b2a4c880fae15c74b998630d5c5125890 (diff) |
vboot: restructure vboot work buffer handling
For the purpose of isolating the work buffer logic
the surface area of the API was slimmed down. The
vb2_working_data structure is no longer exposed,
and the function signatures are updated accordingly.
BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built and booted glados.
Change-Id: If64184a79e9571ee8ef9822cfce1eda20fceee00
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11818
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/vendorcode/google/chromeos/vboot2/vboot_logic.c')
-rw-r--r-- | src/vendorcode/google/chromeos/vboot2/vboot_logic.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/src/vendorcode/google/chromeos/vboot2/vboot_logic.c b/src/vendorcode/google/chromeos/vboot2/vboot_logic.c index 76355ecdab..0767454db4 100644 --- a/src/vendorcode/google/chromeos/vboot2/vboot_logic.c +++ b/src/vendorcode/google/chromeos/vboot2/vboot_logic.c @@ -209,22 +209,6 @@ static uint32_t extend_pcrs(struct vb2_context *ctx) tpm_extend_pcr(ctx, 1, HWID_DIGEST_PCR); } -static void init_vb2_working_data(void) -{ - struct vb2_working_data *wd; - size_t work_size; - - work_size = vb2_working_data_size(); - wd = vboot_get_working_data(); - memset(wd, 0, work_size); - /* - * vboot prefers 16-byte alignment. This takes away 16 bytes - * from the VBOOT2_WORK region, but the vboot devs said that's okay. - */ - wd->buffer_offset = ALIGN_UP(sizeof(*wd), 16); - wd->buffer_size = work_size - wd->buffer_offset; -} - /** * Verify and select the firmware in the RW image * @@ -235,16 +219,12 @@ void verstage_main(void) { struct vb2_context ctx; struct region_device fw_main; - struct vb2_working_data *wd; int rv; - init_vb2_working_data(); - wd = vboot_get_working_data(); + timestamp_add_now(TS_START_VBOOT); /* Set up context and work buffer */ - memset(&ctx, 0, sizeof(ctx)); - ctx.workbuf = vboot_get_work_buffer(wd); - ctx.workbuf_size = wd->buffer_size; + vb2_init_work_context(&ctx); /* Read nvdata from a non-volatile storage */ read_vbnv(ctx.nvdata); @@ -347,6 +327,6 @@ void verstage_main(void) } printk(BIOS_INFO, "Slot %c is selected\n", is_slot_a(&ctx) ? 'A' : 'B'); - vb2_set_selected_region(wd, &fw_main); + vb2_set_selected_region(&fw_main); timestamp_add_now(TS_END_VBOOT); } |