37 #ifndef CMSIS_PLUS_RTOS_OS_C_DECLS_H_ 38 #define CMSIS_PLUS_RTOS_OS_C_DECLS_H_ 44 #include <cmsis-plus/os-app-config.h> 45 #include <cmsis-plus/rtos/port/os-decls.h> 143 #define os_flags_any 0 148 #define os_flags_all 0xFFFFFFFF 261 #define OS_THREAD_PRIO_SHIFT (4) 343 (*os_thread_func_t) (os_thread_func_args_t args);
389 #pragma GCC diagnostic push 390 #pragma GCC diagnostic ignored "-Wpadded" 409 size_t stack_size_bytes;
434 #if !defined(OS_USE_RTOS_PORT_SCHEDULER) 435 os_port_thread_context_t port;
444 #if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) \ 445 || defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES) 463 #if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) 467 #if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES) 565 os_thread_func_args_t func_args;
576 void* allocted_stack_address;
577 size_t acquired_mutexes;
578 size_t allocated_stack_size_elements;
579 os_thread_state_t state;
580 os_thread_prio_t prio_assigned;
581 os_thread_prio_t prio_inherited;
584 #if defined(OS_INCLUDE_RTOS_CUSTOM_THREAD_USER_STORAGE) 585 os_thread_user_storage_t user_storage;
588 #if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) \ 589 || defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES) 593 #if defined(OS_USE_RTOS_PORT_SCHEDULER) 594 os_thread_port_data_t port;
604 #pragma GCC diagnostic pop 616 #pragma GCC diagnostic push 617 #pragma GCC diagnostic ignored "-Wpadded" 640 os_clock_duration_t sleep_count;
641 os_clock_timestamp_t steady_count;
649 #pragma GCC diagnostic pop 656 #pragma GCC diagnostic push 657 #pragma GCC diagnostic ignored "-Wpadded" 668 #pragma GCC diagnostic pop 721 #pragma GCC diagnostic push 722 #pragma GCC diagnostic ignored "-Wpadded" 772 os_timer_func_args_t func_args;
773 #if !defined(OS_USE_RTOS_PORT_TIMER) 776 os_clock_duration_t period;
778 #if defined(OS_USE_RTOS_PORT_TIMER) 779 os_timer_port_data_t port_;
781 os_timer_type_t type;
782 os_timer_state_t state;
790 #pragma GCC diagnostic pop 886 #pragma GCC diagnostic push 887 #pragma GCC diagnostic ignored "-Wpadded" 957 #if !defined(OS_USE_RTOS_PORT_MUTEX) 958 os_internal_threads_waiting_list_t list;
962 #if defined(OS_USE_RTOS_PORT_MUTEX) 963 os_mutex_port_data_t port;
965 os_mutex_count_t count;
966 os_thread_prio_t initial_prio_ceiling;
967 os_thread_prio_t prio_ceiling;
968 os_thread_prio_t bosted_prio;
972 os_mutex_type_t type;
973 os_mutex_protocol_t protocol;
974 os_mutex_robustness_t robustness;
975 os_mutex_count_t max_count;
983 #pragma GCC diagnostic pop 1038 #if !defined(OS_USE_RTOS_PORT_CONDITION_VARIABLE) 1039 os_internal_threads_waiting_list_t list;
1066 #pragma GCC diagnostic push 1067 #pragma GCC diagnostic ignored "-Wpadded" 1121 #if !defined(OS_USE_RTOS_PORT_SEMAPHORE) 1122 os_internal_threads_waiting_list_t list;
1125 #if defined(OS_USE_RTOS_PORT_SEMAPHORE) 1126 os_semaphore_port_data_t port;
1128 os_semaphore_count_t initial_count;
1129 os_semaphore_count_t count;
1130 os_semaphore_count_t max_count;
1138 #pragma GCC diagnostic pop 1152 #pragma GCC diagnostic push 1153 #pragma GCC diagnostic ignored "-Wpadded" 1208 #if !defined(OS_USE_RTOS_PORT_MEMORY_POOL) 1209 os_internal_threads_waiting_list_t list;
1213 void* allocated_pool_addr;
1215 #if defined(OS_USE_RTOS_PORT_MEMORY_POOL) 1216 os_mempool_port_data_t port;
1218 size_t pool_size_bytes;
1219 size_t allocated_pool_size_elements_;
1220 os_mempool_size_t blocks;
1221 os_mempool_size_t block_size_bytes;
1222 os_mempool_size_t count;
1231 #pragma GCC diagnostic pop 1238 #if defined(OS_BOOL_RTOS_MESSAGE_QUEUE_SIZE_16BITS) 1259 #pragma GCC diagnostic push 1260 #pragma GCC diagnostic ignored "-Wpadded" 1315 #if !defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE) 1316 os_internal_threads_waiting_list_t send_list;
1317 os_internal_threads_waiting_list_t receive_list;
1319 os_mqueue_index_t* prev_array;
1320 os_mqueue_index_t* next_array;
1321 os_mqueue_prio_t* prio_array;
1326 void* allocated_queue_addr;
1329 #if defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE) 1330 os_mqueue_port_data_t port;
1333 size_t queue_size_bytes;
1334 size_t allocated_queue_size_elements;
1336 os_mqueue_msg_size_t msg_size_bytes;
1337 os_mqueue_size_t msgs;
1339 os_mqueue_size_t count;
1340 #if !defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE) 1341 os_mqueue_index_t head;
1350 #pragma GCC diagnostic pop 1362 #pragma GCC diagnostic push 1363 #pragma GCC diagnostic ignored "-Wpadded" 1407 #if !defined(OS_USE_RTOS_PORT_EVENT_FLAGS) 1408 os_internal_threads_waiting_list_t list;
1412 #if defined(OS_USE_RTOS_PORT_EVENT_FLAGS) 1413 os_evflags_port_data_t port_;
1424 #pragma GCC diagnostic pop
os_clock_timestamp_t timestamp
struct os_thread_context_s os_thread_context_t
Thread context.
struct os_internal_thread_children_list_s os_internal_thread_children_list_t
os_thread_prio_t mx_priority_ceiling
Mutex priority ceiling.
uint8_t os_mutex_protocol_t
void * mp_pool_address
Pointer to user provided memory pool area.
class thread::stack * stack(void)
Get the interrupts stack.
uint8_t os_timer_type_t
Type of variables holding timer types.
void * clock
Pointer to clock object instance.
No longer usable, but resources not yet released.
struct os_evflags_attr_s os_evflags_attr_t
Event flags attributes.
size_t mq_queue_size_bytes
Size of user provided message queue area, in bytes.
os_timer_type_t tm_type
Timer type.
Message queue object storage.
struct os_thread_s os_thread_t
Thread object storage.
void * os_thread_func_args_t
Type of thread function arguments.
os_mutex_robustness_t mx_robustness
Mutex robustness.
void * clock
Pointer to clock object instance.
struct os_thread_attr_s os_thread_attr_t
Thread attributes.
uint16_t os_mqueue_msg_size_t
os_semaphore_count_t sm_max_value
Semaphore max count value.
void * clock
Address of the clock to use for timeouts.
void os_rtc_handler(void)
RTC interrupt handler.
struct os_timer_attr_s os_timer_attr_t
Timer attributes.
Used to catch uninitialised threads.
void * clock
Pointer to clock object instance.
size_t th_stack_size_bytes
Size of the user defined storage for the thread stack, in bytes.
void * clock
Pointer to clock object instance.
os_semaphore_count_t sm_initial_value
Semaphore initial count value.
void * os_iterator_t
Generic iterator, implemented as a pointer.
struct os_internal_evflags_s os_internal_evflags_t
Internal event flags.
os_port_irq_state_t os_irq_state_t
Type of variables holding interrupts priority values.
uint8_t os_thread_state_t
Type of variables holding thread states.
struct os_timer_s os_timer_t
Timer object storage.
void * mq_queue_addr
Pointer to user provided message queue area.
uint32_t os_result_t
Type of values returned by RTOS functions.
struct os_thread_stack_s os_thread_stack_t
Thread stack.
uint32_t os_flags_mask_t
Type of variables holding flags masks.
struct os_thread_statistics_s os_thread_statistics_t
Thread statistics.
os_internal_double_list_links_t os_internal_threads_waiting_list_t
Condition variable attributes.
os_internal_double_list_links_t links
int16_t os_semaphore_count_t
Type of variables holding semaphore counts.
Present in the READY list and competing for CPU.
struct os_mempool_s os_mempool_t
Memory pool object storage.
struct os_internal_double_list_links_s os_internal_double_list_links_t
uint64_t os_statistics_duration_t
Type of variables holding durations in CPU cycles.
struct os_mempool_attr_s os_mempool_attr_t
Memory pool attributes.
void * th_stack_address
Address of the user defined storage for the thread stack.
os_thread_prio_t th_priority
Thread initial priority.
os_port_clock_duration_t os_clock_duration_t
Type of variables holding clock durations.
struct os_mutex_attr_s os_mutex_attr_t
Mutex attributes.
Event flags object storage.
struct os_condvar_attr_s os_condvar_attr_t
Condition variable attributes.
Enhanced robustness at thread termination.
rtos::statistics::counter_t context_switches(void)
Get the total number of context switches.
struct os_clock_s os_clock_t
Clock object storage.
Inherit priority from highest priority thread.
size_t mp_pool_size_bytes
Size of user provided memory pool area, in bytes.
struct os_semaphore_s os_semaphore_t
Semaphore object storage.
struct os_condvar_s os_condvar_t
Condition variable object storage.
Not present in the READY list, waiting for an event.
struct os_semaphore_attr_s os_semaphore_attr_t
Semaphore attributes.
Execute at the highest priority.
os_port_thread_stack_allocation_element_t os_thread_stack_allocation_element_t
Type of variables holding aligned stack elements.
void * clock
Pointer to clock object instance.
struct os_mqueue_attr_s os_mqueue_attr_t
Message queue attributes.
Semaphore object storage.
os_mutex_count_t mx_max_count
Recursive mutex max count.
os_mutex_type_t mx_type
Mutex type.
os_mqueue_size_t os_mqueue_index_t
struct os_mqueue_s os_mqueue_t
Message queue object storage.
uint8_t os_timer_state_t
Type of variables holding timer states.
struct os_evflags_s os_evflags_t
Event flags object storage.
Priority and scheduling not affected by mutex ownership.
uint8_t os_mutex_robustness_t
struct os_clock_node_s os_internal_clock_timer_node_t
uint16_t os_mempool_size_t
uint64_t os_statistics_counter_t
Type of variables holding context switches counters.
Memory pool object storage.
os_port_thread_stack_element_t os_thread_stack_element_t
Type of variables holding stack words.
os_port_clock_offset_t os_clock_offset_t
Type of variables holding clock offsets.
os_mutex_protocol_t mx_protocol
Mutex protocol.
os_flags_mask_t flags_mask
void(* os_timer_func_t)(os_timer_func_args_t args)
Type of timer function.
uint8_t os_thread_prio_t
Type of variables holding thread priorities.
uint32_t os_flags_mode_t
Type of variables holding flags modes.
void * clock
Pointer to clock object instance.
void * clock
Pointer to clock object instance.
uint8_t os_mqueue_prio_t
Type of variables holding message queue priorities.
Condition variable object storage.
struct os_mutex_s os_mutex_t
Mutex object storage.
void os_systick_handler(void)
SysTick interrupt handler.
os_port_clock_timestamp_t os_clock_timestamp_t
Type of variables holding clock time stamps.
os_internal_double_list_links_t links
allocator_stateless_default_resource< T > allocator
Type of allocator used by the system objects. Must be stateless.
#define OS_THREAD_PRIO_SHIFT
Recursive mutex behaviour.
Default mutex robustness.
os_internal_double_list_links_t links
struct os_internal_clock_timestamps_list_s os_internal_clock_timestamps_list_t
void * os_timer_func_args_t
Type of timer function arguments.
void *(* os_thread_func_t)(os_thread_func_args_t args)
Type of thread function.
struct os_internal_waiting_thread_node_s os_internal_waiting_thread_node_t
os_port_scheduler_state_t os_sched_state_t
Type of variables holding scheduler state codes.
Memory resource object storage.
Terminated and resources (like stack) released.
Message queue attributes.
struct os_memory_s os_memory_t
Memory resource object storage.
rtos::statistics::duration_t cpu_cycles(void)
Get the total duration of all threads.