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

Side by Side Diff: src/platform/vboot_reference/utils/rollback_index.c

Issue 1239006: Add another missing header to remove compile time error. (Closed)
Patch Set: Created 10 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
« 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 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 <stdint.h> 11 #include <stdint.h>
12 #include <stdio.h>
12 #include <tss/tcs.h> 13 #include <tss/tcs.h>
13 14
14 #include "tlcl.h" 15 #include "tlcl.h"
15 16
16 uint16_t g_firmware_key_version = 0; 17 uint16_t g_firmware_key_version = 0;
17 uint16_t g_firmware_version = 0; 18 uint16_t g_firmware_version = 0;
18 uint16_t g_kernel_key_version = 0; 19 uint16_t g_kernel_key_version = 0;
19 uint16_t g_kernel_version = 0; 20 uint16_t g_kernel_version = 0;
20 21
21 static void InitializeSpaces(void) { 22 static void InitializeSpaces(void) {
22 uint16_t zero = 0; 23 uint16_t zero = 0;
23 uint32_t perm = TPM_NV_PER_WRITE_STCLEAR | TPM_NV_PER_PPWRITE; 24 uint32_t perm = TPM_NV_PER_WRITE_STCLEAR | TPM_NV_PER_PPWRITE;
24 25
25 printf("Initializing spaces\n"); 26 fprintf(stderr, "Initializing spaces\n");
26 TlclSetNvLocked(); /* useful only the first time */ 27 TlclSetNvLocked(); /* useful only the first time */
27 28
28 TlclDefineSpace(FIRMWARE_KEY_VERSION_NV_INDEX, perm, sizeof(uint16_t)); 29 TlclDefineSpace(FIRMWARE_KEY_VERSION_NV_INDEX, perm, sizeof(uint16_t));
29 TlclWrite(FIRMWARE_KEY_VERSION_NV_INDEX, (uint8_t*) &zero, sizeof(uint16_t)); 30 TlclWrite(FIRMWARE_KEY_VERSION_NV_INDEX, (uint8_t*) &zero, sizeof(uint16_t));
30 31
31 TlclDefineSpace(FIRMWARE_VERSION_NV_INDEX, perm, sizeof(uint16_t)); 32 TlclDefineSpace(FIRMWARE_VERSION_NV_INDEX, perm, sizeof(uint16_t));
32 TlclWrite(FIRMWARE_VERSION_NV_INDEX, (uint8_t*) &zero, sizeof(uint16_t)); 33 TlclWrite(FIRMWARE_VERSION_NV_INDEX, (uint8_t*) &zero, sizeof(uint16_t));
33 34
34 TlclDefineSpace(KERNEL_KEY_VERSION_NV_INDEX, perm, sizeof(uint16_t)); 35 TlclDefineSpace(KERNEL_KEY_VERSION_NV_INDEX, perm, sizeof(uint16_t));
35 TlclWrite(KERNEL_KEY_VERSION_NV_INDEX, (uint8_t*) &zero, sizeof(uint16_t)); 36 TlclWrite(KERNEL_KEY_VERSION_NV_INDEX, (uint8_t*) &zero, sizeof(uint16_t));
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 TlclWriteLock(FIRMWARE_VERSION_NV_INDEX); 140 TlclWriteLock(FIRMWARE_VERSION_NV_INDEX);
140 break; 141 break;
141 case KERNEL_KEY_VERSION: 142 case KERNEL_KEY_VERSION:
142 TlclWriteLock(KERNEL_KEY_VERSION_NV_INDEX); 143 TlclWriteLock(KERNEL_KEY_VERSION_NV_INDEX);
143 break; 144 break;
144 case KERNEL_VERSION: 145 case KERNEL_VERSION:
145 TlclWriteLock(KERNEL_VERSION_NV_INDEX); 146 TlclWriteLock(KERNEL_VERSION_NV_INDEX);
146 break; 147 break;
147 } 148 }
148 } 149 }
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