Index: firmware/lib/vboot_kernel.c |
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c |
index 83fb3fed31c61643d96756d0aafac27343d30a9c..e50fd0f6ab5713f6235e005eca82abef4345393c 100644 |
--- a/firmware/lib/vboot_kernel.c |
+++ b/firmware/lib/vboot_kernel.c |
@@ -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; |
} |