summaryrefslogtreecommitdiff
path: root/firmware/lib/vboot_api_kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/lib/vboot_api_kernel.c')
-rw-r--r--firmware/lib/vboot_api_kernel.c33
1 files changed, 6 insertions, 27 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 4f0b3f20..7ad45929 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -7,10 +7,8 @@
#include "sysincludes.h"
-#include "gbb_access.h"
#include "gbb_header.h"
#include "load_kernel_fw.h"
-#include "region.h"
#include "rollback_index.h"
#include "utility.h"
#include "vboot_api.h"
@@ -99,7 +97,7 @@ uint32_t VbTryLoadKernel(VbCommonParams *cparams, LoadKernelParams *p,
p->disk_handle = disk_info[i].handle;
p->bytes_per_lba = disk_info[i].bytes_per_lba;
p->ending_lba = disk_info[i].lba_count - 1;
- retval = LoadKernel(p, cparams);
+ retval = LoadKernel(p);
VBDEBUG(("VbTryLoadKernel() LoadKernel() = %d\n", retval));
/*
@@ -175,7 +173,8 @@ VbError_t VbBootNormal(VbCommonParams *cparams, LoadKernelParams *p)
VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
{
- GoogleBinaryBlockHeader *gbb = cparams->gbb;
+ GoogleBinaryBlockHeader *gbb =
+ (GoogleBinaryBlockHeader *)cparams->gbb_data;
VbSharedDataHeader *shared =
(VbSharedDataHeader *)cparams->shared_data_blob;
uint32_t allow_usb = 0, allow_legacy = 0, ctrl_d_pressed = 0;
@@ -808,25 +807,13 @@ VbError_t VbEcSoftwareSync(VbCommonParams *cparams)
return VBERROR_SUCCESS;
}
-/* This function is also used by tests */
-void VbApiKernelFree(VbCommonParams *cparams)
-{
- /* VbSelectAndLoadKernel() always allocates this, tests don't */
- if (cparams->gbb) {
- VbExFree(cparams->gbb);
- cparams->gbb = NULL;
- }
- if (cparams->bmp) {
- VbExFree(cparams->bmp);
- cparams->bmp = NULL;
- }
-}
-
VbError_t VbSelectAndLoadKernel(VbCommonParams *cparams,
VbSelectAndLoadKernelParams *kparams)
{
VbSharedDataHeader *shared =
(VbSharedDataHeader *)cparams->shared_data_blob;
+ GoogleBinaryBlockHeader *gbb =
+ (GoogleBinaryBlockHeader *)cparams->gbb_data;
VbError_t retval = VBERROR_SUCCESS;
LoadKernelParams p;
uint32_t tpm_status = 0;
@@ -844,15 +831,9 @@ VbError_t VbSelectAndLoadKernel(VbCommonParams *cparams,
kparams->bootloader_size = 0;
Memset(kparams->partition_guid, 0, sizeof(kparams->partition_guid));
- cparams->bmp = NULL;
- cparams->gbb = VbExMalloc(sizeof(*cparams->gbb));
- retval = VbGbbReadHeader_static(cparams, cparams->gbb);
- if (VBERROR_SUCCESS != retval)
- goto VbSelectAndLoadKernel_exit;
-
/* Do EC software sync if necessary */
if ((shared->flags & VBSD_EC_SOFTWARE_SYNC) &&
- !(cparams->gbb->flags & GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC)) {
+ !(gbb->flags & GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC)) {
retval = VbEcSoftwareSync(cparams);
if (retval != VBERROR_SUCCESS)
goto VbSelectAndLoadKernel_exit;
@@ -1001,8 +982,6 @@ VbError_t VbSelectAndLoadKernel(VbCommonParams *cparams,
VbSelectAndLoadKernel_exit:
- VbApiKernelFree(cparams);
-
VbNvTeardown(&vnc);
if (vnc.raw_changed)
VbExNvStorageWrite(vnc.raw);