blob: d0205d291a6b52ed5488efc92d5ce7ee76c7fafa [file] [log] [blame]
Valerio Setti4f4ade92024-05-03 17:28:04 +02001/* 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
30typedef int32_t psa_status_t;
31typedef int32_t psa_handle_t;
32
33#define PSA_MAX_IOVEC (4u)
34
35#define PSA_IPC_CALL (0)
36
37struct message_text {
38 int qid;
39 int32_t psa_type;
40 char buf[MAX_FRAGMENT_SIZE];
41};
42
43struct message {
44 long message_type;
45 struct message_text message_text;
46};
47
48typedef struct vector_sizes {
49 size_t invec_sizes[PSA_MAX_IOVEC];
50 size_t outvec_sizes[PSA_MAX_IOVEC];
51} vector_sizes_t;
52
53#endif /* _COMMON_H_ */