SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
tx_api.h
Go to the documentation of this file.
1/*
2 * SuperTinyKernel(TM) RTOS: Lightweight High-Performance Deterministic C++ RTOS for Embedded Systems.
3 *
4 * Source: https://github.com/SuperTinyKernel-RTOS
5 *
6 * Copyright (c) 2022-2026 Neutron Code Limited <stk@neutroncode.com>. All Rights Reserved.
7 * License: MIT License, see LICENSE for a full text.
8 */
9
10#ifndef TX_API_H
11#define TX_API_H
12
30
31#include <stdint.h>
32#include <stddef.h>
33#include <limits.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/* ------------------------------------------------------------------------- */
40/* Configuration (override with -D or in a tx_user.h included before this file) */
41/* ------------------------------------------------------------------------- */
42
43#ifdef TX_INCLUDE_USER_DEFINE_FILE
44#include "tx_user.h"
45#endif
46
47/* Tick rate. STK is initialized with a tick resolution of 1000000 / TX_TIMER_TICKS_PER_SECOND us. */
48#ifndef TX_TIMER_TICKS_PER_SECOND
49#define TX_TIMER_TICKS_PER_SECOND (1000UL)
50#endif
51
52/* Number of priority levels, [1, 1024] (limit of sched::SwitchStrategyPreemptionThreshold). 0 is the highest priority.
53 Up to 32 levels use a single-word ready bitmap, 33-64 a 64-bit one, more a multi-word bitmap (larger RAM/ROM footprint). */
54#ifndef TX_MAX_PRIORITIES
55#define TX_MAX_PRIORITIES (32U)
56#endif
57
58/* Maximum number of concurrently registered threads (the tick and handler tasks of the timer host are
59 accounted separately). */
60#ifndef TX_STK_MAX_THREADS
61#define TX_STK_MAX_THREADS (16U)
62#endif
63
64/* Timer (expiration function) tasks: priority 0 = highest, as in ThreadX. Both the tick task and the handler
65 task of the timer host run at this priority. The stack size of the handler task (which runs the expiration
66 functions) is set with STK_TIMER_HANDLER_STACK_SIZE of stk_time_timer.h (bytes are not used here). */
67#ifndef TX_TIMER_THREAD_PRIORITY
68#define TX_TIMER_THREAD_PRIORITY (0U)
69#endif
70#ifndef TX_TIMER_THREAD_STACK_SIZE
71#define TX_TIMER_THREAD_STACK_SIZE (1024U) /* kept for source compatibility, see above */
72#endif
73
74/* Size (in pointer-sized words) of the opaque storage inside every control block. The implementation
75 verifies at compile time that the STK objects fit, increase the value if a static assertion fires. */
76#ifndef TX_STK_THREAD_STORAGE_WORDS
77#define TX_STK_THREAD_STORAGE_WORDS (24U)
78#endif
79#ifndef TX_STK_MUTEX_STORAGE_WORDS
80#define TX_STK_MUTEX_STORAGE_WORDS (16U)
81#endif
82#ifndef TX_STK_SEMAPHORE_STORAGE_WORDS
83#define TX_STK_SEMAPHORE_STORAGE_WORDS (16U)
84#endif
85
86#ifndef TX_STK_QUEUE_STORAGE_WORDS
87#define TX_STK_QUEUE_STORAGE_WORDS (48U)
88#endif
89#ifndef TX_STK_BLOCK_POOL_STORAGE_WORDS
90#define TX_STK_BLOCK_POOL_STORAGE_WORDS (32U)
91#endif
92#ifndef TX_STK_BYTE_POOL_STORAGE_WORDS
93#define TX_STK_BYTE_POOL_STORAGE_WORDS (26U)
94#endif
95/* The event flags and timer storage is counted in 64-bit words (not pointer-sized): the event flags object holds a
96 64-bit flags word (all 32 ThreadX flags plus the error bit reserved by STK) and the timer object holds 64-bit tick
97 values, so both need 8-byte alignment also on 32-bit targets, where ALIGN_TYPE is only 4 bytes. */
98#ifndef TX_STK_EVENT_FLAGS_STORAGE_DWORDS
99#define TX_STK_EVENT_FLAGS_STORAGE_DWORDS (16U)
100#endif
101#ifndef TX_STK_TIMER_STORAGE_DWORDS
102#define TX_STK_TIMER_STORAGE_DWORDS (8U)
103#endif
104
105/* ------------------------------------------------------------------------- */
106/* Version */
107/* ------------------------------------------------------------------------- */
108
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"
115
116/* ------------------------------------------------------------------------- */
117/* Basic types */
118/* ------------------------------------------------------------------------- */
119
120#define VOID void
121typedef char CHAR;
122typedef unsigned char UCHAR;
123typedef int INT;
124typedef unsigned int UINT;
125#if (ULONG_MAX == 0xFFFFFFFFUL)
126typedef long LONG;
127typedef unsigned long ULONG;
128#else
129typedef int LONG;
130typedef unsigned int ULONG;
131#endif
132typedef unsigned long long ULONG64;
133typedef short SHORT;
134typedef unsigned short USHORT;
135typedef uintptr_t ALIGN_TYPE;
136
137#define TX_NAME_CONST const
138
139/* ------------------------------------------------------------------------- */
140/* API input parameters and general constants */
141/* ------------------------------------------------------------------------- */
142
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)
170
171/* Interrupt posture (Cortex-M style PRIMASK values). */
172#define TX_INT_DISABLE ((UINT) 1)
173#define TX_INT_ENABLE ((UINT) 0)
174
175/* Thread execution states. */
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)
191
192/* Return codes. */
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)
230
231/* Control block identifiers (same values as ThreadX). */
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)
240
241/* ------------------------------------------------------------------------- */
242/* Control blocks */
243/* ------------------------------------------------------------------------- */
244
245struct TX_THREAD_STRUCT;
246struct TX_MUTEX_STRUCT;
248struct TX_QUEUE_STRUCT;
252struct TX_TIMER_STRUCT;
253
274
281
289
297
306
313
320
321/* The timer object (stk::time::TimerHost::Timer) lives in the opaque storage, the timers are serviced by the
322 timer host (tick task + handler task). The storage is 64-bit aligned, see TX_STK_TIMER_STORAGE_DWORDS. */
333
334/* ------------------------------------------------------------------------- */
335/* Application entry point (provided by the application) */
336/* ------------------------------------------------------------------------- */
337
338VOID tx_application_define(VOID *first_unused_memory);
339
340/* ------------------------------------------------------------------------- */
341/* Kernel / system */
342/* ------------------------------------------------------------------------- */
343
345UINT tx_interrupt_control(UINT new_posture);
347VOID tx_time_set(ULONG new_time);
348
349/* ------------------------------------------------------------------------- */
350/* Thread */
351/* ------------------------------------------------------------------------- */
352
353UINT tx_thread_create(TX_THREAD *thread_ptr, TX_NAME_CONST CHAR *name_ptr,
354 VOID (*entry_function)(ULONG entry_input), ULONG entry_input,
355 VOID *stack_start, ULONG stack_size,
356 UINT priority, UINT preempt_threshold,
357 ULONG time_slice, UINT auto_start);
358UINT tx_thread_delete(TX_THREAD *thread_ptr);
360 VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type));
362UINT tx_thread_info_get(TX_THREAD *thread_ptr, TX_NAME_CONST CHAR **name, UINT *state,
363 ULONG *run_count, UINT *priority, UINT *preemption_threshold,
364 ULONG *time_slice, TX_THREAD **next_thread, TX_THREAD **next_suspended_thread);
365UINT tx_thread_preemption_change(TX_THREAD *thread_ptr, UINT new_threshold, UINT *old_threshold);
366UINT tx_thread_priority_change(TX_THREAD *thread_ptr, UINT new_priority, UINT *old_priority);
368UINT tx_thread_reset(TX_THREAD *thread_ptr);
369UINT tx_thread_resume(TX_THREAD *thread_ptr);
370UINT tx_thread_sleep(ULONG timer_ticks);
371UINT tx_thread_stack_error_notify(VOID (*stack_error_handler)(TX_THREAD *thread_ptr));
372UINT tx_thread_suspend(TX_THREAD *thread_ptr);
374UINT tx_thread_time_slice_change(TX_THREAD *thread_ptr, ULONG new_time_slice, ULONG *old_time_slice);
376
377/* ------------------------------------------------------------------------- */
378/* Mutex */
379/* ------------------------------------------------------------------------- */
380
381UINT tx_mutex_create(TX_MUTEX *mutex_ptr, TX_NAME_CONST CHAR *name_ptr, UINT inherit);
382UINT tx_mutex_delete(TX_MUTEX *mutex_ptr);
383UINT tx_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option);
384UINT tx_mutex_put(TX_MUTEX *mutex_ptr);
385UINT tx_mutex_info_get(TX_MUTEX *mutex_ptr, TX_NAME_CONST CHAR **name, ULONG *count, TX_THREAD **owner,
386 TX_THREAD **first_suspended, ULONG *suspended_count, TX_MUTEX **next_mutex);
388
389/* ------------------------------------------------------------------------- */
390/* Semaphore */
391/* ------------------------------------------------------------------------- */
392
393UINT tx_semaphore_create(TX_SEMAPHORE *semaphore_ptr, TX_NAME_CONST CHAR *name_ptr, ULONG initial_count);
395UINT tx_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option);
396UINT tx_semaphore_put(TX_SEMAPHORE *semaphore_ptr);
397UINT tx_semaphore_ceiling_put(TX_SEMAPHORE *semaphore_ptr, ULONG ceiling);
398UINT tx_semaphore_info_get(TX_SEMAPHORE *semaphore_ptr, TX_NAME_CONST CHAR **name, ULONG *current_value,
399 TX_THREAD **first_suspended, ULONG *suspended_count, TX_SEMAPHORE **next_semaphore);
402 VOID (*semaphore_put_notify)(TX_SEMAPHORE *notify_semaphore_ptr));
403
404/* ------------------------------------------------------------------------- */
405/* Event flags */
406/* ------------------------------------------------------------------------- */
407
410UINT tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags, UINT get_option,
411 ULONG *actual_flags_ptr, ULONG wait_option);
412UINT tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, UINT set_option);
414 TX_THREAD **first_suspended, ULONG *suspended_count,
415 TX_EVENT_FLAGS_GROUP **next_group);
417 VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *notify_group_ptr));
418
419/* ------------------------------------------------------------------------- */
420/* Message queue */
421/* ------------------------------------------------------------------------- */
422
423UINT tx_queue_create(TX_QUEUE *queue_ptr, TX_NAME_CONST CHAR *name_ptr, UINT message_size,
424 VOID *queue_start, ULONG queue_size);
425UINT tx_queue_delete(TX_QUEUE *queue_ptr);
426UINT tx_queue_flush(TX_QUEUE *queue_ptr);
427UINT tx_queue_info_get(TX_QUEUE *queue_ptr, TX_NAME_CONST CHAR **name, ULONG *enqueued, ULONG *available_storage,
428 TX_THREAD **first_suspended, ULONG *suspended_count, TX_QUEUE **next_queue);
430UINT tx_queue_receive(TX_QUEUE *queue_ptr, VOID *destination_ptr, ULONG wait_option);
431UINT tx_queue_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
432UINT tx_queue_front_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
433UINT tx_queue_send_notify(TX_QUEUE *queue_ptr, VOID (*queue_send_notify)(TX_QUEUE *notify_queue_ptr));
434
435/* ------------------------------------------------------------------------- */
436/* Block memory pool */
437/* ------------------------------------------------------------------------- */
438
439UINT tx_block_pool_create(TX_BLOCK_POOL *pool_ptr, TX_NAME_CONST CHAR *name_ptr, ULONG block_size,
440 VOID *pool_start, ULONG pool_size);
442UINT tx_block_allocate(TX_BLOCK_POOL *pool_ptr, VOID **block_ptr, ULONG wait_option);
443UINT tx_block_release(VOID *block_ptr);
444UINT tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, TX_NAME_CONST CHAR **name, ULONG *available_blocks,
445 ULONG *total_blocks, TX_THREAD **first_suspended, ULONG *suspended_count,
446 TX_BLOCK_POOL **next_pool);
448
449/* ------------------------------------------------------------------------- */
450/* Byte memory pool */
451/* ------------------------------------------------------------------------- */
452
453UINT tx_byte_pool_create(TX_BYTE_POOL *pool_ptr, TX_NAME_CONST CHAR *name_ptr, VOID *pool_start, ULONG pool_size);
455UINT tx_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size, ULONG wait_option);
456UINT tx_byte_release(VOID *memory_ptr);
457UINT tx_byte_pool_info_get(TX_BYTE_POOL *pool_ptr, TX_NAME_CONST CHAR **name, ULONG *available_bytes,
458 ULONG *fragments, TX_THREAD **first_suspended, ULONG *suspended_count,
459 TX_BYTE_POOL **next_pool);
461
462/* ------------------------------------------------------------------------- */
463/* Application timer */
464/* ------------------------------------------------------------------------- */
465
466UINT tx_timer_create(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR *name_ptr,
467 VOID (*expiration_function)(ULONG input), ULONG expiration_input,
468 ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate);
469UINT tx_timer_delete(TX_TIMER *timer_ptr);
472UINT tx_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG reschedule_ticks);
473UINT tx_timer_info_get(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR **name, UINT *active, ULONG *remaining_ticks,
474 ULONG *reschedule_ticks, TX_TIMER **next_timer);
475
476/* ------------------------------------------------------------------------- */
477/* ThreadX macros commonly used by applications */
478/* ------------------------------------------------------------------------- */
479
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_); }
482
483#ifdef __cplusplus
484}
485#endif
486
488
489#endif /* TX_API_H */
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)
ULONG tx_time_get(void)
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
Definition tx_api.h:132
UINT tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr)
#define TX_STK_SEMAPHORE_STORAGE_WORDS
Definition tx_api.h:83
unsigned int UINT
Definition tx_api.h:124
#define TX_STK_TIMER_STORAGE_DWORDS
Definition tx_api.h:102
UINT tx_queue_create(TX_QUEUE *queue_ptr, const CHAR *name_ptr, UINT message_size, void *queue_start, ULONG queue_size)
int INT
Definition tx_api.h:123
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)
unsigned char UCHAR
Definition tx_api.h:122
void tx_thread_relinquish(void)
UINT tx_thread_preemption_change(TX_THREAD *thread_ptr, UINT new_threshold, UINT *old_threshold)
unsigned short USHORT
Definition tx_api.h:134
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
Definition tx_api.h:77
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)
uintptr_t ALIGN_TYPE
Definition tx_api.h:135
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)
#define VOID
Definition tx_api.h:120
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)
int LONG
Definition tx_api.h:129
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
Definition tx_api.h:80
short SHORT
Definition tx_api.h:133
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
Definition tx_api.h:99
struct TX_BLOCK_POOL_STRUCT TX_BLOCK_POOL
#define TX_STK_BYTE_POOL_STORAGE_WORDS
Definition tx_api.h:93
unsigned int ULONG
Definition tx_api.h:130
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
Definition tx_api.h:87
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)
char CHAR
Definition tx_api.h:121
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)
#define TX_NAME_CONST
Definition tx_api.h:137
UINT tx_timer_deactivate(TX_TIMER *timer_ptr)
struct TX_MUTEX_STRUCT TX_MUTEX
#define TX_STK_BLOCK_POOL_STORAGE_WORDS
Definition tx_api.h:90
void(* tx_thread_entry)(ULONG entry_input)
Definition tx_api.h:265
ULONG tx_thread_stack_size
Definition tx_api.h:259
UINT tx_thread_preempt_threshold
Definition tx_api.h:264
UINT tx_thread_stk_start_threshold
Definition tx_api.h:270
UINT tx_thread_stk_start_priority
Definition tx_api.h:269
UINT tx_thread_state
Definition tx_api.h:263
ULONG tx_thread_entry_parameter
Definition tx_api.h:266
ALIGN_TYPE tx_thread_stk_storage[(24U)]
Definition tx_api.h:272
void * tx_thread_stack_start
Definition tx_api.h:258
void(* tx_thread_entry_exit_notify)(struct TX_THREAD_STRUCT *thread_ptr, UINT condition)
Definition tx_api.h:267
ULONG tx_thread_id
Definition tx_api.h:256
ULONG tx_thread_run_count
Definition tx_api.h:257
ULONG tx_thread_stk_start_time_slice
Definition tx_api.h:271
ULONG tx_thread_time_slice
Definition tx_api.h:260
UINT tx_thread_priority
Definition tx_api.h:262
const CHAR * tx_thread_name
Definition tx_api.h:261
void * tx_thread_extension_ptr
Definition tx_api.h:268
const CHAR * tx_mutex_name
Definition tx_api.h:278
ULONG tx_mutex_id
Definition tx_api.h:277
ALIGN_TYPE tx_mutex_stk_storage[(16U)]
Definition tx_api.h:279
void(* tx_semaphore_put_notify)(struct TX_SEMAPHORE_STRUCT *notify_semaphore_ptr)
Definition tx_api.h:286
ULONG tx_semaphore_id
Definition tx_api.h:284
ALIGN_TYPE tx_semaphore_stk_storage[(16U)]
Definition tx_api.h:287
const CHAR * tx_semaphore_name
Definition tx_api.h:285
ULONG64 tx_event_flags_group_stk_storage[(16U)]
Definition tx_api.h:295
void(* tx_event_flags_group_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_group_ptr)
Definition tx_api.h:294
const CHAR * tx_event_flags_group_name
Definition tx_api.h:293
ALIGN_TYPE tx_queue_stk_storage[(48U)]
Definition tx_api.h:304
const CHAR * tx_queue_name
Definition tx_api.h:301
ULONG tx_queue_id
Definition tx_api.h:300
UINT tx_queue_message_size
Definition tx_api.h:302
void(* tx_queue_send_notify)(struct TX_QUEUE_STRUCT *notify_queue_ptr)
Definition tx_api.h:303
ALIGN_TYPE tx_block_pool_stk_storage[(32U)]
Definition tx_api.h:311
const CHAR * tx_block_pool_name
Definition tx_api.h:310
ALIGN_TYPE tx_byte_pool_stk_storage[(26U)]
Definition tx_api.h:318
ULONG tx_byte_pool_id
Definition tx_api.h:316
const CHAR * tx_byte_pool_name
Definition tx_api.h:317
ULONG tx_timer_expiration_input
Definition tx_api.h:328
ULONG tx_timer_id
Definition tx_api.h:325
ULONG tx_timer_initial_ticks
Definition tx_api.h:329
void(* tx_timer_expiration_function)(ULONG input)
Definition tx_api.h:327
ULONG64 tx_timer_stk_storage[(8U)]
Definition tx_api.h:331
ULONG tx_timer_reschedule_ticks
Definition tx_api.h:330
const CHAR * tx_timer_name
Definition tx_api.h:326