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

Go to the source code of this file.

Macros

#define TFM_PLATFORM_API_VERSION_MAJOR   (0)
 TFM secure partition platform API version. More...
 
#define TFM_PLATFORM_API_VERSION_MINOR   (3)
 
#define TFM_PLATFORM_API_ID_NV_READ   (1010)
 
#define TFM_PLATFORM_API_ID_NV_INCREMENT   (1011)
 

Typedefs

typedef int32_t tfm_platform_ioctl_req_t
 

Enumerations

enum  tfm_platform_err_t {
  TFM_PLATFORM_ERR_SUCCESS = 0, TFM_PLATFORM_ERR_SYSTEM_ERROR, TFM_PLATFORM_ERR_INVALID_PARAM, TFM_PLATFORM_ERR_NOT_SUPPORTED,
  TFM_PLATFORM_ERR_FORCE_INT_SIZE = INT_MAX
}
 Platform service error types. More...
 

Functions

enum tfm_platform_err_t tfm_platform_system_reset (void)
 Resets the system. More...
 
enum tfm_platform_err_t tfm_platform_ioctl (tfm_platform_ioctl_req_t request, psa_invec *input, psa_outvec *output)
 Performs a platform-specific service. More...
 
enum tfm_platform_err_t tfm_platform_nv_counter_increment (uint32_t counter_id)
 Increments the given non-volatile (NV) counter by one. More...
 
enum tfm_platform_err_t tfm_platform_nv_counter_read (uint32_t counter_id, uint32_t size, uint8_t *val)
 Reads the given non-volatile (NV) counter. More...
 

Macro Definition Documentation

#define TFM_PLATFORM_API_ID_NV_INCREMENT   (1011)

Definition at line 27 of file tfm_platform_api.h.

#define TFM_PLATFORM_API_ID_NV_READ   (1010)

Definition at line 26 of file tfm_platform_api.h.

#define TFM_PLATFORM_API_VERSION_MAJOR   (0)

TFM secure partition platform API version.

Definition at line 23 of file tfm_platform_api.h.

#define TFM_PLATFORM_API_VERSION_MINOR   (3)

Definition at line 24 of file tfm_platform_api.h.

Typedef Documentation

typedef int32_t tfm_platform_ioctl_req_t

Definition at line 45 of file tfm_platform_api.h.

Enumeration Type Documentation

Platform service error types.

Enumerator
TFM_PLATFORM_ERR_SUCCESS 
TFM_PLATFORM_ERR_SYSTEM_ERROR 
TFM_PLATFORM_ERR_INVALID_PARAM 
TFM_PLATFORM_ERR_NOT_SUPPORTED 
TFM_PLATFORM_ERR_FORCE_INT_SIZE 

Definition at line 35 of file tfm_platform_api.h.

Function Documentation

enum tfm_platform_err_t tfm_platform_ioctl ( tfm_platform_ioctl_req_t  request,
psa_invec input,
psa_outvec output 
)

Performs a platform-specific service.

Parameters
[in]requestRequest identifier (valid values vary based on the platform)
[in]inputInput buffer to the requested service (or NULL)
[in,out]outputOutput buffer to the requested service (or NULL)
Returns
Returns values as specified by the tfm_platform_err_t

Definition at line 24 of file tfm_platform_func_api.c.

Here is the call graph for this function:

Here is the caller graph for this function:

enum tfm_platform_err_t tfm_platform_nv_counter_increment ( uint32_t  counter_id)

Increments the given non-volatile (NV) counter by one.

Parameters
[in]counter_idNV counter ID.
Returns
TFM_PLATFORM_ERR_SUCCESS if the value is read correctly. Otherwise, it returns TFM_PLATFORM_ERR_SYSTEM_ERROR.

Definition at line 95 of file tfm_platform_secure_api.c.

Here is the call graph for this function:

Here is the caller graph for this function:

enum tfm_platform_err_t tfm_platform_nv_counter_read ( uint32_t  counter_id,
uint32_t  size,
uint8_t *  val 
)

Reads the given non-volatile (NV) counter.

Parameters
[in]counter_idNV counter ID.
[in]sizeSize of the buffer to store NV counter value in bytes.
[out]valPointer to store the current NV counter value.
Returns
TFM_PLATFORM_ERR_SUCCESS if the value is read correctly. Otherwise, it returns TFM_PLATFORM_ERR_SYSTEM_ERROR.

Definition at line 132 of file tfm_platform_secure_api.c.

Here is the call graph for this function:

Here is the caller graph for this function:

enum tfm_platform_err_t tfm_platform_system_reset ( void  )

Resets the system.

Returns
Returns values as specified by the tfm_platform_err_t

Definition at line 13 of file tfm_platform_func_api.c.

Here is the call graph for this function: