Added timing data to VbSharedData.

Change-Id: I8d52765227fd3355431bebc77dfbe0106c889eca

BUG=chrome-os-partner:2748
TEST=compiles; will be porting to H2C next

Review URL: http://codereview.chromium.org/6672068
This commit is contained in:
Randall Spangler
2011-03-16 19:07:33 -07:00
parent 06fbb168ac
commit ad6824ba4f
5 changed files with 53 additions and 9 deletions

View File

@@ -141,6 +141,7 @@ int LoadKernel(LoadKernelParams* params) {
int retval = LOAD_KERNEL_RECOVERY;
int recovery = VBNV_RECOVERY_RO_UNSPECIFIED;
uint64_t timer_enter = VbGetTimer();
/* Setup NV storage */
VbNvSetup(vnc);
@@ -155,6 +156,11 @@ int LoadKernel(LoadKernelParams* params) {
goto LoadKernelExit;
}
/* Clear output params in case we fail */
params->partition_number = 0;
params->bootloader_address = 0;
params->bootloader_size = 0;
/* Handle test errors */
VbNvGet(vnc, VBNV_TEST_ERROR_FUNC, &test_err);
if (VBNV_TEST_ERROR_LOAD_KERNEL == test_err) {
@@ -206,11 +212,6 @@ int LoadKernel(LoadKernelParams* params) {
dev_switch = 0; /* Always do a fully verified boot */
}
/* Clear output params in case we fail */
params->partition_number = 0;
params->bootloader_address = 0;
params->bootloader_size = 0;
if (kBootRecovery == boot_mode) {
/* Initialize the shared data structure, since LoadFirmware() didn't do it
* for us. */
@@ -556,9 +557,13 @@ LoadKernelExit:
recovery : VBNV_RECOVERY_NOT_REQUESTED);
VbNvTeardown(vnc);
/* Store how much shared data we used, if any */
if (shared)
if (shared) {
/* Save timer values */
shared->timer_load_kernel_enter = timer_enter;
shared->timer_load_kernel_exit = VbGetTimer();
/* Store how much shared data we used, if any */
params->shared_data_size = shared->data_used;
}
return retval;
}