Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: firmware/lib/vboot_kernel.c

Issue 6610023: Fix missing brackets (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 if (0 == kbuf_sectors) { 160 if (0 == kbuf_sectors) {
161 VBDEBUG(("LoadKernel() called with sector size > KBUF_SIZE\n")); 161 VBDEBUG(("LoadKernel() called with sector size > KBUF_SIZE\n"));
162 goto LoadKernelExit; 162 goto LoadKernelExit;
163 } 163 }
164 164
165 rec_switch = (BOOT_FLAG_RECOVERY & params->boot_flags ? 1 : 0); 165 rec_switch = (BOOT_FLAG_RECOVERY & params->boot_flags ? 1 : 0);
166 dev_switch = (BOOT_FLAG_DEVELOPER & params->boot_flags ? 1 : 0); 166 dev_switch = (BOOT_FLAG_DEVELOPER & params->boot_flags ? 1 : 0);
167 167
168 if (rec_switch) 168 if (rec_switch)
169 boot_mode = kBootRecovery; 169 boot_mode = kBootRecovery;
170 else if (BOOT_FLAG_DEV_FIRMWARE & params->boot_flags) 170 else if (BOOT_FLAG_DEV_FIRMWARE & params->boot_flags) {
171 if (!dev_switch) { 171 if (!dev_switch) {
172 /* Dev firmware should be signed such that it never boots with the dev 172 /* Dev firmware should be signed such that it never boots with the dev
173 * switch is off; so something is terribly wrong. */ 173 * switch is off; so something is terribly wrong. */
174 VBDEBUG(("LoadKernel() called with dev firmware but dev switch off\n")); 174 VBDEBUG(("LoadKernel() called with dev firmware but dev switch off\n"));
175 recovery = VBNV_RECOVERY_RW_DEV_MISMATCH; 175 recovery = VBNV_RECOVERY_RW_DEV_MISMATCH;
176 goto LoadKernelExit; 176 goto LoadKernelExit;
177 } 177 }
178 boot_mode = kBootDev; 178 boot_mode = kBootDev;
179 else { 179 } else {
180 /* Normal firmware */ 180 /* Normal firmware */
181 boot_mode = kBootNormal; 181 boot_mode = kBootNormal;
182 dev_switch = 0; /* Always do a fully verified boot */ 182 dev_switch = 0; /* Always do a fully verified boot */
183 } 183 }
184 184
185 /* Clear output params in case we fail */ 185 /* Clear output params in case we fail */
186 params->partition_number = 0; 186 params->partition_number = 0;
187 params->bootloader_address = 0; 187 params->bootloader_address = 0;
188 params->bootloader_size = 0; 188 params->bootloader_size = 0;
189 189
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 /* Save whether the good partition's key block was fully verified */ 500 /* Save whether the good partition's key block was fully verified */
501 VbNvSet(vnc, VBNV_FW_VERIFIED_KERNEL_KEY, good_partition_key_block_valid); 501 VbNvSet(vnc, VBNV_FW_VERIFIED_KERNEL_KEY, good_partition_key_block_valid);
502 502
503 /* Store recovery request, if any, then tear down non-volatile storage */ 503 /* Store recovery request, if any, then tear down non-volatile storage */
504 VbNvSet(vnc, VBNV_RECOVERY_REQUEST, LOAD_KERNEL_RECOVERY == retval ? 504 VbNvSet(vnc, VBNV_RECOVERY_REQUEST, LOAD_KERNEL_RECOVERY == retval ?
505 recovery : VBNV_RECOVERY_NOT_REQUESTED); 505 recovery : VBNV_RECOVERY_NOT_REQUESTED);
506 VbNvTeardown(vnc); 506 VbNvTeardown(vnc);
507 507
508 return retval; 508 return retval;
509 } 509 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698