TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
psa_client_service_apis.c File Reference
#include <stdint.h>
#include "common/spm_psa_client_call.h"
#include "psa/lifecycle.h"
#include "spm_func.h"
#include "tfm_core_utils.h"
#include "tfm_hal_platform.h"
#include "tfm_internal_defines.h"
#include "tfm_rpc.h"
#include "tfm_spm_hal.h"
Include dependency graph for psa_client_service_apis.c:

Go to the source code of this file.

Functions

uint32_t tfm_spm_get_lifecycle_state (void)
 
uint32_t tfm_spm_psa_framework_version (void)
 SVC handler for psa_framework_version. More...
 
uint32_t tfm_spm_psa_version (uint32_t *args, bool ns_caller)
 SVC handler for psa_version. More...
 
psa_status_t tfm_spm_psa_connect (uint32_t *args, bool ns_caller)
 SVC handler for psa_connect. More...
 
psa_status_t tfm_spm_psa_call (uint32_t *args, bool ns_caller, uint32_t lr)
 SVC handler for psa_call. More...
 
void tfm_spm_psa_close (uint32_t *args, bool ns_caller)
 SVC handler for psa_close. More...
 
psa_signal_t tfm_spm_psa_wait (uint32_t *args)
 Handle signal wait request. More...
 
psa_status_t tfm_spm_psa_get (uint32_t *args)
 SVC handler for psa_get. More...
 
void tfm_spm_psa_set_rhandle (uint32_t *args)
 SVC handler for psa_set_rhandle. More...
 
size_t tfm_spm_psa_read (uint32_t *args)
 SVC handler for psa_read. More...
 
size_t tfm_spm_psa_skip (uint32_t *args)
 SVC handler for psa_skip. More...
 
void tfm_spm_psa_write (uint32_t *args)
 SVC handler for psa_write. More...
 
void tfm_spm_psa_reply (uint32_t *args)
 SVC handler for psa_reply. More...
 
void tfm_spm_psa_notify (uint32_t *args)
 SVC handler for psa_notify. More...
 
void tfm_spm_psa_clear (void)
 SVC handler for psa_clear. More...
 
void tfm_spm_psa_eoi (uint32_t *args)
 Handle request to record IRQ processed. More...
 
void tfm_spm_psa_panic (void)
 Terminate execution within the calling Secure Partition and will not return. More...
 

Function Documentation

uint32_t tfm_spm_get_lifecycle_state ( void  )

Definition at line 24 of file psa_client_service_apis.c.

psa_status_t tfm_spm_psa_call ( uint32_t *  args,
bool  ns_caller,
uint32_t  lr 
)

SVC handler for psa_call.

Parameters
[in]argsInclude all input arguments: handle, in_vec, in_len, out_vec, out_len.
[in]ns_callerIf 'true', call from non-secure client. Or from secure client.
[in]lrEXC_RETURN value of the SVC.
Return values
>=0RoT Service-specific status value.
<0RoT Service-specific error code.
PSA_ERROR_PROGRAMMER_ERRORThe connection has been terminated by the RoT Service. The call is a PROGRAMMER ERROR if one or more of the following are true:
  • An invalid handle was passed.
  • The connection is already handling a request.
  • type < 0.
  • An invalid memory reference was provided.
  • in_len + out_len > PSA_MAX_IOVEC.
  • The message is unrecognized by the RoT Service or incorrectly formatted.

Definition at line 60 of file psa_client_service_apis.c.

Here is the call graph for this function:

void tfm_spm_psa_clear ( void  )

SVC handler for psa_clear.

Return values
voidSuccess.
Does not returnThe Secure Partition's doorbell signal is not currently asserted.

Definition at line 565 of file psa_client_service_apis.c.

Here is the call graph for this function:

void tfm_spm_psa_close ( uint32_t *  args,
bool  ns_caller 
)

SVC handler for psa_close.

Parameters
[in]argsInclude all input arguments: handle.
[in]ns_callerIf 'true', call from non-secure client. Or from secure client.
Return values
voidSuccess.
Does not returnThe call is invalid, one or more of the following are true:
  • An invalid handle was provided that is not the null handle.
  • The connection is handling a request.

Definition at line 108 of file psa_client_service_apis.c.

Here is the call graph for this function:

psa_status_t tfm_spm_psa_connect ( uint32_t *  args,
bool  ns_caller 
)

SVC handler for psa_connect.

Parameters
[in]argsInclude all input arguments: sid, version.
[in]ns_callerIf 'true', call from non-secure client. Or from secure client.
Return values
PSA_SUCCESSSuccess.
PSA_ERROR_CONNECTION_REFUSEDThe SPM or RoT Service has refused the connection.
PSA_ERROR_CONNECTION_BUSYThe SPM or RoT Service cannot make the connection at the moment.
Does not returnThe RoT Service ID and version are not supported, or the caller is not permitted to access the service.

Definition at line 48 of file psa_client_service_apis.c.

Here is the call graph for this function:

void tfm_spm_psa_eoi ( uint32_t *  args)

Handle request to record IRQ processed.

SVC handler for psa_eoi.

Definition at line 584 of file psa_client_service_apis.c.

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t tfm_spm_psa_framework_version ( void  )

SVC handler for psa_framework_version.

Returns
version The version of the PSA Framework implementation that is providing the runtime services to the caller.

Definition at line 33 of file psa_client_service_apis.c.

Here is the call graph for this function:

psa_status_t tfm_spm_psa_get ( uint32_t *  args)

SVC handler for psa_get.

Parameters
[in]argsInclude all input arguments: signal, msg.
Return values
PSA_SUCCESSSuccess, *msg will contain the delivered message.
PSA_ERROR_DOES_NOT_EXISTMessage could not be delivered.
Does not returnThe call is invalid because one or more of the following are true:
  • signal has more than a single bit set.
  • signal does not correspond to an RoT Service.
  • The RoT Service signal is not currently asserted.
  • The msg pointer provided is not a valid memory reference.

Definition at line 170 of file psa_client_service_apis.c.

Here is the call graph for this function:

void tfm_spm_psa_notify ( uint32_t *  args)

SVC handler for psa_notify.

Parameters
[in]argsInclude all input arguments: partition_id.
Return values
voidSuccess.
Does not returnpartition_id does not correspond to a Secure Partition.

Definition at line 555 of file psa_client_service_apis.c.

Here is the call graph for this function:

void tfm_spm_psa_panic ( void  )

Terminate execution within the calling Secure Partition and will not return.

Return values
Does not return

Definition at line 622 of file psa_client_service_apis.c.

size_t tfm_spm_psa_read ( uint32_t *  args)

SVC handler for psa_read.

Parameters
[in]argsInclude all input arguments: msg_handle, invec_idx, buffer, num_bytes.
Return values
>0Number of bytes copied.
0There was no remaining data in this input vector.
Does not returnThe call is invalid, one or more of the following are true:
  • msg_handle is invalid.
  • msg_handle does not refer to a request message.
  • invec_idx is equal to or greater than PSA_MAX_IOVEC.
  • the memory reference for buffer is invalid or not writable.

Definition at line 264 of file psa_client_service_apis.c.

Here is the call graph for this function:

void tfm_spm_psa_reply ( uint32_t *  args)

SVC handler for psa_reply.

Parameters
[in]argsInclude all input arguments: msg_handle, status.
Return values
voidSuccess.
Does not returnThe call is invalid, one or more of the following are true:
  • msg_handle is invalid.
  • An invalid status code is specified for the type of message.

Definition at line 455 of file psa_client_service_apis.c.

Here is the call graph for this function:

void tfm_spm_psa_set_rhandle ( uint32_t *  args)

SVC handler for psa_set_rhandle.

Parameters
[in]argsInclude all input arguments: msg_handle, rhandle.
Return values
voidSuccess, rhandle will be provided with all subsequent messages delivered on this connection.
Does not returnmsg_handle is invalid.

Definition at line 240 of file psa_client_service_apis.c.

Here is the call graph for this function:

size_t tfm_spm_psa_skip ( uint32_t *  args)

SVC handler for psa_skip.

Parameters
[in]argsInclude all input arguments: msg_handle, invec_idx, num_bytes.
Return values
>0Number of bytes skipped.
0There was no remaining data in this input vector.
Does not returnThe call is invalid, one or more of the following are true:
  • msg_handle is invalid.
  • msg_handle does not refer to a request message.
  • invec_idx is equal to or greater than PSA_MAX_IOVEC.

Definition at line 333 of file psa_client_service_apis.c.

Here is the call graph for this function:

uint32_t tfm_spm_psa_version ( uint32_t *  args,
bool  ns_caller 
)

SVC handler for psa_version.

Parameters
[in]argsInclude all input arguments: sid.
[in]ns_callerIf 'true', call from non-secure client. Or from secure client.
Return values
PSA_VERSION_NONEThe RoT Service is not implemented, or the caller is not permitted to access the service.
>0 The version of the implemented RoT Service.

Definition at line 38 of file psa_client_service_apis.c.

Here is the call graph for this function:

psa_signal_t tfm_spm_psa_wait ( uint32_t *  args)

Handle signal wait request.

SVC handler for psa_wait.

Definition at line 120 of file psa_client_service_apis.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void tfm_spm_psa_write ( uint32_t *  args)

SVC handler for psa_write.

Parameters
[in]argsInclude all input arguments: msg_handle, outvec_idx, buffer, num_bytes.
Return values
voidSuccess
Does not returnThe call is invalid, one or more of the following are true:
  • msg_handle is invalid.
  • msg_handle does not refer to a request message.
  • outvec_idx is equal to or greater than PSA_MAX_IOVEC.
  • The memory reference for buffer is invalid.
  • The call attempts to write data past the end of the client output vector.

Definition at line 388 of file psa_client_service_apis.c.

Here is the call graph for this function: