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

Go to the source code of this file.

Functions

mailbox_msg_handle_t tfm_ns_mailbox_tx_client_req (uint32_t call_type, const struct psa_client_params_t *params, int32_t client_id)
 Prepare and send PSA client request to SPE via mailbox. More...
 
int32_t tfm_ns_mailbox_rx_client_reply (mailbox_msg_handle_t handle, int32_t *reply)
 Fetch PSA client return result. More...
 
bool tfm_ns_mailbox_is_msg_replied (mailbox_msg_handle_t handle)
 Check whether a specific mailbox message has been replied. More...
 
int32_t tfm_ns_mailbox_init (struct ns_mailbox_queue_t *queue)
 NSPE mailbox initialization. More...
 
mailbox_msg_handle_t tfm_ns_mailbox_fetch_reply_msg_isr (void)
 Fetch the handle to the first replied mailbox message in the NSPE mailbox queue. This function is intended to be called inside platform specific notification IRQ handler. More...
 
const void * tfm_ns_mailbox_get_msg_owner (mailbox_msg_handle_t handle)
 Return the handle of owner task of a mailbox message according to the mailbox_msg_handle_t. More...
 
int32_t tfm_ns_mailbox_hal_init (struct ns_mailbox_queue_t *queue)
 Platform specific NSPE mailbox initialization. Invoked by tfm_ns_mailbox_init(). More...
 
int32_t tfm_ns_mailbox_hal_notify_peer (void)
 Notify SPE to deal with the PSA client call sent via mailbox. More...
 
void tfm_ns_mailbox_hal_enter_critical (void)
 Enter critical section of NSPE mailbox. More...
 
void tfm_ns_mailbox_hal_exit_critical (void)
 Exit critical section of NSPE mailbox. More...
 
void tfm_ns_mailbox_hal_enter_critical_isr (void)
 Enter critical section of NSPE mailbox in IRQ handler. More...
 
void tfm_ns_mailbox_hal_exit_critical_isr (void)
 Enter critical section of NSPE mailbox in IRQ handler. More...
 

Function Documentation

mailbox_msg_handle_t tfm_ns_mailbox_fetch_reply_msg_isr ( void  )

Fetch the handle to the first replied mailbox message in the NSPE mailbox queue. This function is intended to be called inside platform specific notification IRQ handler.

Note
The replied status of the fetched mailbox message will be cleaned after the message is fetched. When this function is called again, it fetches the next replied mailbox message from the NSPE mailbox queue.
Returns
Return the handle to the first replied mailbox message in the queue. Return MAILBOX_MSG_NULL_HANDLE if no mailbox message is replied.

Definition at line 314 of file tfm_ns_mailbox.c.

Here is the call graph for this function:

const void* tfm_ns_mailbox_get_msg_owner ( mailbox_msg_handle_t  handle)

Return the handle of owner task of a mailbox message according to the mailbox_msg_handle_t.

Parameters
[in]handleThe handle of mailbox message.
Returns
Return the handle value of the owner task.

Definition at line 349 of file tfm_ns_mailbox.c.

void tfm_ns_mailbox_hal_enter_critical ( void  )

Enter critical section of NSPE mailbox.

Note
The implementation depends on platform specific hardware and use case.

Here is the caller graph for this function:

void tfm_ns_mailbox_hal_enter_critical_isr ( void  )

Enter critical section of NSPE mailbox in IRQ handler.

Note
The implementation depends on platform specific hardware and use case.

Here is the caller graph for this function:

void tfm_ns_mailbox_hal_exit_critical ( void  )

Exit critical section of NSPE mailbox.

Note
The implementation depends on platform specific hardware and use case.

Here is the caller graph for this function:

void tfm_ns_mailbox_hal_exit_critical_isr ( void  )

Enter critical section of NSPE mailbox in IRQ handler.

Note
The implementation depends on platform specific hardware and use case.

Here is the caller graph for this function:

int32_t tfm_ns_mailbox_hal_init ( struct ns_mailbox_queue_t queue)

Platform specific NSPE mailbox initialization. Invoked by tfm_ns_mailbox_init().

Parameters
[in]queueThe base address of NSPE mailbox queue to be initialized.
Return values
MAILBOX_SUCCESSOperation succeeded.
Otherreturn code Operation failed with an error code.

Here is the caller graph for this function:

int32_t tfm_ns_mailbox_hal_notify_peer ( void  )

Notify SPE to deal with the PSA client call sent via mailbox.

Note
The implementation depends on platform specific hardware and use case.
Return values
MAILBOX_SUCCESSOperation succeeded.
Otherreturn code Operation failed with an error code.

Here is the caller graph for this function:

int32_t tfm_ns_mailbox_init ( struct ns_mailbox_queue_t queue)

NSPE mailbox initialization.

Parameters
[in]queueThe base address of NSPE mailbox queue to be initialized.
Return values
MAILBOX_SUCCESSOperation succeeded.
Otherreturn code Operation failed with an error code.

Definition at line 364 of file tfm_ns_mailbox.c.

Here is the call graph for this function:

bool tfm_ns_mailbox_is_msg_replied ( mailbox_msg_handle_t  handle)

Check whether a specific mailbox message has been replied.

Parameters
[in]handleThe handle to the mailbox message
Return values
trueThe PSA client call return value is replied.
falseThe PSA client call return value is not replied yet.

Definition at line 284 of file tfm_ns_mailbox.c.

Here is the call graph for this function:

int32_t tfm_ns_mailbox_rx_client_reply ( mailbox_msg_handle_t  handle,
int32_t *  reply 
)

Fetch PSA client return result.

Parameters
[in]handleThe handle to the mailbox message
[out]replyThe address to be written with return result.
Return values
MAILBOX_SUCCESSSuccessfully get PSA client call return result.
Otherreturn code Operation failed with an error code.

Definition at line 247 of file tfm_ns_mailbox.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mailbox_msg_handle_t tfm_ns_mailbox_tx_client_req ( uint32_t  call_type,
const struct psa_client_params_t params,
int32_t  client_id 
)

Prepare and send PSA client request to SPE via mailbox.

Parameters
[in]call_typePSA client call type
[in]paramsParmaters used for PSA client call
[in]client_idOptional client ID of non-secure caller. It is required to identify the non-secure caller when NSPE OS enforces non-secure task isolation.
Return values
>=0 The handle to the mailbox message assigned.
<0 Operation failed with an error code.

Definition at line 196 of file tfm_ns_mailbox.c.

Here is the call graph for this function:

Here is the caller graph for this function: