Mistake on this page?
Report an issue in GitHub or email us
tfm_message_queue.h
1 /*
2  * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #ifndef __TFM_MESSAGE_QUEUE_H__
8 #define __TFM_MESSAGE_QUEUE_H__
9 
10 #ifndef TFM_MSG_QUEUE_MAX_MSG_NUM
11 #define TFM_MSG_QUEUE_MAX_MSG_NUM 128
12 #endif
13 #define TFM_MSG_MAGIC 0x15154343
14 /* Message struct to collect parameter from client */
16  int32_t magic;
17  struct tfm_spm_service_t *service; /* RoT service pointer */
18  psa_handle_t handle; /* Connected Service handle */
19  struct tfm_event_t ack_evnt; /* Event for ack reponse */
20  psa_msg_t msg; /* PSA message body */
21  psa_invec invec[PSA_MAX_IOVEC]; /* Put in/out vectors in msg body */
22  psa_outvec outvec[PSA_MAX_IOVEC];
23  psa_outvec *caller_outvec; /*
24  * Save caller outvec pointer for
25  * write length update
26  */
27  struct tfm_msg_body_t *next; /* List operators */
28 };
29 
31  struct tfm_msg_body_t *head; /* Queue head */
32  struct tfm_msg_body_t *tail; /* Queue tail */
33  uint32_t size; /* Number of the queue member */
34 };
35 
36 /**
37  * \brief Enqueue a message into message queue.
38  *
39  * \param[in] queue Message queue, it will be initialized
40  * if has not been initialized.
41  * \param[in] node Message queue node want to be enqueue.
42  *
43  * \retval IPC_SUCCESS Success.
44  * \retval IPC_ERROR_BAD_PARAMETERS Parameters error.
45  */
46 int32_t tfm_msg_enqueue(struct tfm_msg_queue_t *queue,
47  struct tfm_msg_body_t *node);
48 
49 /**
50  * \brief Dequeue a message from message queue.
51  *
52  * \param[in] queue Message queue.
53  *
54  * \retval node pointer Success.
55  * \retval NULL Queue is NULL or size is zero.
56  */
57 struct tfm_msg_body_t *tfm_msg_dequeue(struct tfm_msg_queue_t *queue);
58 
59 /**
60  * \brief Check if a message queue is empty.
61  *
62  * \param[in] queue Message queue.
63  *
64  * \returns Returns 1 for empty, or 0 for not.
65  */
66 int32_t tfm_msg_queue_is_empty(struct tfm_msg_queue_t *queue);
67 
68 #endif
Describe a message received by an RoT Service after calling psa_get().
Definition: psa_service.h:46
Structure which describes a scatter-gather output buffer.
Definition: client.h:54
Structure that describes a scatter-gather input buffer.
Definition: client.h:48
#define PSA_MAX_IOVEC
Maximum number of psa_invec and psa_outvec structures allowed for psa_call().
Definition: psa_defs.h:54
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.