diff --git a/include/zephyr/portability/cmsis_types.h b/include/zephyr/portability/cmsis_types.h new file mode 100644 index 00000000000..8fba9344ec4 --- /dev/null +++ b/include/zephyr/portability/cmsis_types.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_CMSIS_TYPES_H_ +#define ZEPHYR_INCLUDE_CMSIS_TYPES_H_ + +#include +#include + +struct cv2_thread { + sys_dnode_t node; + struct k_thread z_thread; + struct k_poll_signal poll_signal; + struct k_poll_event poll_event; + uint32_t signal_results; + char name[16]; + uint32_t attr_bits; + struct k_sem join_guard; + char has_joined; +}; + +struct cv2_timer { + struct k_timer z_timer; + osTimerType_t type; + uint32_t status; + char name[16]; + void (*callback_function)(void *argument); + void *arg; +}; + +struct cv2_mutex { + struct k_mutex z_mutex; + char name[16]; + uint32_t state; +}; + +struct cv2_sem { + struct k_sem z_semaphore; + char name[16]; +}; + +struct cv2_mslab { + struct k_mem_slab z_mslab; + void *pool; + char is_dynamic_allocation; + char name[16]; +}; + +struct cv2_msgq { + struct k_msgq z_msgq; + void *pool; + char is_dynamic_allocation; + char name[16]; +}; + +struct cv2_event_flags { + struct k_poll_signal poll_signal; + struct k_poll_event poll_event; + uint32_t signal_results; + char name[16]; +}; + +#endif diff --git a/subsys/portability/cmsis_rtos_v2/event_flags.c b/subsys/portability/cmsis_rtos_v2/event_flags.c index 7718dcb55ae..829d5fd402d 100644 --- a/subsys/portability/cmsis_rtos_v2/event_flags.c +++ b/subsys/portability/cmsis_rtos_v2/event_flags.c @@ -5,8 +5,8 @@ */ #include +#include #include -#include "wrapper.h" K_MEM_SLAB_DEFINE(cv2_event_flags_slab, sizeof(struct cv2_event_flags), CONFIG_CMSIS_V2_EVT_FLAGS_MAX_COUNT, 4); diff --git a/subsys/portability/cmsis_rtos_v2/kernel.c b/subsys/portability/cmsis_rtos_v2/kernel.c index 4b647866fe9..9f19e89e69f 100644 --- a/subsys/portability/cmsis_rtos_v2/kernel.c +++ b/subsys/portability/cmsis_rtos_v2/kernel.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include extern uint32_t sys_clock_tick_get_32(void); diff --git a/subsys/portability/cmsis_rtos_v2/mempool.c b/subsys/portability/cmsis_rtos_v2/mempool.c index 9af6a024a17..f7b2ca22451 100644 --- a/subsys/portability/cmsis_rtos_v2/mempool.c +++ b/subsys/portability/cmsis_rtos_v2/mempool.c @@ -5,6 +5,7 @@ */ #include +#include #include #include "wrapper.h" diff --git a/subsys/portability/cmsis_rtos_v2/msgq.c b/subsys/portability/cmsis_rtos_v2/msgq.c index d603de6dee6..c4811a3e40d 100644 --- a/subsys/portability/cmsis_rtos_v2/msgq.c +++ b/subsys/portability/cmsis_rtos_v2/msgq.c @@ -5,6 +5,7 @@ */ #include +#include #include #include "wrapper.h" diff --git a/subsys/portability/cmsis_rtos_v2/mutex.c b/subsys/portability/cmsis_rtos_v2/mutex.c index 74c314a77ae..1cdc00a04a6 100644 --- a/subsys/portability/cmsis_rtos_v2/mutex.c +++ b/subsys/portability/cmsis_rtos_v2/mutex.c @@ -5,6 +5,7 @@ */ #include +#include #include #include "wrapper.h" diff --git a/subsys/portability/cmsis_rtos_v2/semaphore.c b/subsys/portability/cmsis_rtos_v2/semaphore.c index 9d52fdda086..7d37410cd15 100644 --- a/subsys/portability/cmsis_rtos_v2/semaphore.c +++ b/subsys/portability/cmsis_rtos_v2/semaphore.c @@ -5,8 +5,8 @@ */ #include +#include #include -#include "wrapper.h" K_MEM_SLAB_DEFINE(cv2_semaphore_slab, sizeof(struct cv2_sem), CONFIG_CMSIS_V2_SEMAPHORE_MAX_COUNT, 4); diff --git a/subsys/portability/cmsis_rtos_v2/thread.c b/subsys/portability/cmsis_rtos_v2/thread.c index 7e650e36a89..3f42658cbbc 100644 --- a/subsys/portability/cmsis_rtos_v2/thread.c +++ b/subsys/portability/cmsis_rtos_v2/thread.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "wrapper.h" static const osThreadAttr_t init_thread_attrs = { diff --git a/subsys/portability/cmsis_rtos_v2/thread_flags.c b/subsys/portability/cmsis_rtos_v2/thread_flags.c index abc4cdc22bc..a573c59a452 100644 --- a/subsys/portability/cmsis_rtos_v2/thread_flags.c +++ b/subsys/portability/cmsis_rtos_v2/thread_flags.c @@ -5,6 +5,7 @@ */ #include +#include #include "wrapper.h" #define DONT_CARE (0) diff --git a/subsys/portability/cmsis_rtos_v2/timer.c b/subsys/portability/cmsis_rtos_v2/timer.c index a1a9aff30ef..eeb155f933f 100644 --- a/subsys/portability/cmsis_rtos_v2/timer.c +++ b/subsys/portability/cmsis_rtos_v2/timer.c @@ -5,8 +5,8 @@ */ #include +#include #include -#include "wrapper.h" #define ACTIVE 1 #define NOT_ACTIVE 0 diff --git a/subsys/portability/cmsis_rtos_v2/wrapper.h b/subsys/portability/cmsis_rtos_v2/wrapper.h index b599a59c67e..0d3f6e33722 100644 --- a/subsys/portability/cmsis_rtos_v2/wrapper.h +++ b/subsys/portability/cmsis_rtos_v2/wrapper.h @@ -8,7 +8,8 @@ #define __WRAPPER_H__ #include -#include +#include +#include #ifndef TRUE #define TRUE 1 @@ -17,59 +18,6 @@ #define FALSE 0 #endif -struct cv2_thread { - sys_dnode_t node; - struct k_thread z_thread; - struct k_poll_signal poll_signal; - struct k_poll_event poll_event; - uint32_t signal_results; - char name[16]; - uint32_t attr_bits; - struct k_sem join_guard; - char has_joined; -}; - -struct cv2_timer { - struct k_timer z_timer; - osTimerType_t type; - uint32_t status; - char name[16]; - void (*callback_function)(void *argument); - void *arg; -}; - -struct cv2_mutex { - struct k_mutex z_mutex; - char name[16]; - uint32_t state; -}; - -struct cv2_sem { - struct k_sem z_semaphore; - char name[16]; -}; - -struct cv2_mslab { - struct k_mem_slab z_mslab; - void *pool; - char is_dynamic_allocation; - char name[16]; -}; - -struct cv2_msgq { - struct k_msgq z_msgq; - void *pool; - char is_dynamic_allocation; - char name[16]; -}; - -struct cv2_event_flags { - struct k_poll_signal poll_signal; - struct k_poll_event poll_event; - uint32_t signal_results; - char name[16]; -}; - extern osThreadId_t get_cmsis_thread_id(k_tid_t tid); extern void *is_cmsis_rtos_v2_thread(void *thread_id);