Line data Source code
1 0 : /*
2 : * Copyright (c) 2018 Intel Corporation
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : #ifndef ZEPHYR_INCLUDE_CMSIS_TYPES_H_
8 : #define ZEPHYR_INCLUDE_CMSIS_TYPES_H_
9 :
10 : #include <stdbool.h>
11 : #include <zephyr/kernel.h>
12 : #include <zephyr/portability/cmsis_os2.h>
13 :
14 : /**
15 : * @brief Control block for a CMSIS-RTOSv2 thread.
16 : *
17 : * Application can use manual user-defined allocation for RTOS objects by supplying a pointer to
18 : * thread control block. Control block is initiazed within `osThreadNew()`.
19 : */
20 1 : struct cmsis_rtos_thread_cb {
21 0 : sys_dnode_t node;
22 : struct k_thread z_thread;
23 0 : struct k_poll_signal poll_signal;
24 0 : struct k_poll_event poll_event;
25 0 : uint32_t signal_results;
26 0 : uint32_t attr_bits;
27 : };
28 :
29 : /**
30 : * @brief Control block for a CMSIS-RTOSv2 timer.
31 : *
32 : * Application can use manual user-defined allocation for RTOS objects by supplying a pointer to
33 : * timer control block. Control block is initiazed within `osTimerNew()`.
34 : */
35 1 : struct cmsis_rtos_timer_cb {
36 : struct k_timer z_timer;
37 0 : osTimerType_t type;
38 0 : uint32_t status;
39 0 : bool is_cb_dynamic_allocation;
40 0 : const char *name;
41 0 : void (*callback_function)(void *argument);
42 0 : void *arg;
43 : };
44 :
45 : /**
46 : * @brief Control block for a CMSIS-RTOSv2 mutex.
47 : *
48 : * Application can use manual user-defined allocation for RTOS objects by supplying a pointer to
49 : * mutex control block. Control block is initiazed within `osMutexNew()`.
50 : */
51 1 : struct cmsis_rtos_mutex_cb {
52 : struct k_mutex z_mutex;
53 0 : bool is_cb_dynamic_allocation;
54 0 : const char *name;
55 0 : uint32_t state;
56 : };
57 :
58 : /**
59 : * @brief Control block for a CMSIS-RTOSv2 semaphore.
60 : *
61 : * Application can use manual user-defined allocation for RTOS objects by supplying a pointer to
62 : * semaphore control block. Control block is initiazed within `osSemaphoreNew()`.
63 : */
64 1 : struct cmsis_rtos_semaphore_cb {
65 : struct k_sem z_semaphore;
66 0 : bool is_cb_dynamic_allocation;
67 0 : const char *name;
68 : };
69 :
70 : /**
71 : * @brief Control block for a CMSIS-RTOSv2 memory pool.
72 : *
73 : * Application can use manual user-defined allocation for RTOS objects by supplying a pointer to
74 : * memory pool control block. Control block is initiazed within `osMemoryPoolNew()`.
75 : */
76 1 : struct cmsis_rtos_mempool_cb {
77 : struct k_mem_slab z_mslab;
78 0 : void *pool;
79 0 : char is_dynamic_allocation;
80 0 : bool is_cb_dynamic_allocation;
81 0 : const char *name;
82 : };
83 :
84 : /**
85 : * @brief Control block for a CMSIS-RTOSv2 message queue.
86 : *
87 : * Application can use manual user-defined allocation for RTOS objects by supplying a pointer to
88 : * message queue control block. Control block is initiazed within `osMessageQueueNew()`.
89 : */
90 1 : struct cmsis_rtos_msgq_cb {
91 : struct k_msgq z_msgq;
92 0 : void *pool;
93 0 : char is_dynamic_allocation;
94 0 : bool is_cb_dynamic_allocation;
95 0 : const char *name;
96 : };
97 :
98 : /**
99 : * @brief Control block for a CMSIS-RTOSv2 event flag.
100 : *
101 : * Application can use manual user-defined allocation for RTOS objects by supplying a pointer to
102 : * event flag control block. Control block is initiazed within `osEventFlagsNew()`.
103 : */
104 1 : struct cmsis_rtos_event_cb {
105 : struct k_event z_event;
106 0 : bool is_cb_dynamic_allocation;
107 0 : const char *name;
108 : };
109 :
110 : #endif
|