blob: 165978d4a0969f70760ebf9fc9ed5779173792bd [file] [log] [blame]
Raef Coles734aaac2022-06-15 14:37:22 +01001/*
2 * Copyright (c) 2022, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
Tamas Band0973182024-02-21 12:42:00 +01008#ifndef __RSE_COMMS_PROTOCOL_EMBED_H__
9#define __RSE_COMMS_PROTOCOL_EMBED_H__
Raef Coles734aaac2022-06-15 14:37:22 +010010
11#include <cdefs.h>
12
Raef Coles734aaac2022-06-15 14:37:22 +010013#include <psa/client.h>
14
15#include <platform_def.h>
16
Tamas Banff0aa682022-09-08 17:04:49 +020017
Raef Coles734aaac2022-06-15 14:37:22 +010018
Tamas Band0973182024-02-21 12:42:00 +010019struct __packed rse_embed_msg_t {
Raef Coles734aaac2022-06-15 14:37:22 +010020 psa_handle_t handle;
21 uint32_t ctrl_param; /* type, in_len, out_len */
22 uint16_t io_size[PSA_MAX_IOVEC];
Tamas Band0973182024-02-21 12:42:00 +010023 uint8_t trailer[PLAT_RSE_COMMS_PAYLOAD_MAX_SIZE];
Raef Coles734aaac2022-06-15 14:37:22 +010024};
25
Tamas Band0973182024-02-21 12:42:00 +010026struct __packed rse_embed_reply_t {
Raef Coles734aaac2022-06-15 14:37:22 +010027 int32_t return_val;
28 uint16_t out_size[PSA_MAX_IOVEC];
Tamas Band0973182024-02-21 12:42:00 +010029 uint8_t trailer[PLAT_RSE_COMMS_PAYLOAD_MAX_SIZE];
Raef Coles734aaac2022-06-15 14:37:22 +010030};
31
Tamas Band0973182024-02-21 12:42:00 +010032psa_status_t rse_protocol_embed_serialize_msg(psa_handle_t handle,
Raef Coles734aaac2022-06-15 14:37:22 +010033 int16_t type,
34 const psa_invec *in_vec,
35 uint8_t in_len,
36 const psa_outvec *out_vec,
37 uint8_t out_len,
Tamas Band0973182024-02-21 12:42:00 +010038 struct rse_embed_msg_t *msg,
Raef Coles734aaac2022-06-15 14:37:22 +010039 size_t *msg_len);
40
Tamas Band0973182024-02-21 12:42:00 +010041psa_status_t rse_protocol_embed_deserialize_reply(psa_outvec *out_vec,
Raef Coles734aaac2022-06-15 14:37:22 +010042 uint8_t out_len,
43 psa_status_t *return_val,
Tamas Band0973182024-02-21 12:42:00 +010044 const struct rse_embed_reply_t *reply,
Raef Coles734aaac2022-06-15 14:37:22 +010045 size_t reply_size);
46
Tamas Band0973182024-02-21 12:42:00 +010047#endif /* __RSE_COMMS_PROTOCOL_EMBED_H__ */