core_queu.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. ******************************************************************************
  3. * History: Date; Author; Description
  4. * 07 Dec. 2015; Chen, George; file creation
  5. ******************************************************************************
  6. */
  7. #ifndef __CORE_QUEU_H__
  8. #define __CORE_QUEU_H__
  9. /*
  10. ******************************************************************************
  11. * Includes
  12. ******************************************************************************
  13. */
  14. // #include "tbox_cfgs.h"
  15. // #include "comn_cfgs.h"
  16. // #include "core_task.h"
  17. #include "OSAL.h"
  18. #include "list_slst.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /* ########################### msg queue Types ########################### */
  23. /* msg types definitions */
  24. typedef struct core_msgq_stru_qdat_def {
  25. list_snod_t qdat_node;
  26. } core_qdat_t;
  27. /* msgq types definitions */
  28. typedef struct core_msgq_stru_sque_def {
  29. // message pool
  30. void* sque_pool; // [set by usr] data pool, ptr from malloc
  31. uint32 size_pool; // [set by usr] pool size in bytes
  32. // message ctrlq
  33. uint32 size_qdat; // [set by usr] a data size in bytes (excl. core_msg_t)
  34. list_sque_t sque_dats; // [set by sys] circle singled linked list
  35. } core_sque_t;
  36. /* msgq types definitions */
  37. // typedef struct core_msgq_stru_msgq_def {
  38. // //
  39. // // void* pend_task;
  40. // core_sque_t msgq_msgs;
  41. // } core_msgq_t, *core_msgq_h;
  42. /*
  43. ******************************************************************************
  44. * function prototypes
  45. ******************************************************************************
  46. */
  47. int32
  48. core_sque_ini(core_sque_t* sque);
  49. core_sque_t*
  50. core_sque_new(uint32 size, uint32 coun);
  51. int32
  52. core_sque_del(core_sque_t* sque);
  53. int32
  54. core_sque_pop(core_sque_t* sque, void* data);
  55. int32
  56. core_sque_psh(core_sque_t* sque, const void* data);
  57. // int
  58. // core_msgq_ini(core_msgq_t* msgq);
  59. // core_msgq_t*
  60. // core_msgq_new(uint32 size, uint32 coun);
  61. // int
  62. // core_msgq_del(core_msgq_t* msgq);
  63. // int
  64. // core_msgq_pop(core_msgq_t* msgq, void* data);
  65. // int
  66. // core_msgq_psh(core_msgq_t* msgq, const void* data);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif // __CORE_CMN_H__