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

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

Issue 2809037: Make vboot_reference build in MSVC command line environment. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Integrated trunk changes. Created 10 years, 6 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/vboot_struct.h ('k') | firmware/lib/vboot_kernel.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 uint16_t g_firmware_key_version = 0; 15 uint16_t g_firmware_key_version = 0;
16 uint16_t g_firmware_version = 0; 16 uint16_t g_firmware_version = 0;
17 uint16_t g_kernel_key_version = 0; 17 uint16_t g_kernel_key_version = 0;
18 uint16_t g_kernel_version = 0; 18 uint16_t g_kernel_version = 0;
19 19
20 /* disable MSVC warning on const logical expression (as in } while(0);) */
21 __pragma(warning (disable: 4127))
22
20 #define RETURN_ON_FAILURE(tpm_command) do { \ 23 #define RETURN_ON_FAILURE(tpm_command) do { \
21 uint32_t result; \ 24 uint32_t result; \
22 if ((result = (tpm_command)) != TPM_SUCCESS) { \ 25 if ((result = (tpm_command)) != TPM_SUCCESS) { \
23 return result; \ 26 return result; \
24 } \ 27 } \
25 } while (0) 28 } while (0)
26 29
27 static uint32_t TPMClearAndReenable() { 30 static uint32_t TPMClearAndReenable() {
28 RETURN_ON_FAILURE(TlclForceClear()); 31 RETURN_ON_FAILURE(TlclForceClear());
29 RETURN_ON_FAILURE(TlclSetEnable()); 32 RETURN_ON_FAILURE(TlclSetEnable());
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 } 365 }
363 366
364 uint32_t LockFirmwareVersions() { 367 uint32_t LockFirmwareVersions() {
365 return TlclSetGlobalLock(); 368 return TlclSetGlobalLock();
366 } 369 }
367 370
368 uint32_t LockKernelVersionsByLockingPP() { 371 uint32_t LockKernelVersionsByLockingPP() {
369 return TlclLockPhysicalPresence(); 372 return TlclLockPhysicalPresence();
370 } 373 }
371 374
372 375 /* disable MSVC warnings on unused arguments */
376 __pragma(warning (disable: 4100))
373 377
374 /* NEW APIS! HELP ME LUIGI, YOU'RE MY ONLY HOPE! */ 378 /* NEW APIS! HELP ME LUIGI, YOU'RE MY ONLY HOPE! */
375 379
376 uint32_t RollbackFirmwareSetup(int developer_mode, 380 uint32_t RollbackFirmwareSetup(int developer_mode,
377 uint16_t* key_version, uint16_t* version) { 381 uint16_t* key_version, uint16_t* version) {
378 return TPM_SUCCESS; 382 return TPM_SUCCESS;
379 } 383 }
380 384
381 uint32_t RollbackFirmwareWrite(uint16_t key_version, uint16_t version) { 385 uint32_t RollbackFirmwareWrite(uint16_t key_version, uint16_t version) {
382 return TPM_SUCCESS; 386 return TPM_SUCCESS;
(...skipping 11 matching lines...) Expand all
394 return TPM_SUCCESS; 398 return TPM_SUCCESS;
395 } 399 }
396 400
397 uint32_t RollbackKernelWrite(uint16_t key_version, uint16_t version) { 401 uint32_t RollbackKernelWrite(uint16_t key_version, uint16_t version) {
398 return TPM_SUCCESS; 402 return TPM_SUCCESS;
399 } 403 }
400 404
401 uint32_t RollbackKernelLock(void) { 405 uint32_t RollbackKernelLock(void) {
402 return TPM_SUCCESS; 406 return TPM_SUCCESS;
403 } 407 }
OLDNEW
« no previous file with comments | « firmware/lib/include/vboot_struct.h ('k') | firmware/lib/vboot_kernel.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698