wrapper.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. void *stack_in_heap;
  23. void *tid_in_heap;
  24. };
  25. struct cv2_timer {
  26. struct k_timer z_timer;
  27. osTimerType_t type;
  28. uint32_t status;
  29. char name[16];
  30. void (*callback_function)(void *argument);
  31. void *arg;
  32. };
  33. struct cv2_mutex {
  34. struct k_mutex z_mutex;
  35. char name[16];
  36. uint32_t state;
  37. };
  38. struct cv2_sem {
  39. struct k_sem z_semaphore;
  40. char name[16];
  41. };
  42. struct cv2_mslab {
  43. struct k_mem_slab z_mslab;
  44. void *pool;
  45. char is_dynamic_allocation;
  46. char name[16];
  47. };
  48. struct cv2_msgq {
  49. struct k_msgq z_msgq;
  50. void *pool;
  51. char is_dynamic_allocation;
  52. char name[16];
  53. };
  54. struct cv2_event_flags {
  55. struct k_poll_signal poll_signal;
  56. struct k_poll_event poll_event;
  57. uint32_t signal_results;
  58. char name[16];
  59. };
  60. extern osThreadId_t get_cmsis_thread_id(k_tid_t tid);
  61. extern void *is_cmsis_rtos_v2_thread(void *thread_id);
  62. #endif