| 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 /* This program generates partially filled TPM datagrams and other compile-time | 6 /* This program generates partially filled TPM datagrams and other compile-time |
| 7 * constants (e.g. structure sizes and offsets). Compile this file---and ONLY | 7 * constants (e.g. structure sizes and offsets). Compile this file---and ONLY |
| 8 * this file---with -fpack-struct. We take advantage of the fact that the | 8 * this file---with -fpack-struct. We take advantage of the fact that the |
| 9 * (packed) TPM structures layout (mostly) match the TPM request and response | 9 * (packed) TPM structures layout (mostly) match the TPM request and response |
| 10 * datagram layout. When they don't completely match, some fixing is necessary | 10 * datagram layout. When they don't completely match, some fixing is necessary |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 int size = kTpmRequestHeaderLength + sizeof(TPM_PHYSICAL_PRESENCE); | 184 int size = kTpmRequestHeaderLength + sizeof(TPM_PHYSICAL_PRESENCE); |
| 185 Command* cmd = newCommand(TPM_ORD_Startup, size); | 185 Command* cmd = newCommand(TPM_ORD_Startup, size); |
| 186 cmd->name = "tpm_startup_cmd"; | 186 cmd->name = "tpm_startup_cmd"; |
| 187 AddInitializedField(cmd, kTpmRequestHeaderLength, | 187 AddInitializedField(cmd, kTpmRequestHeaderLength, |
| 188 sizeof(TPM_STARTUP_TYPE), | 188 sizeof(TPM_STARTUP_TYPE), |
| 189 TPM_ST_CLEAR); | 189 TPM_ST_CLEAR); |
| 190 return cmd; | 190 return cmd; |
| 191 } | 191 } |
| 192 | 192 |
| 193 Command* BuildSelftestfullCommand(void) { | 193 Command* BuildSelftestfullCommand(void) { |
| 194 int size = kTpmRequestHeaderLength + sizeof(TPM_PHYSICAL_PRESENCE); | 194 int size = kTpmRequestHeaderLength; |
| 195 Command* cmd = newCommand(TPM_ORD_SelfTestFull, size); | 195 Command* cmd = newCommand(TPM_ORD_SelfTestFull, size); |
| 196 cmd->name = "tpm_selftestfull_cmd"; | 196 cmd->name = "tpm_selftestfull_cmd"; |
| 197 return cmd; | 197 return cmd; |
| 198 } | 198 } |
| 199 | 199 |
| 200 Command* BuildReadPubekCommand(void) { | 200 Command* BuildReadPubekCommand(void) { |
| 201 int size = kTpmRequestHeaderLength + sizeof(TPM_NONCE); | 201 int size = kTpmRequestHeaderLength + sizeof(TPM_NONCE); |
| 202 Command* cmd = newCommand(TPM_ORD_ReadPubek, size); | 202 Command* cmd = newCommand(TPM_ORD_ReadPubek, size); |
| 203 cmd->name = "tpm_readpubek_cmd"; | 203 cmd->name = "tpm_readpubek_cmd"; |
| 204 return cmd; | 204 return cmd; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 commands = cmd; | 335 commands = cmd; |
| 336 } | 336 } |
| 337 | 337 |
| 338 printf("/* This file is automatically generated */\n\n"); | 338 printf("/* This file is automatically generated */\n\n"); |
| 339 OutputCommands(commands); | 339 OutputCommands(commands); |
| 340 printf("const int kWriteInfoLength = %d;\n", (int) sizeof(TPM_WRITE_INFO)); | 340 printf("const int kWriteInfoLength = %d;\n", (int) sizeof(TPM_WRITE_INFO)); |
| 341 | 341 |
| 342 FreeCommands(commands); | 342 FreeCommands(commands); |
| 343 return 0; | 343 return 0; |
| 344 } | 344 } |
| OLD | NEW |