Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Side by Side Diff: utility/tpmc.c

Issue 6719005: Cherry-pick vboot_reference files from TOT to support crossystem (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@0.11.257.B
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utility/tlcl_generator.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * TPM command utility. Runs simple TPM commands. Mostly useful when physical 5 * TPM command utility. Runs simple TPM commands. Mostly useful when physical
6 * presence has not been locked. 6 * presence has not been locked.
7 * 7 *
8 * The exit code is 0 for success, the TPM error code for TPM errors, and 255 8 * The exit code is 0 for success, the TPM error code for TPM errors, and 255
9 * for other errors. 9 * for other errors.
10 */ 10 */
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 HandlerWrite }, 283 HandlerWrite },
284 { "read", "read", "read from a space (read <index> <size>)", 284 { "read", "read", "read from a space (read <index> <size>)",
285 HandlerRead }, 285 HandlerRead },
286 { "getpermissions", "getp", "print space permissions (getp <index>)", 286 { "getpermissions", "getp", "print space permissions (getp <index>)",
287 HandlerGetPermissions }, 287 HandlerGetPermissions },
288 { "getpermanentflags", "getpf", "print all permanent flags", 288 { "getpermanentflags", "getpf", "print all permanent flags",
289 HandlerGetPermanentFlags }, 289 HandlerGetPermanentFlags },
290 { "getstclearflags", "getvf", "print all volatile (ST_CLEAR) flags", 290 { "getstclearflags", "getvf", "print all volatile (ST_CLEAR) flags",
291 HandlerGetSTClearFlags }, 291 HandlerGetSTClearFlags },
292 { "resume", "res", "execute TPM_Startup(ST_STATE)", TlclResume }, 292 { "resume", "res", "execute TPM_Startup(ST_STATE)", TlclResume },
293 { "savestate", "save", "execute TPM_SaveState", TlclSaveState },
293 }; 294 };
294 295
295 static int n_commands = sizeof(command_table) / sizeof(command_table[0]); 296 static int n_commands = sizeof(command_table) / sizeof(command_table[0]);
296 297
297 int main(int argc, char* argv[]) { 298 int main(int argc, char* argv[]) {
298 if (argc < 2) { 299 if (argc < 2) {
299 fprintf(stderr, "usage: %s <TPM command> [args]\n or: %s help\n", 300 fprintf(stderr, "usage: %s <TPM command> [args]\n or: %s help\n",
300 argv[0], argv[0]); 301 argv[0], argv[0]);
301 return OTHER_ERROR; 302 return OTHER_ERROR;
302 } else { 303 } else {
(...skipping 16 matching lines...) Expand all
319 if (strcmp(cmd, c->name) == 0 || strcmp(cmd, c->abbr) == 0) { 320 if (strcmp(cmd, c->name) == 0 || strcmp(cmd, c->abbr) == 0) {
320 return ErrorCheck(c->handler(), cmd); 321 return ErrorCheck(c->handler(), cmd);
321 } 322 }
322 } 323 }
323 324
324 /* No command matched. */ 325 /* No command matched. */
325 fprintf(stderr, "%s: unknown command: %s\n", argv[0], cmd); 326 fprintf(stderr, "%s: unknown command: %s\n", argv[0], cmd);
326 return OTHER_ERROR; 327 return OTHER_ERROR;
327 } 328 }
328 } 329 }
OLDNEW
« no previous file with comments | « utility/tlcl_generator.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698