hal_msgbox.h 846 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __MESSAGEBOX__H__
  2. #define __MESSAGEBOX__H__
  3. #include <stdint.h>
  4. enum cpu_type {
  5. ARM_MSG_CORE,
  6. RISC_V_MSG_CORE,
  7. MIPS_MSG_CORE,
  8. OPENRISC_MSG_CORE,
  9. DSP0_MSG_CORE,
  10. DSP1_MSG_CORE,
  11. };
  12. struct msg_endpoint {
  13. uint32_t local_amp;
  14. uint32_t remote_amp;
  15. uint32_t write_ch;
  16. uint32_t read_ch;
  17. struct msg_endpoint *next;
  18. void *data;
  19. void (*rec)(uint32_t l, void *d);
  20. void (*tx_done)(void *d);
  21. /* use in driver */
  22. void *private;
  23. };
  24. uint32_t hal_msgbox_init(void);
  25. uint32_t hal_msgbox_alloc_channel(struct msg_endpoint *edp, uint32_t remote,
  26. uint32_t read, uint32_t write);
  27. uint32_t hal_msgbox_channel_send(struct msg_endpoint *edp, uint8_t *bf,
  28. uint32_t len);
  29. void hal_msgbox_free_channel(struct msg_endpoint *edp);
  30. #endif /* __MESSAGEBOX__H__ */