TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ps_nv_counters.h File Reference
#include <stdint.h>
#include "psa/protected_storage.h"
#include "tfm_plat_nv_counters.h"
Include dependency graph for ps_nv_counters.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TFM_PS_NV_COUNTER_1   PLAT_NV_COUNTER_0
 
#define TFM_PS_NV_COUNTER_2   PLAT_NV_COUNTER_1
 
#define TFM_PS_NV_COUNTER_3   PLAT_NV_COUNTER_2
 
#define PS_NV_COUNTER_SIZE   4 /* In bytes */
 

Functions

psa_status_t ps_read_nv_counter (enum tfm_nv_counter_t counter_id, uint32_t *val)
 Reads the given non-volatile (NV) counter. More...
 
psa_status_t ps_increment_nv_counter (enum tfm_nv_counter_t counter_id)
 Increments the given non-volatile (NV) counter. More...
 

Macro Definition Documentation

#define PS_NV_COUNTER_SIZE   4 /* In bytes */

Definition at line 27 of file ps_nv_counters.h.

#define TFM_PS_NV_COUNTER_1   PLAT_NV_COUNTER_0

Definition at line 23 of file ps_nv_counters.h.

#define TFM_PS_NV_COUNTER_2   PLAT_NV_COUNTER_1

Definition at line 24 of file ps_nv_counters.h.

#define TFM_PS_NV_COUNTER_3   PLAT_NV_COUNTER_2

Definition at line 25 of file ps_nv_counters.h.

Function Documentation

psa_status_t ps_increment_nv_counter ( enum tfm_nv_counter_t  counter_id)

Increments the given non-volatile (NV) counter.

Parameters
[in]counter_idNV counter ID.
Returns
If the counter is incremented correctly, it returns PSA_SUCCESS. Otherwise, PSA_ERROR_GENERIC_ERROR.

Definition at line 25 of file ps_nv_counters.c.

Here is the call graph for this function:

Here is the caller graph for this function:

psa_status_t ps_read_nv_counter ( enum tfm_nv_counter_t  counter_id,
uint32_t *  val 
)

Reads the given non-volatile (NV) counter.

Parameters
[in]counter_idNV counter ID.
[out]valPointer to store the current NV counter value.
Returns
PSA_SUCCESS if the value is read correctly, otherwise PSA_ERROR_GENERIC_ERROR

Definition at line 11 of file ps_nv_counters.c.

Here is the call graph for this function:

Here is the caller graph for this function: