OLD | NEW |
1 /* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 * | 4 * |
5 * Functions for loading a kernel from disk. | 5 * Functions for loading a kernel from disk. |
6 * (Firmware portion) | 6 * (Firmware portion) |
7 */ | 7 */ |
8 | 8 |
9 #include "vboot_kernel.h" | 9 #include "vboot_kernel.h" |
10 | 10 |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 : VBSD_LKC_CHECK_NO_PARTITIONS); | 644 : VBSD_LKC_CHECK_NO_PARTITIONS); |
645 | 645 |
646 /* TODO: differentiate between finding an invalid kernel | 646 /* TODO: differentiate between finding an invalid kernel |
647 * (found_partitions>0) and not finding one at all. Right now we | 647 * (found_partitions>0) and not finding one at all. Right now we |
648 * treat them the same, and return LOAD_KERNEL_INVALID for both. */ | 648 * treat them the same, and return LOAD_KERNEL_INVALID for both. */ |
649 retval = LOAD_KERNEL_INVALID; | 649 retval = LOAD_KERNEL_INVALID; |
650 } | 650 } |
651 | 651 |
652 LoadKernelExit: | 652 LoadKernelExit: |
653 | 653 |
654 /* Save whether the good partition's key block was fully verified */ | |
655 VbNvSet(vnc, VBNV_FW_VERIFIED_KERNEL_KEY, good_partition_key_block_valid); | |
656 | |
657 /* Store recovery request, if any, then tear down non-volatile storage */ | 654 /* Store recovery request, if any, then tear down non-volatile storage */ |
658 VbNvSet(vnc, VBNV_RECOVERY_REQUEST, LOAD_KERNEL_RECOVERY == retval ? | 655 VbNvSet(vnc, VBNV_RECOVERY_REQUEST, LOAD_KERNEL_RECOVERY == retval ? |
659 recovery : VBNV_RECOVERY_NOT_REQUESTED); | 656 recovery : VBNV_RECOVERY_NOT_REQUESTED); |
660 VbNvTeardown(vnc); | 657 VbNvTeardown(vnc); |
661 | 658 |
662 if (shared) { | 659 if (shared) { |
663 if (shcall) | 660 if (shcall) |
664 shcall->return_code = (uint8_t)retval; | 661 shcall->return_code = (uint8_t)retval; |
665 | 662 |
666 /* Save whether the good partition's key block was fully verified */ | 663 /* Save whether the good partition's key block was fully verified */ |
667 if (good_partition_key_block_valid) | 664 if (good_partition_key_block_valid) |
668 shared->flags |= VBSD_KERNEL_KEY_VERIFIED; | 665 shared->flags |= VBSD_KERNEL_KEY_VERIFIED; |
669 | 666 |
670 /* Save timer values */ | 667 /* Save timer values */ |
671 shared->timer_load_kernel_enter = timer_enter; | 668 shared->timer_load_kernel_enter = timer_enter; |
672 shared->timer_load_kernel_exit = VbGetTimer(); | 669 shared->timer_load_kernel_exit = VbGetTimer(); |
673 /* Store how much shared data we used, if any */ | 670 /* Store how much shared data we used, if any */ |
674 params->shared_data_size = shared->data_used; | 671 params->shared_data_size = shared->data_used; |
675 } | 672 } |
676 | 673 |
677 return retval; | 674 return retval; |
678 } | 675 } |
OLD | NEW |