tpmtest_earlynvram.c 643 B

123456789101112131415161718192021222324252627282930
  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
  3. * found in the LICENSE file.
  4. */
  5. /* Test of early writing to the NVRAM.
  6. */
  7. #include <stdio.h>
  8. #include <stdint.h>
  9. #include <stdlib.h>
  10. #include "tlcl.h"
  11. #include "tlcl_tests.h"
  12. #include "utility.h"
  13. #define INDEX0 0xcafe
  14. int main(int argc, char** argv) {
  15. uint32_t x;
  16. TlclLibInit();
  17. TPM_CHECK(TlclStartup());
  18. TPM_CHECK(TlclContinueSelfTest());
  19. TPM_CHECK(TlclAssertPhysicalPresence());
  20. TPM_CHECK(TlclRead(INDEX0, (uint8_t*) &x, sizeof(x)));
  21. printf("TEST SUCCEEDED\n");
  22. return 0;
  23. }