43#ifdef TX_INCLUDE_USER_DEFINE_FILE
48#ifndef TX_TIMER_TICKS_PER_SECOND
49#define TX_TIMER_TICKS_PER_SECOND (1000UL)
54#ifndef TX_MAX_PRIORITIES
55#define TX_MAX_PRIORITIES (32U)
60#ifndef TX_STK_MAX_THREADS
61#define TX_STK_MAX_THREADS (16U)
67#ifndef TX_TIMER_THREAD_PRIORITY
68#define TX_TIMER_THREAD_PRIORITY (0U)
70#ifndef TX_TIMER_THREAD_STACK_SIZE
71#define TX_TIMER_THREAD_STACK_SIZE (1024U)
76#ifndef TX_STK_THREAD_STORAGE_WORDS
77#define TX_STK_THREAD_STORAGE_WORDS (24U)
79#ifndef TX_STK_MUTEX_STORAGE_WORDS
80#define TX_STK_MUTEX_STORAGE_WORDS (16U)
82#ifndef TX_STK_SEMAPHORE_STORAGE_WORDS
83#define TX_STK_SEMAPHORE_STORAGE_WORDS (16U)
86#ifndef TX_STK_QUEUE_STORAGE_WORDS
87#define TX_STK_QUEUE_STORAGE_WORDS (48U)
89#ifndef TX_STK_BLOCK_POOL_STORAGE_WORDS
90#define TX_STK_BLOCK_POOL_STORAGE_WORDS (32U)
92#ifndef TX_STK_BYTE_POOL_STORAGE_WORDS
93#define TX_STK_BYTE_POOL_STORAGE_WORDS (26U)
98#ifndef TX_STK_EVENT_FLAGS_STORAGE_DWORDS
99#define TX_STK_EVENT_FLAGS_STORAGE_DWORDS (16U)
101#ifndef TX_STK_TIMER_STORAGE_DWORDS
102#define TX_STK_TIMER_STORAGE_DWORDS (8U)
109#define AZURE_RTOS_THREADX
110#define THREADX_MAJOR_VERSION 6
111#define THREADX_MINOR_VERSION 5
112#define THREADX_PATCH_VERSION 2
113#define THREADX_BUILD_VERSION 202603
114#define TX_STK_WRAPPER_NAME "ThreadX API on SuperTinyKernel"
125#if (ULONG_MAX == 0xFFFFFFFFUL)
127typedef unsigned long ULONG;
137#define TX_NAME_CONST const
143#define TX_NO_WAIT ((ULONG) 0)
144#define TX_WAIT_FOREVER ((ULONG) 0xFFFFFFFFUL)
145#define TX_AND ((UINT) 2)
146#define TX_AND_CLEAR ((UINT) 3)
147#define TX_OR ((UINT) 0)
148#define TX_OR_CLEAR ((UINT) 1)
149#define TX_1_ULONG ((UINT) 1)
150#define TX_2_ULONG ((UINT) 2)
151#define TX_4_ULONG ((UINT) 4)
152#define TX_8_ULONG ((UINT) 8)
153#define TX_16_ULONG ((UINT) 16)
154#define TX_NO_TIME_SLICE ((ULONG) 0)
155#define TX_AUTO_START ((UINT) 1)
156#define TX_DONT_START ((UINT) 0)
157#define TX_AUTO_ACTIVATE ((UINT) 1)
158#define TX_NO_ACTIVATE ((UINT) 0)
159#define TX_TRUE ((UINT) 1)
160#define TX_FALSE ((UINT) 0)
161#define TX_NULL ((void *) 0)
162#define TX_INHERIT ((UINT) 1)
163#define TX_NO_INHERIT ((UINT) 0)
164#define TX_THREAD_ENTRY ((UINT) 0)
165#define TX_THREAD_EXIT ((UINT) 1)
166#define TX_NO_SUSPENSIONS ((UINT) 0)
167#define TX_NO_MESSAGES ((UINT) 0)
168#define TX_EMPTY ((ULONG) 0)
169#define TX_CLEAR_ID ((ULONG) 0)
172#define TX_INT_DISABLE ((UINT) 1)
173#define TX_INT_ENABLE ((UINT) 0)
176#define TX_READY ((UINT) 0)
177#define TX_COMPLETED ((UINT) 1)
178#define TX_TERMINATED ((UINT) 2)
179#define TX_SUSPENDED ((UINT) 3)
180#define TX_SLEEP ((UINT) 4)
181#define TX_QUEUE_SUSP ((UINT) 5)
182#define TX_SEMAPHORE_SUSP ((UINT) 6)
183#define TX_EVENT_FLAG ((UINT) 7)
184#define TX_BLOCK_MEMORY ((UINT) 8)
185#define TX_BYTE_MEMORY ((UINT) 9)
186#define TX_IO_DRIVER ((UINT) 10)
187#define TX_FILE ((UINT) 11)
188#define TX_TCP_IP ((UINT) 12)
189#define TX_MUTEX_SUSP ((UINT) 13)
190#define TX_PRIORITY_CHANGE ((UINT) 14)
193#define TX_SUCCESS ((UINT) 0x00)
194#define TX_DELETED ((UINT) 0x01)
195#define TX_POOL_ERROR ((UINT) 0x02)
196#define TX_PTR_ERROR ((UINT) 0x03)
197#define TX_WAIT_ERROR ((UINT) 0x04)
198#define TX_SIZE_ERROR ((UINT) 0x05)
199#define TX_GROUP_ERROR ((UINT) 0x06)
200#define TX_NO_EVENTS ((UINT) 0x07)
201#define TX_OPTION_ERROR ((UINT) 0x08)
202#define TX_QUEUE_ERROR ((UINT) 0x09)
203#define TX_QUEUE_EMPTY ((UINT) 0x0A)
204#define TX_QUEUE_FULL ((UINT) 0x0B)
205#define TX_SEMAPHORE_ERROR ((UINT) 0x0C)
206#define TX_NO_INSTANCE ((UINT) 0x0D)
207#define TX_THREAD_ERROR ((UINT) 0x0E)
208#define TX_PRIORITY_ERROR ((UINT) 0x0F)
209#define TX_NO_MEMORY ((UINT) 0x10)
210#define TX_START_ERROR ((UINT) 0x10)
211#define TX_DELETE_ERROR ((UINT) 0x11)
212#define TX_RESUME_ERROR ((UINT) 0x12)
213#define TX_CALLER_ERROR ((UINT) 0x13)
214#define TX_SUSPEND_ERROR ((UINT) 0x14)
215#define TX_TIMER_ERROR ((UINT) 0x15)
216#define TX_TICK_ERROR ((UINT) 0x16)
217#define TX_ACTIVATE_ERROR ((UINT) 0x17)
218#define TX_THRESH_ERROR ((UINT) 0x18)
219#define TX_SUSPEND_LIFTED ((UINT) 0x19)
220#define TX_WAIT_ABORTED ((UINT) 0x1A)
221#define TX_WAIT_ABORT_ERROR ((UINT) 0x1B)
222#define TX_MUTEX_ERROR ((UINT) 0x1C)
223#define TX_NOT_AVAILABLE ((UINT) 0x1D)
224#define TX_NOT_OWNED ((UINT) 0x1E)
225#define TX_INHERIT_ERROR ((UINT) 0x1F)
226#define TX_NOT_DONE ((UINT) 0x20)
227#define TX_CEILING_EXCEEDED ((UINT) 0x21)
228#define TX_INVALID_PRIORITY ((UINT) 0x22)
229#define TX_FEATURE_NOT_ENABLED ((UINT) 0xFF)
232#define TX_THREAD_ID ((ULONG) 0x54485244UL)
233#define TX_MUTEX_ID ((ULONG) 0x4D555445UL)
234#define TX_QUEUE_ID ((ULONG) 0x51554555UL)
235#define TX_SEMAPHORE_ID ((ULONG) 0x53454D41UL)
236#define TX_EVENT_FLAGS_ID ((ULONG) 0x4556454EUL)
237#define TX_BLOCK_POOL_ID ((ULONG) 0x424C4F43UL)
238#define TX_BYTE_POOL_ID ((ULONG) 0x42595445UL)
239#define TX_TIMER_ID ((ULONG) 0x54494D52UL)
356 UINT priority,
UINT preempt_threshold,
363 ULONG *run_count,
UINT *priority,
UINT *preemption_threshold,
480#define TX_DISABLE { unsigned int tx_stk_old_posture_ = tx_interrupt_control(TX_INT_DISABLE);
481#define TX_RESTORE (void) tx_interrupt_control(tx_stk_old_posture_); }
void tx_kernel_enter(void)
UINT tx_semaphore_ceiling_put(TX_SEMAPHORE *semaphore_ptr, ULONG ceiling)
UINT tx_interrupt_control(UINT new_posture)
UINT tx_mutex_info_get(TX_MUTEX *mutex_ptr, const CHAR **name, ULONG *count, TX_THREAD **owner, TX_THREAD **first_suspended, ULONG *suspended_count, TX_MUTEX **next_mutex)
struct TX_BYTE_POOL_STRUCT TX_BYTE_POOL
UINT tx_semaphore_delete(TX_SEMAPHORE *semaphore_ptr)
UINT tx_semaphore_put_notify(TX_SEMAPHORE *semaphore_ptr, void(*semaphore_put_notify)(TX_SEMAPHORE *notify_semaphore_ptr))
UINT tx_thread_delete(TX_THREAD *thread_ptr)
UINT tx_thread_stack_error_notify(void(*stack_error_handler)(TX_THREAD *thread_ptr))
UINT tx_byte_release(void *memory_ptr)
UINT tx_semaphore_create(TX_SEMAPHORE *semaphore_ptr, const CHAR *name_ptr, ULONG initial_count)
unsigned long long ULONG64
UINT tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr)
#define TX_STK_SEMAPHORE_STORAGE_WORDS
#define TX_STK_TIMER_STORAGE_DWORDS
UINT tx_queue_create(TX_QUEUE *queue_ptr, const CHAR *name_ptr, UINT message_size, void *queue_start, ULONG queue_size)
UINT tx_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, const CHAR *name_ptr)
struct TX_SEMAPHORE_STRUCT TX_SEMAPHORE
UINT tx_queue_send(TX_QUEUE *queue_ptr, void *source_ptr, ULONG wait_option)
void tx_thread_relinquish(void)
UINT tx_thread_preemption_change(TX_THREAD *thread_ptr, UINT new_threshold, UINT *old_threshold)
UINT tx_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr)
void tx_time_set(ULONG new_time)
UINT tx_mutex_create(TX_MUTEX *mutex_ptr, const CHAR *name_ptr, UINT inherit)
UINT tx_byte_pool_prioritize(TX_BYTE_POOL *pool_ptr)
UINT tx_thread_wait_abort(TX_THREAD *thread_ptr)
#define TX_STK_THREAD_STORAGE_WORDS
UINT tx_thread_reset(TX_THREAD *thread_ptr)
UINT tx_thread_priority_change(TX_THREAD *thread_ptr, UINT new_priority, UINT *old_priority)
UINT tx_timer_delete(TX_TIMER *timer_ptr)
UINT tx_thread_create(TX_THREAD *thread_ptr, const CHAR *name_ptr, void(*entry_function)(ULONG entry_input), ULONG entry_input, void *stack_start, ULONG stack_size, UINT priority, UINT preempt_threshold, ULONG time_slice, UINT auto_start)
UINT tx_timer_info_get(TX_TIMER *timer_ptr, const CHAR **name, UINT *active, ULONG *remaining_ticks, ULONG *reschedule_ticks, TX_TIMER **next_timer)
UINT tx_byte_allocate(TX_BYTE_POOL *pool_ptr, void **memory_ptr, ULONG memory_size, ULONG wait_option)
UINT tx_block_release(void *block_ptr)
UINT tx_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG reschedule_ticks)
UINT tx_thread_time_slice_change(TX_THREAD *thread_ptr, ULONG new_time_slice, ULONG *old_time_slice)
UINT tx_queue_delete(TX_QUEUE *queue_ptr)
UINT tx_event_flags_set_notify(TX_EVENT_FLAGS_GROUP *group_ptr, void(*events_set_notify)(TX_EVENT_FLAGS_GROUP *notify_group_ptr))
UINT tx_thread_info_get(TX_THREAD *thread_ptr, const CHAR **name, UINT *state, ULONG *run_count, UINT *priority, UINT *preemption_threshold, ULONG *time_slice, TX_THREAD **next_thread, TX_THREAD **next_suspended_thread)
UINT tx_mutex_delete(TX_MUTEX *mutex_ptr)
UINT tx_queue_prioritize(TX_QUEUE *queue_ptr)
struct TX_TIMER_STRUCT TX_TIMER
TX_THREAD * tx_thread_identify(void)
UINT tx_block_pool_delete(TX_BLOCK_POOL *pool_ptr)
UINT tx_event_flags_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, const CHAR **name, ULONG *current_flags, TX_THREAD **first_suspended, ULONG *suspended_count, TX_EVENT_FLAGS_GROUP **next_group)
#define TX_STK_MUTEX_STORAGE_WORDS
UINT tx_semaphore_put(TX_SEMAPHORE *semaphore_ptr)
UINT tx_thread_sleep(ULONG timer_ticks)
UINT tx_mutex_prioritize(TX_MUTEX *mutex_ptr)
UINT tx_queue_flush(TX_QUEUE *queue_ptr)
UINT tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, const CHAR **name, ULONG *available_blocks, ULONG *total_blocks, TX_THREAD **first_suspended, ULONG *suspended_count, TX_BLOCK_POOL **next_pool)
UINT tx_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option)
UINT tx_semaphore_info_get(TX_SEMAPHORE *semaphore_ptr, const CHAR **name, ULONG *current_value, TX_THREAD **first_suspended, ULONG *suspended_count, TX_SEMAPHORE **next_semaphore)
UINT tx_byte_pool_info_get(TX_BYTE_POOL *pool_ptr, const CHAR **name, ULONG *available_bytes, ULONG *fragments, TX_THREAD **first_suspended, ULONG *suspended_count, TX_BYTE_POOL **next_pool)
UINT tx_block_pool_create(TX_BLOCK_POOL *pool_ptr, const CHAR *name_ptr, ULONG block_size, void *pool_start, ULONG pool_size)
#define TX_STK_EVENT_FLAGS_STORAGE_DWORDS
struct TX_BLOCK_POOL_STRUCT TX_BLOCK_POOL
#define TX_STK_BYTE_POOL_STORAGE_WORDS
UINT tx_queue_send_notify(TX_QUEUE *queue_ptr, void(*queue_send_notify)(TX_QUEUE *notify_queue_ptr))
UINT tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, UINT set_option)
UINT tx_timer_activate(TX_TIMER *timer_ptr)
UINT tx_queue_receive(TX_QUEUE *queue_ptr, void *destination_ptr, ULONG wait_option)
UINT tx_mutex_put(TX_MUTEX *mutex_ptr)
UINT tx_timer_create(TX_TIMER *timer_ptr, const CHAR *name_ptr, void(*expiration_function)(ULONG input), ULONG expiration_input, ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate)
UINT tx_thread_resume(TX_THREAD *thread_ptr)
UINT tx_thread_entry_exit_notify(TX_THREAD *thread_ptr, void(*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type))
UINT tx_thread_terminate(TX_THREAD *thread_ptr)
#define TX_STK_QUEUE_STORAGE_WORDS
struct TX_EVENT_FLAGS_GROUP_STRUCT TX_EVENT_FLAGS_GROUP
UINT tx_block_allocate(TX_BLOCK_POOL *pool_ptr, void **block_ptr, ULONG wait_option)
UINT tx_queue_info_get(TX_QUEUE *queue_ptr, const CHAR **name, ULONG *enqueued, ULONG *available_storage, TX_THREAD **first_suspended, ULONG *suspended_count, TX_QUEUE **next_queue)
UINT tx_semaphore_prioritize(TX_SEMAPHORE *semaphore_ptr)
struct TX_THREAD_STRUCT TX_THREAD
UINT tx_thread_suspend(TX_THREAD *thread_ptr)
UINT tx_queue_front_send(TX_QUEUE *queue_ptr, void *source_ptr, ULONG wait_option)
struct TX_QUEUE_STRUCT TX_QUEUE
UINT tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags, UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option)
UINT tx_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option)
void tx_application_define(void *first_unused_memory)
UINT tx_block_pool_prioritize(TX_BLOCK_POOL *pool_ptr)
UINT tx_byte_pool_create(TX_BYTE_POOL *pool_ptr, const CHAR *name_ptr, void *pool_start, ULONG pool_size)
UINT tx_timer_deactivate(TX_TIMER *timer_ptr)
struct TX_MUTEX_STRUCT TX_MUTEX
#define TX_STK_BLOCK_POOL_STORAGE_WORDS
void(* tx_thread_entry)(ULONG entry_input)
ULONG tx_thread_stack_size
UINT tx_thread_preempt_threshold
UINT tx_thread_stk_start_threshold
UINT tx_thread_stk_start_priority
ULONG tx_thread_entry_parameter
ALIGN_TYPE tx_thread_stk_storage[(24U)]
void * tx_thread_stack_start
void(* tx_thread_entry_exit_notify)(struct TX_THREAD_STRUCT *thread_ptr, UINT condition)
ULONG tx_thread_run_count
ULONG tx_thread_stk_start_time_slice
ULONG tx_thread_time_slice
const CHAR * tx_thread_name
void * tx_thread_extension_ptr
const CHAR * tx_mutex_name
ALIGN_TYPE tx_mutex_stk_storage[(16U)]
void(* tx_semaphore_put_notify)(struct TX_SEMAPHORE_STRUCT *notify_semaphore_ptr)
ALIGN_TYPE tx_semaphore_stk_storage[(16U)]
const CHAR * tx_semaphore_name
ULONG tx_event_flags_group_id
ULONG64 tx_event_flags_group_stk_storage[(16U)]
void(* tx_event_flags_group_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_group_ptr)
const CHAR * tx_event_flags_group_name
ALIGN_TYPE tx_queue_stk_storage[(48U)]
const CHAR * tx_queue_name
UINT tx_queue_message_size
void(* tx_queue_send_notify)(struct TX_QUEUE_STRUCT *notify_queue_ptr)
ALIGN_TYPE tx_block_pool_stk_storage[(32U)]
const CHAR * tx_block_pool_name
ALIGN_TYPE tx_byte_pool_stk_storage[(26U)]
const CHAR * tx_byte_pool_name
ULONG tx_timer_expiration_input
ULONG tx_timer_initial_ticks
void(* tx_timer_expiration_function)(ULONG input)
ULONG64 tx_timer_stk_storage[(8U)]
ULONG tx_timer_reschedule_ticks
const CHAR * tx_timer_name