wrapper.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2018 Intel Corporation
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __WRAPPER_H__
  7. #define __WRAPPER_H__
  8. #include <kernel.h>
  9. #include <cmsis_os2.h>
  10. #define TRUE 1
  11. #define FALSE 0
  12. struct cv2_thread {
  13. sys_dnode_t node;
  14. struct k_thread z_thread;
  15. struct k_poll_signal poll_signal;
  16. struct k_poll_event poll_event;
  17. uint32_t signal_results;
  18. char name[16];
  19. uint32_t attr_bits;
  20. struct k_sem join_guard;
  21. char has_joined;
  22. };
  23. struct cv2_timer {
  24. struct k_timer z_timer;
  25. osTimerType_t type;
  26. uint32_t status;
  27. char name[16];
  28. void (*callback_function)(void *argument);
  29. void *arg;
  30. };
  31. struct cv2_mutex {
  32. struct k_mutex z_mutex;
  33. char name[16];
  34. uint32_t state;
  35. };
  36. struct cv2_sem {
  37. struct k_sem z_semaphore;
  38. char name[16];
  39. };
  40. struct cv2_mslab {
  41. struct k_mem_slab z_mslab;
  42. void *pool;
  43. char is_dynamic_allocation;
  44. char name[16];
  45. };
  46. struct cv2_msgq {
  47. struct k_msgq z_msgq;
  48. void *pool;
  49. char is_dynamic_allocation;
  50. char name[16];
  51. };
  52. struct cv2_event_flags {
  53. struct k_poll_signal poll_signal;
  54. struct k_poll_event poll_event;
  55. uint32_t signal_results;
  56. char name[16];
  57. };
  58. extern osThreadId_t get_cmsis_thread_id(k_tid_t tid);
  59. extern void *is_cmsis_rtos_v2_thread(void *thread_id);
  60. #endif