Vadim Bendebury | b86371b | 2015-05-27 18:16:19 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 The Chromium OS Authors. All rights reserved. |
| 3 | * Use of this source code is governed by a BSD-style license that can be |
| 4 | * found in the LICENSE file. |
| 5 | */ |
| 6 | |
| 7 | #ifndef __TPM2_NV_FP_H |
| 8 | #define __TPM2_NV_FP_H |
| 9 | |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 10 | TPM_RC NvAddEvictObject(TPMI_DH_OBJECT evictHandle, // IN: new evict handle |
| 11 | OBJECT *object // IN: object to be added |
Vadim Bendebury | 0d658a0 | 2015-05-29 22:55:38 -0700 | [diff] [blame] | 12 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 13 | UINT32 NvCapGetCounterAvail(void); |
| 14 | UINT32 NvCapGetCounterNumber(void); |
| 15 | UINT32 NvCapGetIndexNumber(void); |
| 16 | UINT32 NvCapGetPersistentAvail(void); |
| 17 | UINT32 NvCapGetPersistentNumber(void); |
Vadim Bendebury | da72506 | 2015-05-31 14:41:18 -0700 | [diff] [blame] | 18 | void NvCheckState(void); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 19 | BOOL NvCommit(void); |
Vadim Bendebury | 76970b1 | 2015-05-31 18:40:37 -0700 | [diff] [blame] | 20 | TPM_RC NvDefineIndex( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 21 | TPMS_NV_PUBLIC *publicArea, // IN: A template for an area to create. |
| 22 | TPM2B_AUTH *authValue // IN: The initial authorization value |
| 23 | ); |
| 24 | void NvDeleteEntity(TPM_HANDLE handle // IN: handle of entity to be deleted |
Vadim Bendebury | 0d658a0 | 2015-05-29 22:55:38 -0700 | [diff] [blame] | 25 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 26 | void NvEntityStartup(STARTUP_TYPE type // IN: start up type |
| 27 | ); |
Vadim Bendebury | 59727bd | 2015-05-28 14:58:08 -0700 | [diff] [blame] | 28 | void NvFlushHierarchy( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 29 | TPMI_RH_HIERARCHY hierarchy // IN: hierarchy to be flushed. |
| 30 | ); |
| 31 | TPM_RC NvGetEvictObject(TPM_HANDLE handle, // IN: handle |
| 32 | OBJECT *object // OUT: object data |
| 33 | ); |
| 34 | void NvGetIndexData(TPMI_RH_NV_INDEX handle, // IN: handle |
| 35 | NV_INDEX *nvIndex, // IN: RAM image of index header |
| 36 | UINT32 offset, // IN: offset of NV data |
| 37 | UINT16 size, // IN: size of NV data |
| 38 | void *data // OUT: data buffer |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 39 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 40 | void NvGetIndexInfo(TPMI_RH_NV_INDEX handle, // IN: handle |
| 41 | NV_INDEX *nvIndex // OUT: NV index structure |
| 42 | ); |
| 43 | void NvGetIntIndexData(TPMI_RH_NV_INDEX handle, // IN: handle |
| 44 | NV_INDEX *nvIndex, // IN: RAM image of NV Index header |
| 45 | UINT64 *data // IN: UINT64 pointer for counter or bit |
| 46 | ); |
| 47 | UINT16 NvGetName(TPMI_RH_NV_INDEX handle, // IN: handle of the index |
| 48 | NAME *name // OUT: name of the index |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 49 | ); |
Vadim Bendebury | bbd7900 | 2015-05-31 14:44:07 -0700 | [diff] [blame] | 50 | TPMI_YES_NO NvCapGetIndex( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 51 | TPMI_DH_OBJECT handle, // IN: start handle |
| 52 | UINT32 count, // IN: maximum number of returned handle |
| 53 | TPML_HANDLE *handleList // OUT: list of handle |
| 54 | ); |
Vadim Bendebury | bbd7900 | 2015-05-31 14:44:07 -0700 | [diff] [blame] | 55 | TPMI_YES_NO NvCapGetPersistent( |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 56 | TPMI_DH_OBJECT handle, // IN: start handle |
| 57 | UINT32 count, // IN: maximum number of returned handle |
| 58 | TPML_HANDLE *handleList // OUT: list of handle |
| 59 | ); |
| 60 | TPM_RC NvIndexIsAccessible(TPMI_RH_NV_INDEX handle, // IN: handle |
| 61 | TPM_CC commandCode // IN: the command |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 62 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 63 | void NvInit(void); |
| 64 | UINT64 NvInitialCounter(void); |
| 65 | TPM_RC NvIsAvailable(void); |
| 66 | BOOL NvIsOwnerPersistentHandle(TPM_HANDLE handle // IN: handle |
Vadim Bendebury | 0d658a0 | 2015-05-29 22:55:38 -0700 | [diff] [blame] | 67 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 68 | BOOL NvIsPlatformPersistentHandle(TPM_HANDLE handle // IN: handle |
Vadim Bendebury | 0d658a0 | 2015-05-29 22:55:38 -0700 | [diff] [blame] | 69 | ); |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 70 | BOOL NvIsUndefinedIndex(TPMI_RH_NV_INDEX handle // IN: handle |
| 71 | ); |
| 72 | BOOL NvPowerOn(void); |
| 73 | void NvReadPersistent(void); |
| 74 | void NvReadReserved(NV_RESERVE type, // IN: type of reserved data |
| 75 | void *buffer // OUT: buffer receives the data. |
| 76 | ); |
| 77 | void NvSetGlobalLock(void); |
| 78 | void NvStateSave(void); |
| 79 | TPM_RC NvWriteIndexData(TPMI_RH_NV_INDEX handle, // IN: handle |
| 80 | NV_INDEX *nvIndex, // IN: RAM copy of NV Index |
| 81 | UINT32 offset, // IN: offset of NV data |
| 82 | UINT32 size, // IN: size of NV data |
| 83 | void *data // OUT: data buffer |
| 84 | ); |
| 85 | TPM_RC NvWriteIndexInfo(TPMI_RH_NV_INDEX handle, // IN: handle |
| 86 | NV_INDEX *nvIndex // IN: NV Index info to be written |
| 87 | ); |
| 88 | void NvWriteReserved(NV_RESERVE type, // IN: type of reserved data |
| 89 | void *buffer // IN: data buffer |
Vadim Bendebury | 59727bd | 2015-05-28 14:58:08 -0700 | [diff] [blame] | 90 | ); |
Vadim Bendebury | da72506 | 2015-05-31 14:41:18 -0700 | [diff] [blame] | 91 | |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 92 | #endif // __TPM2_NV_FP_H |