OLD | NEW |
1 /* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010-2011 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 /* A lightweight TPM command library. | 6 /* A lightweight TPM command library. |
7 * | 7 * |
8 * The general idea is that TPM commands are array of bytes whose | 8 * The general idea is that TPM commands are array of bytes whose |
9 * fields are mostly compile-time constant. The goal is to build much | 9 * fields are mostly compile-time constant. The goal is to build much |
10 * of the commands at compile time (or build time) and change some of | 10 * of the commands at compile time (or build time) and change some of |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 uint32_t TlclLibInit(void) { | 94 uint32_t TlclLibInit(void) { |
95 return TlclStubInit(); | 95 return TlclStubInit(); |
96 } | 96 } |
97 | 97 |
98 uint32_t TlclStartup(void) { | 98 uint32_t TlclStartup(void) { |
99 VBDEBUG(("TPM: Startup\n")); | 99 VBDEBUG(("TPM: Startup\n")); |
100 return Send(tpm_startup_cmd.buffer); | 100 return Send(tpm_startup_cmd.buffer); |
101 } | 101 } |
102 | 102 |
| 103 uint32_t TlclSaveState(void) { |
| 104 VBDEBUG(("TPM: SaveState\n")); |
| 105 return Send(tpm_savestate_cmd.buffer); |
| 106 } |
| 107 |
103 uint32_t TlclResume(void) { | 108 uint32_t TlclResume(void) { |
104 VBDEBUG(("TPM: Resume\n")); | 109 VBDEBUG(("TPM: Resume\n")); |
105 return Send(tpm_resume_cmd.buffer); | 110 return Send(tpm_resume_cmd.buffer); |
106 } | 111 } |
107 | 112 |
108 uint32_t TlclSelfTestFull(void) { | 113 uint32_t TlclSelfTestFull(void) { |
109 VBDEBUG(("TPM: Self test full\n")); | 114 VBDEBUG(("TPM: Self test full\n")); |
110 return Send(tpm_selftestfull_cmd.buffer); | 115 return Send(tpm_selftestfull_cmd.buffer); |
111 } | 116 } |
112 | 117 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 Memcpy(&cmd, &tpm_getpermissions_cmd, sizeof(cmd)); | 323 Memcpy(&cmd, &tpm_getpermissions_cmd, sizeof(cmd)); |
319 ToTpmUint32(cmd.buffer + tpm_getpermissions_cmd.index, index); | 324 ToTpmUint32(cmd.buffer + tpm_getpermissions_cmd.index, index); |
320 result = TlclSendReceive(cmd.buffer, response, sizeof(response)); | 325 result = TlclSendReceive(cmd.buffer, response, sizeof(response)); |
321 if (result != TPM_SUCCESS) | 326 if (result != TPM_SUCCESS) |
322 return result; | 327 return result; |
323 | 328 |
324 nvdata = response + kTpmResponseHeaderLength + sizeof(size); | 329 nvdata = response + kTpmResponseHeaderLength + sizeof(size); |
325 FromTpmUint32(nvdata + kNvDataPublicPermissionsOffset, permissions); | 330 FromTpmUint32(nvdata + kNvDataPublicPermissionsOffset, permissions); |
326 return result; | 331 return result; |
327 } | 332 } |
OLD | NEW |