1 /* Common definitions used for clients and services */
2 
3 /*
4  *  Copyright The Mbed TLS Contributors
5  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
6  */
7 
8 #ifndef _COMMON_H_
9 #define _COMMON_H_
10 
11 #include <stdint.h>
12 #include <stddef.h>
13 
14 /* Increasing this might break on some platforms */
15 #define MAX_FRAGMENT_SIZE 200
16 
17 #define CONNECT_REQUEST 1
18 #define CALL_REQUEST 2
19 #define CLOSE_REQUEST 3
20 #define VERSION_REQUEST 4
21 #define READ_REQUEST    5
22 #define READ_RESPONSE   6
23 #define WRITE_REQUEST   7
24 #define WRITE_RESPONSE  8
25 #define SKIP_REQUEST    9
26 #define PSA_REPLY       10
27 
28 #define NON_SECURE (1 << 30)
29 
30 typedef int32_t psa_handle_t;
31 
32 #define PSA_MAX_IOVEC (4u)
33 
34 #define PSA_IPC_CALL (0)
35 
36 struct message_text {
37     int qid;
38     int32_t psa_type;
39     char buf[MAX_FRAGMENT_SIZE];
40 };
41 
42 struct message {
43     long message_type;
44     struct message_text message_text;
45 };
46 
47 typedef struct vector_sizes {
48     size_t invec_sizes[PSA_MAX_IOVEC];
49     size_t outvec_sizes[PSA_MAX_IOVEC];
50 } vector_sizes_t;
51 
52 #endif /* _COMMON_H_ */
53