rse_comms_protocol_embed.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2022, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef __RSE_COMMS_PROTOCOL_EMBED_H__
  8. #define __RSE_COMMS_PROTOCOL_EMBED_H__
  9. #include <cdefs.h>
  10. #include <psa/client.h>
  11. #include <platform_def.h>
  12. struct __packed rse_embed_msg_t {
  13. psa_handle_t handle;
  14. uint32_t ctrl_param; /* type, in_len, out_len */
  15. uint16_t io_size[PSA_MAX_IOVEC];
  16. uint8_t trailer[PLAT_RSE_COMMS_PAYLOAD_MAX_SIZE];
  17. };
  18. struct __packed rse_embed_reply_t {
  19. int32_t return_val;
  20. uint16_t out_size[PSA_MAX_IOVEC];
  21. uint8_t trailer[PLAT_RSE_COMMS_PAYLOAD_MAX_SIZE];
  22. };
  23. psa_status_t rse_protocol_embed_serialize_msg(psa_handle_t handle,
  24. int16_t type,
  25. const psa_invec *in_vec,
  26. uint8_t in_len,
  27. const psa_outvec *out_vec,
  28. uint8_t out_len,
  29. struct rse_embed_msg_t *msg,
  30. size_t *msg_len);
  31. psa_status_t rse_protocol_embed_deserialize_reply(psa_outvec *out_vec,
  32. uint8_t out_len,
  33. psa_status_t *return_val,
  34. const struct rse_embed_reply_t *reply,
  35. size_t reply_size);
  36. #endif /* __RSE_COMMS_PROTOCOL_EMBED_H__ */