| 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 | 5 |
| 6 /* TPM Lightweight Command Library. | 6 /* TPM Lightweight Command Library. |
| 7 * | 7 * |
| 8 * A low-level library for interfacing to TPM hardware or an emulator. | 8 * A low-level library for interfacing to TPM hardware or an emulator. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 /* Sets the log level. 0 is quietest. | 62 /* Sets the log level. 0 is quietest. |
| 63 */ | 63 */ |
| 64 void TlclSetLogLevel(int level); | 64 void TlclSetLogLevel(int level); |
| 65 | 65 |
| 66 /* Sends a TPM_Startup(ST_CLEAR). Note that this is a no-op for the emulator, | 66 /* Sends a TPM_Startup(ST_CLEAR). Note that this is a no-op for the emulator, |
| 67 * because it runs this command during initialization. | 67 * because it runs this command during initialization. |
| 68 */ | 68 */ |
| 69 void TlclStartup(void); | 69 void TlclStartup(void); |
| 70 | 70 |
| 71 /* Run the self test. Note---this is synchronous. To run this in parallel | 71 /* Runs the self test. Note---this is synchronous. To run this in parallel |
| 72 * with other firmware, use ContinueSelfTest. | 72 * with other firmware, use ContinueSelfTest. |
| 73 */ | 73 */ |
| 74 void TlclSelftestfull(void); | 74 void TlclSelftestfull(void); |
| 75 | 75 |
| 76 /* Runs the self test in the background. |
| 77 */ |
| 78 void TlclContinueSelfTest(void); |
| 79 |
| 76 /* Defines a space with permission [perm]. [index] is the index for the space, | 80 /* Defines a space with permission [perm]. [index] is the index for the space, |
| 77 * [size] the usable data size. Errors are ignored. | 81 * [size] the usable data size. Errors are ignored. |
| 78 */ | 82 */ |
| 79 void TlclDefineSpace(uint32_t index, uint32_t perm, uint32_t size); | 83 void TlclDefineSpace(uint32_t index, uint32_t perm, uint32_t size); |
| 80 | 84 |
| 85 /* Defines a space with permission [perm]. [index] is the index for the space, |
| 86 * [size] the usable data size. Returns the TPM error code. |
| 87 */ |
| 88 uint32_t TlclDefineSpaceResult(uint32_t index, uint32_t perm, uint32_t size); |
| 89 |
| 81 /* Writes [length] bytes of [data] to space at [index]. The TPM error code is | 90 /* Writes [length] bytes of [data] to space at [index]. The TPM error code is |
| 82 * returned (0 for success). | 91 * returned (0 for success). |
| 83 */ | 92 */ |
| 84 uint32_t TlclWrite(uint32_t index, uint8_t *data, uint32_t length); | 93 uint32_t TlclWrite(uint32_t index, uint8_t *data, uint32_t length); |
| 85 | 94 |
| 86 /* Reads [length] bytes from space at [index] into [data]. The TPM error code | 95 /* Reads [length] bytes from space at [index] into [data]. The TPM error code |
| 87 * is returned (0 for success). | 96 * is returned (0 for success). |
| 88 */ | 97 */ |
| 89 uint32_t TlclRead(uint32_t index, uint8_t *data, uint32_t length); | 98 uint32_t TlclRead(uint32_t index, uint8_t *data, uint32_t length); |
| 90 | 99 |
| 91 /* Write-locks space at [index]. | 100 /* Write-locks space at [index]. |
| 92 */ | 101 */ |
| 93 void TlclWriteLock(uint32_t index); | 102 void TlclWriteLock(uint32_t index); |
| 94 | 103 |
| 95 /* Read-locks space at [index]. | 104 /* Read-locks space at [index]. |
| 96 */ | 105 */ |
| 97 void TlclReadLock(uint32_t index); | 106 void TlclReadLock(uint32_t index); |
| 98 | 107 |
| 99 /* Asserts physical presence in software. | 108 /* Asserts physical presence in software. |
| 100 */ | 109 */ |
| 101 void TlclAssertPhysicalPresence(void); | 110 void TlclAssertPhysicalPresence(void); |
| 102 | 111 |
| 112 /* Asserts physical presence in software. Return error code. |
| 113 */ |
| 114 uint32_t TlclAssertPhysicalPresenceResult(void); |
| 115 |
| 103 /* Turns off physical presence and locks it off until next reboot. | 116 /* Turns off physical presence and locks it off until next reboot. |
| 104 */ | 117 */ |
| 105 uint32_t TlclLockPhysicalPresence(void); | 118 uint32_t TlclLockPhysicalPresence(void); |
| 106 | 119 |
| 107 /* Sets the nvLocked bit. | 120 /* Sets the nvLocked bit. |
| 108 */ | 121 */ |
| 109 void TlclSetNvLocked(void); | 122 void TlclSetNvLocked(void); |
| 110 | 123 |
| 111 /* Returns 1 if the TPM is owned, 0 otherwise. | 124 /* Returns 1 if the TPM is owned, 0 otherwise. |
| 112 */ | 125 */ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 125 int TlclSetDeactivated(uint8_t flag); | 138 int TlclSetDeactivated(uint8_t flag); |
| 126 | 139 |
| 127 /* Gets flags of interest. (Add more here as needed.) | 140 /* Gets flags of interest. (Add more here as needed.) |
| 128 */ | 141 */ |
| 129 int TlclGetFlags(uint8_t* disable, uint8_t* deactivated); | 142 int TlclGetFlags(uint8_t* disable, uint8_t* deactivated); |
| 130 | 143 |
| 131 /* Sets the bGlobalLock flag, which only a reboot can clear. | 144 /* Sets the bGlobalLock flag, which only a reboot can clear. |
| 132 */ | 145 */ |
| 133 uint32_t TlclSetGlobalLock(void); | 146 uint32_t TlclSetGlobalLock(void); |
| 134 | 147 |
| 148 /* Performs a TPM_Extend. |
| 149 */ |
| 150 uint32_t TlclExtend(int pcr_num, uint8_t* in_digest, uint8_t* out_digest); |
| 151 |
| 135 #endif /* TPM_LITE_TLCL_H_ */ | 152 #endif /* TPM_LITE_TLCL_H_ */ |
| OLD | NEW |