| OLD | NEW |
| 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 #ifndef VBOOT_REFERENCE_ROLLBACK_INDEX_H_ | 9 #ifndef VBOOT_REFERENCE_ROLLBACK_INDEX_H_ |
| 10 #define VBOOT_REFERENCE_ROLLBACK_INDEX_H_ | 10 #define VBOOT_REFERENCE_ROLLBACK_INDEX_H_ |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 Must send in developer flag | 82 Must send in developer flag |
| 83 If not recovery mode, wants kernel versions | 83 If not recovery mode, wants kernel versions |
| 84 Must send in developer and recovery flags | 84 Must send in developer and recovery flags |
| 85 */ | 85 */ |
| 86 | 86 |
| 87 /* These functions are callable from LoadFirmware(). They cannot use | 87 /* These functions are callable from LoadFirmware(). They cannot use |
| 88 * global variables. */ | 88 * global variables. */ |
| 89 | 89 |
| 90 /* Setup must be called. Pass developer_mode=nonzero if in developer | 90 /* Setup must be called. Pass developer_mode=nonzero if in developer |
| 91 * mode. */ | 91 * mode. */ |
| 92 /* TODO: use a 32-bit version instead of 2 version pieces */ | 92 uint32_t RollbackFirmwareSetup(int developer_mode, uint32_t* version); |
| 93 uint32_t RollbackFirmwareSetup(int developer_mode, uint16_t* key_version, | |
| 94 uint16_t* version); | |
| 95 | 93 |
| 96 /* Write may be called if the versions change */ | 94 /* Write may be called if the versions change */ |
| 97 /* TODO: use a 32-bit version instead of 2 version pieces */ | 95 uint32_t RollbackFirmwareWrite(uint32_t version); |
| 98 uint32_t RollbackFirmwareWrite(uint16_t key_version, uint16_t version); | |
| 99 | 96 |
| 100 /* Lock must be called */ | 97 /* Lock must be called */ |
| 101 uint32_t RollbackFirmwareLock(void); | 98 uint32_t RollbackFirmwareLock(void); |
| 102 | 99 |
| 103 /* These functions are callable from LoadKernel(). They may use global | 100 /* These functions are callable from LoadKernel(). They may use global |
| 104 * variables. */ | 101 * variables. */ |
| 105 | 102 |
| 106 /* Recovery may be called. If it is, this is the first time a | 103 /* Recovery may be called. If it is, this is the first time a |
| 107 * rollback function has been called this boot, so it needs to know if | 104 * rollback function has been called this boot, so it needs to know if |
| 108 * we're in developer mode. Pass developer_mode=nonzero if in developer | 105 * we're in developer mode. Pass developer_mode=nonzero if in developer |
| 109 * mode. */ | 106 * mode. */ |
| 110 uint32_t RollbackKernelRecovery(int developer_mode); | 107 uint32_t RollbackKernelRecovery(int developer_mode); |
| 111 | 108 |
| 112 /* Read and write may be called if not in developer mode. If called in | 109 /* Read and write may be called if not in developer mode. If called in |
| 113 * recovery mode, the effect is undefined. */ | 110 * recovery mode, the effect is undefined. */ |
| 114 /* TODO: use a 32-bit version instead of 2 version pieces */ | 111 uint32_t RollbackKernelRead(uint32_t* version); |
| 115 uint32_t RollbackKernelRead(uint16_t* key_version, uint16_t* version); | 112 uint32_t RollbackKernelWrite(uint32_t version); |
| 116 uint32_t RollbackKernelWrite(uint16_t key_version, uint16_t version); | |
| 117 | 113 |
| 118 /* Lock must be called. Internally, it's ignored in recovery mode. */ | 114 /* Lock must be called. Internally, it's ignored in recovery mode. */ |
| 119 uint32_t RollbackKernelLock(void); | 115 uint32_t RollbackKernelLock(void); |
| 120 | 116 |
| 121 /* The following functions are here for testing only. */ | 117 /* The following functions are here for testing only. */ |
| 122 | 118 |
| 123 /* Issue a TPM_Clear and reenable/reactivate the TPM. */ | 119 /* Issue a TPM_Clear and reenable/reactivate the TPM. */ |
| 124 uint32_t TPMClearAndReenable(void); | 120 uint32_t TPMClearAndReenable(void); |
| 125 | 121 |
| 126 #endif /* VBOOT_REFERENCE_ROLLBACK_INDEX_H_ */ | 122 #endif /* VBOOT_REFERENCE_ROLLBACK_INDEX_H_ */ |
| OLD | NEW |