| 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 |
| 11 #ifndef TPM_LITE_TLCL_H_ | 11 #ifndef TPM_LITE_TLCL_H_ |
| 12 #define TPM_LITE_TLCL_H_ | 12 #define TPM_LITE_TLCL_H_ |
| 13 | 13 |
| 14 #include <stdarg.h> | 14 #include <stdarg.h> |
| 15 #include <stdint.h> | 15 #include <stdint.h> |
| 16 #include <stdio.h> | 16 #include <stdio.h> |
| 17 #include <stdlib.h> | 17 #include <stdlib.h> |
| 18 | 18 |
| 19 #define POSSIBLY_UNUSED __attribute__((unused)) | 19 #define POSSIBLY_UNUSED __attribute__((unused)) |
| 20 | 20 |
| 21 #ifdef __STRICT_ANSI__ | 21 #ifdef __STRICT_ANSI__ |
| 22 #define INLINE | 22 #define INLINE |
| 23 #else | 23 #else |
| 24 #define INLINE inline | 24 #define INLINE inline |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 /* Outputs an error message and quits the program. | 27 /* Outputs an error message and quits the program. |
| 28 */ | 28 */ |
| 29 POSSIBLY_UNUSED |
| 29 static void error(const char *format, ...) { | 30 static void error(const char *format, ...) { |
| 30 va_list ap; | 31 va_list ap; |
| 31 va_start(ap, format); | 32 va_start(ap, format); |
| 32 fprintf(stderr, "ERROR: "); | 33 fprintf(stderr, "ERROR: "); |
| 33 vfprintf(stderr, format, ap); | 34 vfprintf(stderr, format, ap); |
| 34 va_end(ap); | 35 va_end(ap); |
| 35 exit(1); | 36 exit(1); |
| 36 } | 37 } |
| 37 | 38 |
| 38 /* Outputs a warning and continues. | 39 /* Outputs a warning and continues. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void TlclAssertPhysicalPresence(void); | 93 void TlclAssertPhysicalPresence(void); |
| 93 | 94 |
| 94 /* Sets the nvLocked bit. | 95 /* Sets the nvLocked bit. |
| 95 */ | 96 */ |
| 96 void TlclSetNvLocked(void); | 97 void TlclSetNvLocked(void); |
| 97 | 98 |
| 98 /* Returns 1 if the TPM is owned, 0 otherwise. | 99 /* Returns 1 if the TPM is owned, 0 otherwise. |
| 99 */ | 100 */ |
| 100 int TlclIsOwned(void); | 101 int TlclIsOwned(void); |
| 101 | 102 |
| 103 /* Issues a ForceClear. |
| 104 */ |
| 105 void TlclForceClear(void); |
| 106 |
| 107 /* Issues a PhysicalEnable. |
| 108 */ |
| 109 void TlclPhysicalEnable(void); |
| 110 |
| 111 /* Issues a PhysicalSetDeactivated. Pass 0 to activate. Returns result code. |
| 112 */ |
| 113 int TlclPhysicalSetDeactivated(uint8_t flag); |
| 114 |
| 115 /* Gets some permanent flags of interest. (Add more here as needed.) |
| 116 */ |
| 117 int TlclGetFlags(uint8_t* disable, uint8_t* deactivated); |
| 118 |
| 102 #endif /* TPM_LITE_TLCL_H_ */ | 119 #endif /* TPM_LITE_TLCL_H_ */ |
| OLD | NEW |