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

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

Issue 2844044: added reboot return codes to load kernel and firmware (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: After remerge 2 Created 10 years, 5 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
« no previous file with comments | « firmware/lib/include/rollback_index.h ('k') | firmware/lib/vboot_firmware.c » ('j') | 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 querying, manipulating and locking rollback indices 5 * Functions for querying, manipulating and locking rollback indices
6 * stored in the TPM NVRAM. 6 * stored in the TPM NVRAM.
7 */ 7 */
8 8
9 #include "rollback_index.h" 9 #include "rollback_index.h"
10 10
11 #include "tlcl.h" 11 #include "tlcl.h"
12 #include "tss_constants.h" 12 #include "tss_constants.h"
13 #include "utility.h" 13 #include "utility.h"
14 14
15 static int g_rollback_recovery_mode = 0; 15 static int g_rollback_recovery_mode = 0;
16 16
17 /* disable MSVC warning on const logical expression (as in } while(0);) */ 17 /* disable MSVC warning on const logical expression (as in } while(0);) */
18 __pragma(warning (disable: 4127)) 18 __pragma(warning (disable: 4127))
19 19
20 #define RETURN_ON_FAILURE(tpm_command) do { \ 20 #define RETURN_ON_FAILURE(tpm_command) do { \
21 uint32_t result; \ 21 uint32_t result; \
22 if ((result = (tpm_command)) != TPM_SUCCESS) { \ 22 if ((result = (tpm_command)) != TPM_SUCCESS) { \
23 VBDEBUG(("Rollback: %08x returned by " #tpm_command "\n", (int)result)); \
23 return result; \ 24 return result; \
24 } \ 25 } \
25 } while (0) 26 } while (0)
26 27
27 uint32_t TPMClearAndReenable(void) { 28 uint32_t TPMClearAndReenable(void) {
28 RETURN_ON_FAILURE(TlclForceClear()); 29 RETURN_ON_FAILURE(TlclForceClear());
29 RETURN_ON_FAILURE(TlclSetEnable()); 30 RETURN_ON_FAILURE(TlclSetEnable());
30 RETURN_ON_FAILURE(TlclSetDeactivated(0)); 31 RETURN_ON_FAILURE(TlclSetDeactivated(0));
31 return TPM_SUCCESS; 32 return TPM_SUCCESS;
32 } 33 }
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 return TPM_SUCCESS; 343 return TPM_SUCCESS;
343 } 344 }
344 345
345 uint32_t RollbackKernelLock(void) { 346 uint32_t RollbackKernelLock(void) {
346 if (!g_rollback_recovery_mode) { 347 if (!g_rollback_recovery_mode) {
347 return TlclLockPhysicalPresence(); 348 return TlclLockPhysicalPresence();
348 } else { 349 } else {
349 return TPM_SUCCESS; 350 return TPM_SUCCESS;
350 } 351 }
351 } 352 }
OLDNEW
« no previous file with comments | « firmware/lib/include/rollback_index.h ('k') | firmware/lib/vboot_firmware.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698