Home | History | Annotate | Download | only in tpm2
      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 
     10 TPM_RC NvAddEvictObject(TPMI_DH_OBJECT evictHandle,  // IN: new evict handle
     11                         OBJECT *object               // IN: object to be added
     12                         );
     13 UINT32 NvCapGetCounterAvail(void);
     14 UINT32 NvCapGetCounterNumber(void);
     15 UINT32 NvCapGetIndexNumber(void);
     16 UINT32 NvCapGetPersistentAvail(void);
     17 UINT32 NvCapGetPersistentNumber(void);
     18 void NvCheckState(void);
     19 BOOL NvCommit(void);
     20 TPM_RC NvDefineIndex(
     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
     25                     );
     26 void NvEntityStartup(STARTUP_TYPE type  // IN: start up type
     27                      );
     28 void NvFlushHierarchy(
     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
     39                     );
     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
     49                  );
     50 TPMI_YES_NO NvCapGetIndex(
     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     );
     55 TPMI_YES_NO NvCapGetPersistent(
     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
     62                            );
     63 void NvInit(void);
     64 UINT64 NvInitialCounter(void);
     65 TPM_RC NvIsAvailable(void);
     66 BOOL NvIsOwnerPersistentHandle(TPM_HANDLE handle  // IN: handle
     67                                );
     68 BOOL NvIsPlatformPersistentHandle(TPM_HANDLE handle  // IN: handle
     69                                   );
     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
     90                      );
     91 
     92 #endif  // __TPM2_NV_FP_H
     93