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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 #define assert(expr) do { if (!(expr)) { \ | 50 #define assert(expr) do { if (!(expr)) { \ |
51 error("assert fail: %s at %s:%d\n", \ | 51 error("assert fail: %s at %s:%d\n", \ |
52 #expr, __FILE__, __LINE__); }} while(0) | 52 #expr, __FILE__, __LINE__); }} while(0) |
53 | 53 |
54 /* Call this first. | 54 /* Call this first. |
55 */ | 55 */ |
56 void TlclLibInit(void); | 56 void TlclLibInit(void); |
57 | 57 |
| 58 /* Close and open the device. This is needed for running more complex commands |
| 59 * at user level, such as TPM_TakeOwnership, since the TPM device can be opened |
| 60 * only by one process at a time. |
| 61 */ |
| 62 void TlclCloseDevice(void); |
| 63 void TlclOpenDevice(void); |
| 64 |
58 /* Logs to stdout. Arguments like printf. | 65 /* Logs to stdout. Arguments like printf. |
59 */ | 66 */ |
60 void TlclLog(char* format, ...); | 67 void TlclLog(char* format, ...); |
61 | 68 |
62 /* Sets the log level. 0 is quietest. | 69 /* Sets the log level. 0 is quietest. |
63 */ | 70 */ |
64 void TlclSetLogLevel(int level); | 71 void TlclSetLogLevel(int level); |
65 | 72 |
66 /* Sends a TPM_Startup(ST_CLEAR). Note that this is a no-op for the emulator, | 73 /* Sends a TPM_Startup(ST_CLEAR). Note that this is a no-op for the emulator, |
67 * because it runs this command during initialization. The TPM error code is | 74 * because it runs this command during initialization. The TPM error code is |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 158 |
152 /* Performs a TPM_Extend. | 159 /* Performs a TPM_Extend. |
153 */ | 160 */ |
154 uint32_t TlclExtend(int pcr_num, uint8_t* in_digest, uint8_t* out_digest); | 161 uint32_t TlclExtend(int pcr_num, uint8_t* in_digest, uint8_t* out_digest); |
155 | 162 |
156 /* Gets the permission bits for the NVRAM space with |index|. | 163 /* Gets the permission bits for the NVRAM space with |index|. |
157 */ | 164 */ |
158 uint32_t TlclGetPermissions(uint32_t index, uint32_t* permissions); | 165 uint32_t TlclGetPermissions(uint32_t index, uint32_t* permissions); |
159 | 166 |
160 #endif /* TPM_LITE_TLCL_H_ */ | 167 #endif /* TPM_LITE_TLCL_H_ */ |
OLD | NEW |