blob: d523384c113d3a7d922f50e872df0b65a85dc2dc [file] [log] [blame]
Vadim Bendeburyb86371b2015-05-27 18:16:19 -07001/*
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 Bendeburyf788ffb2015-06-05 12:57:27 -070010TPM_RC NvAddEvictObject(TPMI_DH_OBJECT evictHandle, // IN: new evict handle
11 OBJECT *object // IN: object to be added
Vadim Bendebury0d658a02015-05-29 22:55:38 -070012 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070013UINT32 NvCapGetCounterAvail(void);
14UINT32 NvCapGetCounterNumber(void);
15UINT32 NvCapGetIndexNumber(void);
16UINT32 NvCapGetPersistentAvail(void);
17UINT32 NvCapGetPersistentNumber(void);
Vadim Bendeburyda725062015-05-31 14:41:18 -070018void NvCheckState(void);
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070019BOOL NvCommit(void);
Vadim Bendebury76970b12015-05-31 18:40:37 -070020TPM_RC NvDefineIndex(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070021 TPMS_NV_PUBLIC *publicArea, // IN: A template for an area to create.
22 TPM2B_AUTH *authValue // IN: The initial authorization value
23 );
24void NvDeleteEntity(TPM_HANDLE handle // IN: handle of entity to be deleted
Vadim Bendebury0d658a02015-05-29 22:55:38 -070025 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070026void NvEntityStartup(STARTUP_TYPE type // IN: start up type
27 );
Vadim Bendebury59727bd2015-05-28 14:58:08 -070028void NvFlushHierarchy(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070029 TPMI_RH_HIERARCHY hierarchy // IN: hierarchy to be flushed.
30 );
31TPM_RC NvGetEvictObject(TPM_HANDLE handle, // IN: handle
32 OBJECT *object // OUT: object data
33 );
34void 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 Bendebury889ec832015-05-26 17:11:06 -070039 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070040void NvGetIndexInfo(TPMI_RH_NV_INDEX handle, // IN: handle
41 NV_INDEX *nvIndex // OUT: NV index structure
42 );
43void 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 );
47UINT16 NvGetName(TPMI_RH_NV_INDEX handle, // IN: handle of the index
48 NAME *name // OUT: name of the index
Vadim Bendebury889ec832015-05-26 17:11:06 -070049 );
Vadim Bendeburybbd79002015-05-31 14:44:07 -070050TPMI_YES_NO NvCapGetIndex(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070051 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 Bendeburybbd79002015-05-31 14:44:07 -070055TPMI_YES_NO NvCapGetPersistent(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070056 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 );
60TPM_RC NvIndexIsAccessible(TPMI_RH_NV_INDEX handle, // IN: handle
61 TPM_CC commandCode // IN: the command
Vadim Bendebury889ec832015-05-26 17:11:06 -070062 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070063void NvInit(void);
64UINT64 NvInitialCounter(void);
65TPM_RC NvIsAvailable(void);
66BOOL NvIsOwnerPersistentHandle(TPM_HANDLE handle // IN: handle
Vadim Bendebury0d658a02015-05-29 22:55:38 -070067 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070068BOOL NvIsPlatformPersistentHandle(TPM_HANDLE handle // IN: handle
Vadim Bendebury0d658a02015-05-29 22:55:38 -070069 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070070BOOL NvIsUndefinedIndex(TPMI_RH_NV_INDEX handle // IN: handle
71 );
72BOOL NvPowerOn(void);
73void NvReadPersistent(void);
74void NvReadReserved(NV_RESERVE type, // IN: type of reserved data
75 void *buffer // OUT: buffer receives the data.
76 );
77void NvSetGlobalLock(void);
78void NvStateSave(void);
79TPM_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 );
85TPM_RC NvWriteIndexInfo(TPMI_RH_NV_INDEX handle, // IN: handle
86 NV_INDEX *nvIndex // IN: NV Index info to be written
87 );
88void NvWriteReserved(NV_RESERVE type, // IN: type of reserved data
89 void *buffer // IN: data buffer
Vadim Bendebury59727bd2015-05-28 14:58:08 -070090 );
Vadim Bendeburyda725062015-05-31 14:41:18 -070091
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070092#endif // __TPM2_NV_FP_H