sci_ipc.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. /*!
  7. * Header file for the IPC implementation.
  8. */
  9. #ifndef SCI_IPC_H
  10. #define SCI_IPC_H
  11. /* Includes */
  12. #include <sci/sci_types.h>
  13. /* Defines */
  14. /* Types */
  15. /* Functions */
  16. /*!
  17. * This function opens an IPC channel.
  18. *
  19. * @param[out] ipc return pointer for ipc handle
  20. * @param[in] id id of channel to open
  21. *
  22. * @return Returns an error code (SC_ERR_NONE = success, SC_ERR_IPC
  23. * otherwise).
  24. *
  25. * The \a id parameter is implementation specific. Could be an MU
  26. * address, pointer to a driver path, channel index, etc.
  27. */
  28. sc_err_t sc_ipc_open(sc_ipc_t *ipc, sc_ipc_id_t id);
  29. /*!
  30. * This function closes an IPC channel.
  31. *
  32. * @param[in] ipc id of channel to close
  33. */
  34. void sc_ipc_close(sc_ipc_t ipc);
  35. /*!
  36. * This function reads a message from an IPC channel.
  37. *
  38. * @param[in] ipc id of channel read from
  39. * @param[out] data pointer to message buffer to read
  40. *
  41. * This function will block if no message is available to be read.
  42. */
  43. void sc_ipc_read(sc_ipc_t ipc, void *data);
  44. /*!
  45. * This function writes a message to an IPC channel.
  46. *
  47. * @param[in] ipc id of channel to write to
  48. * @param[in] data pointer to message buffer to write
  49. *
  50. * This function will block if the outgoing buffer is full.
  51. */
  52. void sc_ipc_write(sc_ipc_t ipc, void *data);
  53. extern sc_ipc_t ipc_handle;
  54. #endif /* SCI_IPC_H */