TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_nspm_func.c File Reference
#include <stdbool.h>
#include "cmsis_compiler.h"
#include "spm_func.h"
#include "tfm_spm_hal.h"
#include "tfm_arch.h"
#include "tfm_api.h"
#include "tfm_nspm.h"
#include "ext/tz_context.h"
#include "arch.h"
Include dependency graph for tfm_nspm_func.c:

Go to the source code of this file.

Macros

#define TFM_MAX_NS_THREAD_COUNT   8
 
#define INVALID_CLIENT_ID   0
 
#define DEFAULT_NS_CLIENT_ID   ((int32_t)-1)
 
#define INVALID_NS_CLIENT_IDX   (-1)
 
#define DEFAULT_NS_CLIENT_IDX   0
 

Functions

void tfm_nspm_configure_clients (void)
 initialise the NS context database More...
 
int32_t tfm_nspm_get_current_client_id (void)
 Get the client ID of the current NS client. More...
 
__tfm_nspm_secure_gateway_attributes__
uint32_t 
TZ_InitContextSystem_S (void)
 
__tfm_nspm_secure_gateway_attributes__
TZ_MemoryId_t 
TZ_AllocModuleContext_S (TZ_ModuleId_t module)
 
__tfm_nspm_secure_gateway_attributes__
uint32_t 
TZ_FreeModuleContext_S (TZ_MemoryId_t id)
 
__tfm_nspm_secure_gateway_attributes__
uint32_t 
TZ_LoadContext_S (TZ_MemoryId_t id)
 
__tfm_nspm_secure_gateway_attributes__
uint32_t 
TZ_StoreContext_S (TZ_MemoryId_t id)
 
void configure_ns_code (void)
 

Macro Definition Documentation

#define DEFAULT_NS_CLIENT_ID   ((int32_t)-1)

Definition at line 23 of file tfm_nspm_func.c.

#define DEFAULT_NS_CLIENT_IDX   0

Definition at line 26 of file tfm_nspm_func.c.

#define INVALID_CLIENT_ID   0

Definition at line 21 of file tfm_nspm_func.c.

#define INVALID_NS_CLIENT_IDX   (-1)

Definition at line 25 of file tfm_nspm_func.c.

#define TFM_MAX_NS_THREAD_COUNT   8

Definition at line 19 of file tfm_nspm_func.c.

Function Documentation

void configure_ns_code ( void  )

Definition at line 305 of file tfm_nspm_func.c.

void tfm_nspm_configure_clients ( void  )

initialise the NS context database

Definition at line 48 of file tfm_nspm_func.c.

Here is the caller graph for this function:

int32_t tfm_nspm_get_current_client_id ( void  )

Get the client ID of the current NS client.

Returns
The client id of the current NS client. 0 (invalid client id) is returned in case of error.

Definition at line 63 of file tfm_nspm_func.c.

Here is the caller graph for this function:

Allocate context memory for calling secure software modules in TrustZone

Parameters
[in]moduleidentifies software modules called from non-secure mode
Returns
value != 0 id TrustZone memory slot identifier
value 0 no memory available or internal error

Definition at line 117 of file tfm_nspm_func.c.

Here is the call graph for this function:

__tfm_nspm_secure_gateway_attributes__ uint32_t TZ_FreeModuleContext_S ( TZ_MemoryId_t  id)

Free context memory that was previously allocated with TZ_AllocModuleContext_S

Parameters
[in]idTrustZone memory slot identifier
Returns
execution status (1: success, 0: error)

Definition at line 149 of file tfm_nspm_func.c.

Here is the call graph for this function:

__tfm_nspm_secure_gateway_attributes__ uint32_t TZ_InitContextSystem_S ( void  )

Initialize secure context memory system

Returns
execution status (1: success, 0: error)

Definition at line 85 of file tfm_nspm_func.c.

Here is the call graph for this function:

__tfm_nspm_secure_gateway_attributes__ uint32_t TZ_LoadContext_S ( TZ_MemoryId_t  id)

Load secure context (called on RTOS thread context switch)

Parameters
[in]idTrustZone memory slot identifier
Returns
execution status (1: success, 0: error)

Definition at line 194 of file tfm_nspm_func.c.

Here is the call graph for this function:

__tfm_nspm_secure_gateway_attributes__ uint32_t TZ_StoreContext_S ( TZ_MemoryId_t  id)

Store secure context (called on RTOS thread context switch)

Parameters
[in]idTrustZone memory slot identifier
Returns
execution status (1: success, 0: error)

Definition at line 233 of file tfm_nspm_func.c.

Here is the call graph for this function: