1 /*
2  * Copyright (c) 2022-2023, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __RSE_COMMS_H__
9 #define __RSE_COMMS_H__
10 
11 #include "psa/client.h"
12 #include "cmsis_compiler.h"
13 #include "rse_comms_atu.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19  /* size suits to get_attest_token() */
20 #define RSE_COMMS_PAYLOAD_MAX_SIZE (0x40 + 0x800)
21 
22 /*
23  * Allocated for each client request.
24  *
25  * TODO: Sizing of payload_buf, this should be platform dependent:
26  * - sum in_vec size
27  * - sum out_vec size
28  */
29 struct client_request_t {
30     void *mhu_sender_dev; /* Pointer to MHU sender device to reply on */
31     uint8_t protocol_ver;
32     uint8_t seq_num;
33     uint16_t client_id;
34     psa_handle_t handle;
35     int32_t type;
36     uint32_t in_len;
37     uint32_t out_len;
38     psa_invec in_vec[PSA_MAX_IOVEC];
39     psa_outvec out_vec[PSA_MAX_IOVEC];
40     int32_t return_val;
41     uint64_t out_vec_host_addr[PSA_MAX_IOVEC];
42     uint8_t param_copy_buf[RSE_COMMS_PAYLOAD_MAX_SIZE];
43     comms_atu_region_set_t atu_regions;
44 };
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
50 #endif /* __RSE_COMMS_H__ */
51