1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** ThreadX Component                                                     */
17 /**                                                                       */
18 /**   Application Interface (API)                                         */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  APPLICATION INTERFACE DEFINITION                       RELEASE        */
27 /*                                                                        */
28 /*    tx_api.h                                            PORTABLE C      */
29 /*                                                           6.1          */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    William E. Lamie, Microsoft Corporation                             */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file defines the basic Application Interface (API) to the      */
37 /*    high-performance ThreadX real-time kernel.  All service prototypes  */
38 /*    and data structure definitions are defined in this file.            */
39 /*    Please note that basic data type definitions and other architecture-*/
40 /*    specific information is contained in the file tx_port.h.            */
41 /*                                                                        */
42 /*  RELEASE HISTORY                                                       */
43 /*                                                                        */
44 /*    DATE              NAME                      DESCRIPTION             */
45 /*                                                                        */
46 /*  05-19-2020     William E. Lamie         Initial Version 6.0           */
47 /*  09-30-2020     William E. Lamie         Modified comment(s), and      */
48 /*                                            updated product constants,  */
49 /*                                            added new thread execution  */
50 /*                                            state TX_PRIORITY_CHANGE,   */
51 /*                                            added macros for casting    */
52 /*                                            pointers to ALIGN_TYPE,     */
53 /*                                            resulting in version 6.1    */
54 /*                                                                        */
55 /**************************************************************************/
56 
57 #ifndef TX_API_H
58 #define TX_API_H
59 
60 
61 /* Determine if a C++ compiler is being used.  If so, ensure that standard
62    C is used to process the API information.  */
63 
64 #ifdef __cplusplus
65 
66 /* Yes, C++ compiler is present.  Use standard C.  */
67 extern   "C" {
68 
69 #endif
70 
71 
72 /* Include the port-specific data type file.  */
73 
74 #include "tx_port.h"
75 
76 
77 /* Define basic constants for the ThreadX kernel.  */
78 
79 
80 /* Define the major/minor version information that can be used by the application
81    and the ThreadX source as well.  */
82 
83 #define AZURE_RTOS_THREADX
84 #define THREADX_MAJOR_VERSION           6
85 #define THREADX_MINOR_VERSION           1
86 #define THREADX_PATCH_VERSION           0
87 
88 /* Define the following symbol for backward compatibility */
89 #define EL_PRODUCT_THREADX
90 
91 
92 /* API input parameters and general constants.  */
93 
94 #define TX_NO_WAIT                      ((ULONG)  0)
95 #define TX_WAIT_FOREVER                 ((ULONG)  0xFFFFFFFFUL)
96 #define TX_AND                          ((UINT)   2)
97 #define TX_AND_CLEAR                    ((UINT)   3)
98 #define TX_OR                           ((UINT)   0)
99 #define TX_OR_CLEAR                     ((UINT)   1)
100 #define TX_1_ULONG                      ((UINT)   1)
101 #define TX_2_ULONG                      ((UINT)   2)
102 #define TX_4_ULONG                      ((UINT)   4)
103 #define TX_8_ULONG                      ((UINT)   8)
104 #define TX_16_ULONG                     ((UINT)   16)
105 #define TX_NO_TIME_SLICE                ((ULONG)  0)
106 #define TX_AUTO_START                   ((UINT)   1)
107 #define TX_DONT_START                   ((UINT)   0)
108 #define TX_AUTO_ACTIVATE                ((UINT)   1)
109 #define TX_NO_ACTIVATE                  ((UINT)   0)
110 #define TX_TRUE                         ((UINT)   1)
111 #define TX_FALSE                        ((UINT)   0)
112 #define TX_NULL                         ((void *) 0)
113 #define TX_INHERIT                      ((UINT)   1)
114 #define TX_NO_INHERIT                   ((UINT)   0)
115 #define TX_THREAD_ENTRY                 ((UINT)   0)
116 #define TX_THREAD_EXIT                  ((UINT)   1)
117 #define TX_NO_SUSPENSIONS               ((UINT)   0)
118 #define TX_NO_MESSAGES                  ((UINT)   0)
119 #define TX_EMPTY                        ((ULONG)  0)
120 #define TX_CLEAR_ID                     ((ULONG)  0)
121 #define TX_STACK_FILL                   ((ULONG)  0xEFEFEFEFUL)
122 
123 
124 /* Thread execution state values.  */
125 
126 #define TX_READY                        ((UINT) 0)
127 #define TX_COMPLETED                    ((UINT) 1)
128 #define TX_TERMINATED                   ((UINT) 2)
129 #define TX_SUSPENDED                    ((UINT) 3)
130 #define TX_SLEEP                        ((UINT) 4)
131 #define TX_QUEUE_SUSP                   ((UINT) 5)
132 #define TX_SEMAPHORE_SUSP               ((UINT) 6)
133 #define TX_EVENT_FLAG                   ((UINT) 7)
134 #define TX_BLOCK_MEMORY                 ((UINT) 8)
135 #define TX_BYTE_MEMORY                  ((UINT) 9)
136 #define TX_IO_DRIVER                    ((UINT) 10)
137 #define TX_FILE                         ((UINT) 11)
138 #define TX_TCP_IP                       ((UINT) 12)
139 #define TX_MUTEX_SUSP                   ((UINT) 13)
140 #define TX_PRIORITY_CHANGE              ((UINT) 14)
141 
142 
143 /* API return values.  */
144 
145 #define TX_SUCCESS                      ((UINT) 0x00)
146 #define TX_DELETED                      ((UINT) 0x01)
147 #define TX_NO_MEMORY                    ((UINT) 0x10)
148 #define TX_POOL_ERROR                   ((UINT) 0x02)
149 #define TX_PTR_ERROR                    ((UINT) 0x03)
150 #define TX_WAIT_ERROR                   ((UINT) 0x04)
151 #define TX_SIZE_ERROR                   ((UINT) 0x05)
152 #define TX_GROUP_ERROR                  ((UINT) 0x06)
153 #define TX_NO_EVENTS                    ((UINT) 0x07)
154 #define TX_OPTION_ERROR                 ((UINT) 0x08)
155 #define TX_QUEUE_ERROR                  ((UINT) 0x09)
156 #define TX_QUEUE_EMPTY                  ((UINT) 0x0A)
157 #define TX_QUEUE_FULL                   ((UINT) 0x0B)
158 #define TX_SEMAPHORE_ERROR              ((UINT) 0x0C)
159 #define TX_NO_INSTANCE                  ((UINT) 0x0D)
160 #define TX_THREAD_ERROR                 ((UINT) 0x0E)
161 #define TX_PRIORITY_ERROR               ((UINT) 0x0F)
162 #define TX_START_ERROR                  ((UINT) 0x10)
163 #define TX_DELETE_ERROR                 ((UINT) 0x11)
164 #define TX_RESUME_ERROR                 ((UINT) 0x12)
165 #define TX_CALLER_ERROR                 ((UINT) 0x13)
166 #define TX_SUSPEND_ERROR                ((UINT) 0x14)
167 #define TX_TIMER_ERROR                  ((UINT) 0x15)
168 #define TX_TICK_ERROR                   ((UINT) 0x16)
169 #define TX_ACTIVATE_ERROR               ((UINT) 0x17)
170 #define TX_THRESH_ERROR                 ((UINT) 0x18)
171 #define TX_SUSPEND_LIFTED               ((UINT) 0x19)
172 #define TX_WAIT_ABORTED                 ((UINT) 0x1A)
173 #define TX_WAIT_ABORT_ERROR             ((UINT) 0x1B)
174 #define TX_MUTEX_ERROR                  ((UINT) 0x1C)
175 #define TX_NOT_AVAILABLE                ((UINT) 0x1D)
176 #define TX_NOT_OWNED                    ((UINT) 0x1E)
177 #define TX_INHERIT_ERROR                ((UINT) 0x1F)
178 #define TX_NOT_DONE                     ((UINT) 0x20)
179 #define TX_CEILING_EXCEEDED             ((UINT) 0x21)
180 #define TX_INVALID_CEILING              ((UINT) 0x22)
181 #define TX_FEATURE_NOT_ENABLED          ((UINT) 0xFF)
182 
183 
184 /* Define the common timer tick reference for use by other middleware components. The default
185    value is 10ms, but may be replaced by a port specific version in tx_port.h or by the user
186    as a compilation option.  */
187 
188 #ifndef TX_TIMER_TICKS_PER_SECOND
189 #define TX_TIMER_TICKS_PER_SECOND       ((ULONG) 100)
190 #endif
191 
192 
193 /* Event numbers 0 through 4095 are reserved by Azure RTOS. Specific event assignments are:
194 
195                                 ThreadX events:     1-199
196                                 FileX events:       200-299
197                                 NetX events:        300-599
198                                 USBX events:        600-999
199                                 GUIX events:        1000-1500
200 
201    User-defined event numbers start at 4096 and continue through 65535, as defined by the constants
202    TX_TRACE_USER_EVENT_START and TX_TRACE_USER_EVENT_END, respectively. User events should be based
203    on these constants in case the user event number assignment is changed in future releases.  */
204 
205 #define TX_TRACE_USER_EVENT_START           4096            /* I1, I2, I3, I4 are user defined           */
206 #define TX_TRACE_USER_EVENT_END             65535           /* I1, I2, I3, I4 are user defined           */
207 
208 
209 /* Define event filters that can be used to selectively disable certain events or groups of events.  */
210 
211 #define TX_TRACE_ALL_EVENTS                 0x000007FF      /* All ThreadX events                        */
212 #define TX_TRACE_INTERNAL_EVENTS            0x00000001      /* ThreadX internal events                   */
213 #define TX_TRACE_BLOCK_POOL_EVENTS          0x00000002      /* ThreadX Block Pool events                 */
214 #define TX_TRACE_BYTE_POOL_EVENTS           0x00000004      /* ThreadX Byte Pool events                  */
215 #define TX_TRACE_EVENT_FLAGS_EVENTS         0x00000008      /* ThreadX Event Flags events                */
216 #define TX_TRACE_INTERRUPT_CONTROL_EVENT    0x00000010      /* ThreadX Interrupt Control events          */
217 #define TX_TRACE_MUTEX_EVENTS               0x00000020      /* ThreadX Mutex events                      */
218 #define TX_TRACE_QUEUE_EVENTS               0x00000040      /* ThreadX Queue events                      */
219 #define TX_TRACE_SEMAPHORE_EVENTS           0x00000080      /* ThreadX Semaphore events                  */
220 #define TX_TRACE_THREAD_EVENTS              0x00000100      /* ThreadX Thread events                     */
221 #define TX_TRACE_TIME_EVENTS                0x00000200      /* ThreadX Time events                       */
222 #define TX_TRACE_TIMER_EVENTS               0x00000400      /* ThreadX Timer events                      */
223 #define TX_TRACE_USER_EVENTS                0x80000000UL    /* ThreadX User Events                       */
224 
225 
226 /* Define basic alignment type used in block and byte pool operations. This data type must
227    be at least 32-bits in size and also be large enough to hold a pointer type.  */
228 
229 #ifndef ALIGN_TYPE_DEFINED
230 #define ALIGN_TYPE      ULONG
231 #endif
232 
233 
234 /* Define the control block definitions for all system objects.  */
235 
236 
237 /* Define the basic timer management structures.  These are the structures
238    used to manage thread sleep, timeout, and user timer requests.  */
239 
240 /* Determine if the internal timer control block has an extension defined. If not,
241    define the extension to whitespace.  */
242 
243 #ifndef TX_TIMER_INTERNAL_EXTENSION
244 #define TX_TIMER_INTERNAL_EXTENSION
245 #endif
246 
247 
248 /* Define the common internal timer control block.  */
249 
250 typedef struct TX_TIMER_INTERNAL_STRUCT
251 {
252 
253     /* Define the remaining ticks and re-initialization tick values.  */
254     ULONG               tx_timer_internal_remaining_ticks;
255     ULONG               tx_timer_internal_re_initialize_ticks;
256 
257     /* Define the timeout function and timeout function parameter.  */
258     VOID                (*tx_timer_internal_timeout_function)(ULONG id);
259     ULONG               tx_timer_internal_timeout_param;
260 
261 
262     /* Define the next and previous internal link pointers for active
263        internal timers.  */
264     struct TX_TIMER_INTERNAL_STRUCT
265                         *tx_timer_internal_active_next,
266                         *tx_timer_internal_active_previous;
267 
268     /* Keep track of the pointer to the head of this list as well.  */
269     struct TX_TIMER_INTERNAL_STRUCT
270                         **tx_timer_internal_list_head;
271 
272     /* Define optional extension to internal timer control block.  */
273     TX_TIMER_INTERNAL_EXTENSION
274 
275 } TX_TIMER_INTERNAL;
276 
277 
278 /* Determine if the timer control block has an extension defined. If not,
279    define the extension to whitespace.  */
280 
281 #ifndef TX_TIMER_EXTENSION
282 #define TX_TIMER_EXTENSION
283 #endif
284 
285 
286 /* Define the timer structure utilized by the application.  */
287 
288 typedef struct TX_TIMER_STRUCT
289 {
290 
291     /* Define the timer ID used for error checking.  */
292     ULONG               tx_timer_id;
293 
294     /* Define the timer's name.  */
295     CHAR                *tx_timer_name;
296 
297     /* Define the actual contents of the timer.  This is the block that
298        is used in the actual timer expiration processing.  */
299     TX_TIMER_INTERNAL   tx_timer_internal;
300 
301     /* Define the pointers for the created list.  */
302     struct TX_TIMER_STRUCT
303                         *tx_timer_created_next,
304                         *tx_timer_created_previous;
305 
306     /* Define optional extension to timer control block.  */
307     TX_TIMER_EXTENSION
308 
309 #ifdef TX_TIMER_ENABLE_PERFORMANCE_INFO
310 
311     /* Define the number of timer activations.  */
312     ULONG               tx_timer_performance_activate_count;
313 
314     /* Define the number of timer reactivations.  */
315     ULONG               tx_timer_performance_reactivate_count;
316 
317     /* Define the number of timer deactivations.  */
318     ULONG               tx_timer_performance_deactivate_count;
319 
320     /* Define the number of timer expirations.  */
321     ULONG               tx_timer_performance_expiration_count;
322 
323     /* Define the total number of timer expiration adjustments.  */
324     ULONG               tx_timer_performance__expiration_adjust_count;
325 #endif
326 
327 } TX_TIMER;
328 
329 
330 /* ThreadX thread control block structure follows.  Additional fields
331    can be added providing they are added after the information that is
332    referenced in the port-specific assembly code.  */
333 
334 typedef struct TX_THREAD_STRUCT
335 {
336     /* The first section of the control block contains critical
337        information that is referenced by the port-specific
338        assembly language code.  Any changes in this section could
339        necessitate changes in the assembly language.  */
340 
341     ULONG               tx_thread_id;                   /* Control block ID         */
342     ULONG               tx_thread_run_count;            /* Thread's run counter     */
343     VOID                *tx_thread_stack_ptr;           /* Thread's stack pointer   */
344     VOID                *tx_thread_stack_start;         /* Stack starting address   */
345     VOID                *tx_thread_stack_end;           /* Stack ending address     */
346     ULONG               tx_thread_stack_size;           /* Stack size               */
347     ULONG               tx_thread_time_slice;           /* Current time-slice       */
348     ULONG               tx_thread_new_time_slice;       /* New time-slice           */
349 
350     /* Define pointers to the next and previous ready threads.  */
351     struct TX_THREAD_STRUCT
352                         *tx_thread_ready_next,
353                         *tx_thread_ready_previous;
354 
355     /***************************************************************/
356 
357     /* Define the first port extension in the thread control block. This
358        is typically defined to whitespace or a pointer type in tx_port.h.  */
359     TX_THREAD_EXTENSION_0
360 
361     CHAR                *tx_thread_name;                /* Pointer to thread's name     */
362     UINT                tx_thread_priority;             /* Priority of thread (0-1023)  */
363     UINT                tx_thread_state;                /* Thread's execution state     */
364     UINT                tx_thread_delayed_suspend;      /* Delayed suspend flag         */
365     UINT                tx_thread_suspending;           /* Thread suspending flag       */
366     UINT                tx_thread_preempt_threshold;    /* Preemption threshold         */
367 
368     /* Define the thread schedule hook. The usage of this is port/application specific,
369        but when used, the function pointer designated is called whenever the thread is
370        scheduled and unscheduled.  */
371     VOID                (*tx_thread_schedule_hook)(struct TX_THREAD_STRUCT *thread_ptr, ULONG id);
372 
373     /* Nothing after this point is referenced by the target-specific
374        assembly language.  Hence, information after this point can
375        be added to the control block providing the complete system
376        is recompiled.  */
377 
378     /* Define the thread's entry point and input parameter.  */
379     VOID                (*tx_thread_entry)(ULONG id);
380     ULONG               tx_thread_entry_parameter;
381 
382     /* Define the thread's timer block.   This is used for thread
383        sleep and timeout requests.  */
384     TX_TIMER_INTERNAL   tx_thread_timer;
385 
386     /* Define the thread's cleanup function and associated data.  This
387        is used to cleanup various data structures when a thread
388        suspension is lifted or terminated either by the user or
389        a timeout.  */
390     VOID                (*tx_thread_suspend_cleanup)(struct TX_THREAD_STRUCT *thread_ptr, ULONG suspension_sequence);
391     VOID                *tx_thread_suspend_control_block;
392     struct TX_THREAD_STRUCT
393                         *tx_thread_suspended_next,
394                         *tx_thread_suspended_previous;
395     ULONG               tx_thread_suspend_info;
396     VOID                *tx_thread_additional_suspend_info;
397     UINT                tx_thread_suspend_option;
398     UINT                tx_thread_suspend_status;
399 
400     /* Define the second port extension in the thread control block. This
401        is typically defined to whitespace or a pointer type in tx_port.h.  */
402     TX_THREAD_EXTENSION_1
403 
404     /* Define pointers to the next and previous threads in the
405        created list.  */
406     struct TX_THREAD_STRUCT
407                         *tx_thread_created_next,
408                         *tx_thread_created_previous;
409 
410     /* Define the third port extension in the thread control block. This
411        is typically defined to whitespace in tx_port.h.  */
412     TX_THREAD_EXTENSION_2
413 
414     /* Define a pointer type for FileX extensions.  */
415     VOID                *tx_thread_filex_ptr;
416 
417     /* Define the priority inheritance variables. These will be used
418        to manage priority inheritance changes applied to this thread
419        as a result of mutex get operations.  */
420     UINT                tx_thread_user_priority;
421     UINT                tx_thread_user_preempt_threshold;
422     UINT                tx_thread_inherit_priority;
423 
424     /* Define the owned mutex count and list head pointer.  */
425     UINT                tx_thread_owned_mutex_count;
426     struct TX_MUTEX_STRUCT
427                         *tx_thread_owned_mutex_list;
428 
429 #ifdef TX_THREAD_ENABLE_PERFORMANCE_INFO
430 
431     /* Define the number of times this thread is resumed.  */
432     ULONG               tx_thread_performance_resume_count;
433 
434     /* Define the number of times this thread suspends.  */
435     ULONG               tx_thread_performance_suspend_count;
436 
437     /* Define the number of times this thread is preempted by calling
438        a ThreadX API service.  */
439     ULONG               tx_thread_performance_solicited_preemption_count;
440 
441     /* Define the number of times this thread is preempted by an
442        ISR calling a ThreadX API service.  */
443     ULONG               tx_thread_performance_interrupt_preemption_count;
444 
445     /* Define the number of priority inversions for this thread.  */
446     ULONG               tx_thread_performance_priority_inversion_count;
447 
448     /* Define the last thread pointer to preempt this thread.  */
449     struct TX_THREAD_STRUCT
450                         *tx_thread_performance_last_preempting_thread;
451 
452     /* Define the total number of times this thread was time-sliced.  */
453     ULONG               tx_thread_performance_time_slice_count;
454 
455     /* Define the total number of times this thread relinquishes.  */
456     ULONG               tx_thread_performance_relinquish_count;
457 
458     /* Define the total number of times this thread had a timeout.  */
459     ULONG               tx_thread_performance_timeout_count;
460 
461     /* Define the total number of times this thread had suspension lifted
462        because of the tx_thread_wait_abort service.  */
463     ULONG               tx_thread_performance_wait_abort_count;
464 #endif
465 
466     /* Define the highest stack pointer variable.  */
467     VOID                *tx_thread_stack_highest_ptr;   /* Stack highest usage pointer  */
468 
469 
470 #ifndef TX_DISABLE_NOTIFY_CALLBACKS
471 
472     /* Define the application callback routine used to notify the application when
473        the thread is entered or exits.  */
474     VOID                (*tx_thread_entry_exit_notify)(struct TX_THREAD_STRUCT *thread_ptr, UINT type);
475 #endif
476 
477     /* Define the fourth port extension in the thread control block. This
478        is typically defined to whitespace in tx_port.h.  */
479     TX_THREAD_EXTENSION_3
480 
481     /* Define suspension sequence number.  This is used to ensure suspension is still valid when
482        cleanup routine executes.  */
483     ULONG               tx_thread_suspension_sequence;
484 
485     /* Define the user extension field.  This typically is defined
486        to white space, but some ports of ThreadX may need to have
487        additional fields in the thread control block.  This is
488        defined in the file tx_port.h.  */
489     TX_THREAD_USER_EXTENSION
490 
491 } TX_THREAD;
492 
493 
494 /* Define the block memory pool structure utilized by the application.  */
495 
496 typedef struct TX_BLOCK_POOL_STRUCT
497 {
498 
499     /* Define the block pool ID used for error checking.  */
500     ULONG               tx_block_pool_id;
501 
502     /* Define the block pool's name.  */
503     CHAR                *tx_block_pool_name;
504 
505     /* Define the number of available memory blocks in the pool.  */
506     UINT                tx_block_pool_available;
507 
508     /* Save the initial number of blocks.  */
509     UINT                tx_block_pool_total;
510 
511     /* Define the head pointer of the available block pool.  */
512     UCHAR               *tx_block_pool_available_list;
513 
514     /* Save the start address of the block pool's memory area.  */
515     UCHAR               *tx_block_pool_start;
516 
517     /* Save the block pool's size in bytes.  */
518     ULONG               tx_block_pool_size;
519 
520     /* Save the individual memory block size - rounded for alignment.  */
521     UINT                tx_block_pool_block_size;
522 
523     /* Define the block pool suspension list head along with a count of
524        how many threads are suspended.  */
525     struct TX_THREAD_STRUCT
526                         *tx_block_pool_suspension_list;
527     UINT                tx_block_pool_suspended_count;
528 
529     /* Define the created list next and previous pointers.  */
530     struct TX_BLOCK_POOL_STRUCT
531                         *tx_block_pool_created_next,
532                         *tx_block_pool_created_previous;
533 
534 #ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
535 
536     /* Define the number of block allocates.  */
537     ULONG               tx_block_pool_performance_allocate_count;
538 
539     /* Define the number of block releases.  */
540     ULONG               tx_block_pool_performance_release_count;
541 
542     /* Define the number of block pool suspensions.  */
543     ULONG               tx_block_pool_performance_suspension_count;
544 
545     /* Define the number of block pool timeouts.  */
546     ULONG               tx_block_pool_performance_timeout_count;
547 #endif
548 
549     /* Define the port extension in the block pool control block. This
550        is typically defined to whitespace in tx_port.h.  */
551     TX_BLOCK_POOL_EXTENSION
552 
553 } TX_BLOCK_POOL;
554 
555 
556 /* Determine if the byte allocate extension is defined. If not, define the
557    extension to whitespace.  */
558 
559 #ifndef TX_BYTE_ALLOCATE_EXTENSION
560 #define TX_BYTE_ALLOCATE_EXTENSION
561 #endif
562 
563 
564 /* Determine if the byte release extension is defined. If not, define the
565    extension to whitespace.  */
566 
567 #ifndef TX_BYTE_RELEASE_EXTENSION
568 #define TX_BYTE_RELEASE_EXTENSION
569 #endif
570 
571 
572 /* Define the byte memory pool structure utilized by the application.  */
573 
574 typedef struct TX_BYTE_POOL_STRUCT
575 {
576 
577     /* Define the byte pool ID used for error checking.  */
578     ULONG               tx_byte_pool_id;
579 
580     /* Define the byte pool's name.  */
581     CHAR                *tx_byte_pool_name;
582 
583     /* Define the number of available bytes in the pool.  */
584     ULONG               tx_byte_pool_available;
585 
586     /* Define the number of fragments in the pool.  */
587     UINT                tx_byte_pool_fragments;
588 
589     /* Define the head pointer of byte pool.  */
590     UCHAR               *tx_byte_pool_list;
591 
592     /* Define the search pointer used for initial searching for memory
593        in a byte pool.  */
594     UCHAR               *tx_byte_pool_search;
595 
596     /* Save the start address of the byte pool's memory area.  */
597     UCHAR               *tx_byte_pool_start;
598 
599     /* Save the byte pool's size in bytes.  */
600     ULONG               tx_byte_pool_size;
601 
602     /* This is used to mark the owner of the byte memory pool during
603        a search.  If this value changes during the search, the local search
604        pointer must be reset.  */
605     struct TX_THREAD_STRUCT
606                         *tx_byte_pool_owner;
607 
608     /* Define the byte pool suspension list head along with a count of
609        how many threads are suspended.  */
610     struct TX_THREAD_STRUCT
611                         *tx_byte_pool_suspension_list;
612     UINT                tx_byte_pool_suspended_count;
613 
614     /* Define the created list next and previous pointers.  */
615     struct TX_BYTE_POOL_STRUCT
616                         *tx_byte_pool_created_next,
617                         *tx_byte_pool_created_previous;
618 
619 #ifdef TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO
620 
621     /* Define the number of allocates.  */
622     ULONG               tx_byte_pool_performance_allocate_count;
623 
624     /* Define the number of releases.  */
625     ULONG               tx_byte_pool_performance_release_count;
626 
627     /* Define the number of adjacent memory fragment merges.  */
628     ULONG               tx_byte_pool_performance_merge_count;
629 
630     /* Define the number of memory fragment splits.  */
631     ULONG               tx_byte_pool_performance_split_count;
632 
633     /* Define the number of memory fragments searched that either were not free or could not satisfy the
634        request.  */
635     ULONG               tx_byte_pool_performance_search_count;
636 
637     /* Define the number of byte pool suspensions.  */
638     ULONG               tx_byte_pool_performance_suspension_count;
639 
640     /* Define the number of byte pool timeouts.  */
641     ULONG               tx_byte_pool_performance_timeout_count;
642 #endif
643 
644     /* Define the port extension in the byte pool control block. This
645        is typically defined to whitespace in tx_port.h.  */
646     TX_BYTE_POOL_EXTENSION
647 
648 } TX_BYTE_POOL;
649 
650 
651 /* Define the event flags group structure utilized by the application.  */
652 
653 typedef struct TX_EVENT_FLAGS_GROUP_STRUCT
654 {
655 
656     /* Define the event flags group ID used for error checking.  */
657     ULONG               tx_event_flags_group_id;
658 
659     /* Define the event flags group's name.  */
660     CHAR                *tx_event_flags_group_name;
661 
662     /* Define the actual current event flags in this group. A zero in a
663        particular bit indicates the event flag is not set.  */
664     ULONG               tx_event_flags_group_current;
665 
666     /* Define the reset search flag that is set when an ISR sets flags during
667        the search of the suspended threads list.  */
668     UINT                tx_event_flags_group_reset_search;
669 
670     /* Define the event flags group suspension list head along with a count of
671        how many threads are suspended.  */
672     struct TX_THREAD_STRUCT
673                         *tx_event_flags_group_suspension_list;
674     UINT                tx_event_flags_group_suspended_count;
675 
676     /* Define the created list next and previous pointers.  */
677     struct TX_EVENT_FLAGS_GROUP_STRUCT
678                         *tx_event_flags_group_created_next,
679                         *tx_event_flags_group_created_previous;
680 
681     /* Define the delayed clearing event flags.  */
682     ULONG               tx_event_flags_group_delayed_clear;
683 
684 #ifdef TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO
685 
686     /* Define the number of event flag sets.  */
687     ULONG               tx_event_flags_group_performance_set_count;
688 
689     /* Define the number of event flag gets.  */
690     ULONG               tx_event_flags_group__performance_get_count;
691 
692     /* Define the number of event flag suspensions.  */
693     ULONG               tx_event_flags_group___performance_suspension_count;
694 
695     /* Define the number of event flag timeouts.  */
696     ULONG               tx_event_flags_group____performance_timeout_count;
697 #endif
698 
699 #ifndef TX_DISABLE_NOTIFY_CALLBACKS
700 
701     /* Define the application callback routine used to notify the application when
702        an event flag is set.  */
703     VOID                (*tx_event_flags_group_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *group_ptr);
704 #endif
705 
706     /* Define the port extension in the event flags group control block. This
707        is typically defined to whitespace in tx_port.h.  */
708     TX_EVENT_FLAGS_GROUP_EXTENSION
709 
710 } TX_EVENT_FLAGS_GROUP;
711 
712 
713 /* Determine if the mutex put extension 1 is defined. If not, define the
714    extension to whitespace.  */
715 
716 #ifndef TX_MUTEX_PUT_EXTENSION_1
717 #define TX_MUTEX_PUT_EXTENSION_1
718 #endif
719 
720 
721 /* Determine if the mutex put extension 2 is defined. If not, define the
722    extension to whitespace.  */
723 
724 #ifndef TX_MUTEX_PUT_EXTENSION_2
725 #define TX_MUTEX_PUT_EXTENSION_2
726 #endif
727 
728 
729 /* Determine if the mutex priority change extension is defined. If not, define the
730    extension to whitespace.  */
731 
732 #ifndef TX_MUTEX_PRIORITY_CHANGE_EXTENSION
733 #define TX_MUTEX_PRIORITY_CHANGE_EXTENSION
734 #endif
735 
736 
737 /* Define the mutex structure utilized by the application.  */
738 
739 typedef struct TX_MUTEX_STRUCT
740 {
741 
742     /* Define the mutex ID used for error checking.  */
743     ULONG               tx_mutex_id;
744 
745     /* Define the mutex's name.  */
746     CHAR                *tx_mutex_name;
747 
748     /* Define the mutex ownership count.  */
749     UINT                tx_mutex_ownership_count;
750 
751     /* Define the mutex ownership pointer.  This pointer points to the
752        the thread that owns the mutex.  */
753     TX_THREAD           *tx_mutex_owner;
754 
755     /* Define the priority inheritance flag.  If this flag is set, priority
756        inheritance will be in effect.  */
757     UINT                tx_mutex_inherit;
758 
759     /* Define the save area for the owning thread's original priority.  */
760     UINT                tx_mutex_original_priority;
761 
762     /* Define the mutex suspension list head along with a count of
763        how many threads are suspended.  */
764     struct TX_THREAD_STRUCT
765                         *tx_mutex_suspension_list;
766     UINT                tx_mutex_suspended_count;
767 
768     /* Define the created list next and previous pointers.  */
769     struct TX_MUTEX_STRUCT
770                         *tx_mutex_created_next,
771                         *tx_mutex_created_previous;
772 
773     /* Define the priority of the highest priority thread waiting for
774        this mutex.  */
775     UINT                tx_mutex_highest_priority_waiting;
776 
777     /* Define the owned list next and previous pointers.  */
778     struct TX_MUTEX_STRUCT
779                         *tx_mutex_owned_next,
780                         *tx_mutex_owned_previous;
781 
782 #ifdef TX_MUTEX_ENABLE_PERFORMANCE_INFO
783 
784     /* Define the number of mutex puts.  */
785     ULONG               tx_mutex_performance_put_count;
786 
787     /* Define the total number of mutex gets.  */
788     ULONG               tx_mutex_performance_get_count;
789 
790     /* Define the total number of mutex suspensions.  */
791     ULONG               tx_mutex_performance_suspension_count;
792 
793     /* Define the total number of mutex timeouts.  */
794     ULONG               tx_mutex_performance_timeout_count;
795 
796     /* Define the total number of priority inversions.  */
797     ULONG               tx_mutex_performance_priority_inversion_count;
798 
799     /* Define the total number of priority inheritance conditions.  */
800     ULONG               tx_mutex_performance__priority_inheritance_count;
801 #endif
802 
803     /* Define the port extension in the mutex control block. This
804        is typically defined to whitespace in tx_port.h.  */
805     TX_MUTEX_EXTENSION
806 
807 } TX_MUTEX;
808 
809 
810 /* Define the queue structure utilized by the application.  */
811 
812 typedef struct TX_QUEUE_STRUCT
813 {
814 
815     /* Define the queue ID used for error checking.  */
816     ULONG               tx_queue_id;
817 
818     /* Define the queue's name.  */
819     CHAR                *tx_queue_name;
820 
821     /* Define the message size that was specified in queue creation.  */
822     UINT                tx_queue_message_size;
823 
824     /* Define the total number of messages in the queue.  */
825     UINT                tx_queue_capacity;
826 
827     /* Define the current number of messages enqueued and the available
828        queue storage space.  */
829     UINT                tx_queue_enqueued;
830     UINT                tx_queue_available_storage;
831 
832     /* Define pointers that represent the start and end for the queue's
833        message area.  */
834     ULONG               *tx_queue_start;
835     ULONG               *tx_queue_end;
836 
837     /* Define the queue read and write pointers.  Send requests use the write
838        pointer while receive requests use the read pointer.  */
839     ULONG               *tx_queue_read;
840     ULONG               *tx_queue_write;
841 
842     /* Define the queue suspension list head along with a count of
843        how many threads are suspended.  */
844     struct TX_THREAD_STRUCT
845                         *tx_queue_suspension_list;
846     UINT                tx_queue_suspended_count;
847 
848     /* Define the created list next and previous pointers.  */
849     struct TX_QUEUE_STRUCT
850                         *tx_queue_created_next,
851                         *tx_queue_created_previous;
852 
853 #ifdef TX_QUEUE_ENABLE_PERFORMANCE_INFO
854 
855     /* Define the number of messages sent to this queue.  */
856     ULONG               tx_queue_performance_messages_sent_count;
857 
858     /* Define the number of messages received from this queue.  */
859     ULONG               tx_queue_performance_messages_received_count;
860 
861     /* Define the number of empty suspensions on this queue.  */
862     ULONG               tx_queue_performance_empty_suspension_count;
863 
864     /* Define the number of full suspensions on this queue.  */
865     ULONG               tx_queue_performance_full_suspension_count;
866 
867     /* Define the number of full non-suspensions on this queue. These
868        messages are rejected with an appropriate error code.  */
869     ULONG               tx_queue_performance_full_error_count;
870 
871     /* Define the number of queue timeouts.  */
872     ULONG               tx_queue_performance_timeout_count;
873 #endif
874 
875 #ifndef TX_DISABLE_NOTIFY_CALLBACKS
876 
877     /* Define the application callback routine used to notify the application when
878        the a message is sent to the queue.  */
879     VOID                (*tx_queue_send_notify)(struct TX_QUEUE_STRUCT *queue_ptr);
880 #endif
881 
882     /* Define the port extension in the queue control block. This
883        is typically defined to whitespace in tx_port.h.  */
884     TX_QUEUE_EXTENSION
885 
886 } TX_QUEUE;
887 
888 
889 /* Define the semaphore structure utilized by the application.  */
890 
891 typedef struct TX_SEMAPHORE_STRUCT
892 {
893 
894     /* Define the semaphore ID used for error checking.  */
895     ULONG               tx_semaphore_id;
896 
897     /* Define the semaphore's name.  */
898     CHAR                *tx_semaphore_name;
899 
900     /* Define the actual semaphore count.  A zero means that no semaphore
901        instance is available.  */
902     ULONG               tx_semaphore_count;
903 
904     /* Define the semaphore suspension list head along with a count of
905        how many threads are suspended.  */
906     struct TX_THREAD_STRUCT
907                         *tx_semaphore_suspension_list;
908     UINT                tx_semaphore_suspended_count;
909 
910     /* Define the created list next and previous pointers.  */
911     struct TX_SEMAPHORE_STRUCT
912                         *tx_semaphore_created_next,
913                         *tx_semaphore_created_previous;
914 
915 #ifdef TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO
916 
917     /* Define the number of semaphore puts.  */
918     ULONG               tx_semaphore_performance_put_count;
919 
920     /* Define the number of semaphore gets.  */
921     ULONG               tx_semaphore_performance_get_count;
922 
923     /* Define the number of semaphore suspensions.  */
924     ULONG               tx_semaphore_performance_suspension_count;
925 
926     /* Define the number of semaphore timeouts.  */
927     ULONG               tx_semaphore_performance_timeout_count;
928 #endif
929 
930 #ifndef TX_DISABLE_NOTIFY_CALLBACKS
931 
932     /* Define the application callback routine used to notify the application when
933        the a semaphore is put.  */
934     VOID                (*tx_semaphore_put_notify)(struct TX_SEMAPHORE_STRUCT *semaphore_ptr);
935 #endif
936 
937     /* Define the port extension in the semaphore control block. This
938        is typically defined to whitespace in tx_port.h.  */
939     TX_SEMAPHORE_EXTENSION
940 
941 } TX_SEMAPHORE;
942 
943 
944 /* Define the system API mappings based on the error checking
945    selected by the user.  Note: this section is only applicable to
946    application source code, hence the conditional that turns off this
947    stuff when the include file is processed by the ThreadX source. */
948 
949 #ifndef TX_SOURCE_CODE
950 
951 
952 /* Determine if error checking is desired.  If so, map API functions
953    to the appropriate error checking front-ends.  Otherwise, map API
954    functions to the core functions that actually perform the work.
955    Note: error checking is enabled by default.  */
956 
957 #ifdef TX_DISABLE_ERROR_CHECKING
958 
959 
960 /* Services without error checking.  */
961 
962 #define tx_kernel_enter                             _tx_initialize_kernel_enter
963 
964 #define tx_block_allocate                           _tx_block_allocate
965 #define tx_block_pool_create                        _tx_block_pool_create
966 #define tx_block_pool_delete                        _tx_block_pool_delete
967 #define tx_block_pool_info_get                      _tx_block_pool_info_get
968 #define tx_block_pool_performance_info_get          _tx_block_pool_performance_info_get
969 #define tx_block_pool_performance_system_info_get   _tx_block_pool_performance_system_info_get
970 #define tx_block_pool_prioritize                    _tx_block_pool_prioritize
971 #define tx_block_release                            _tx_block_release
972 
973 #define tx_byte_allocate                            _tx_byte_allocate
974 #define tx_byte_pool_create                         _tx_byte_pool_create
975 #define tx_byte_pool_delete                         _tx_byte_pool_delete
976 #define tx_byte_pool_info_get                       _tx_byte_pool_info_get
977 #define tx_byte_pool_performance_info_get           _tx_byte_pool_performance_info_get
978 #define tx_byte_pool_performance_system_info_get    _tx_byte_pool_performance_system_info_get
979 #define tx_byte_pool_prioritize                     _tx_byte_pool_prioritize
980 #define tx_byte_release                             _tx_byte_release
981 
982 #define tx_event_flags_create                       _tx_event_flags_create
983 #define tx_event_flags_delete                       _tx_event_flags_delete
984 #define tx_event_flags_get                          _tx_event_flags_get
985 #define tx_event_flags_info_get                     _tx_event_flags_info_get
986 #define tx_event_flags_performance_info_get         _tx_event_flags_performance_info_get
987 #define tx_event_flags_performance_system_info_get  _tx_event_flags_performance_system_info_get
988 #define tx_event_flags_set                          _tx_event_flags_set
989 #define tx_event_flags_set_notify                   _tx_event_flags_set_notify
990 
991 #ifdef TX_ENABLE_EVENT_LOGGING
992 UINT    _tx_el_interrupt_control(UINT new_posture);
993 #define tx_interrupt_control                        _tx_el_interrupt_control
994 #else
995 #ifdef TX_ENABLE_EVENT_TRACE
996 UINT    _tx_trace_interrupt_control(UINT new_posture);
997 #define tx_interrupt_control                        _tx_trace_interrupt_control
998 #else
999 #define tx_interrupt_control                        _tx_thread_interrupt_control
1000 #endif
1001 #endif
1002 
1003 #define tx_mutex_create                             _tx_mutex_create
1004 #define tx_mutex_delete                             _tx_mutex_delete
1005 #define tx_mutex_get                                _tx_mutex_get
1006 #define tx_mutex_info_get                           _tx_mutex_info_get
1007 #define tx_mutex_performance_info_get               _tx_mutex_performance_info_get
1008 #define tx_mutex_performance_system_info_get        _tx_mutex_performance_system_info_get
1009 #define tx_mutex_prioritize                         _tx_mutex_prioritize
1010 #define tx_mutex_put                                _tx_mutex_put
1011 
1012 #define tx_queue_create                             _tx_queue_create
1013 #define tx_queue_delete                             _tx_queue_delete
1014 #define tx_queue_flush                              _tx_queue_flush
1015 #define tx_queue_info_get                           _tx_queue_info_get
1016 #define tx_queue_performance_info_get               _tx_queue_performance_info_get
1017 #define tx_queue_performance_system_info_get        _tx_queue_performance_system_info_get
1018 #define tx_queue_receive                            _tx_queue_receive
1019 #define tx_queue_send                               _tx_queue_send
1020 #define tx_queue_send_notify                        _tx_queue_send_notify
1021 #define tx_queue_front_send                         _tx_queue_front_send
1022 #define tx_queue_prioritize                         _tx_queue_prioritize
1023 
1024 #define tx_semaphore_ceiling_put                    _tx_semaphore_ceiling_put
1025 #define tx_semaphore_create                         _tx_semaphore_create
1026 #define tx_semaphore_delete                         _tx_semaphore_delete
1027 #define tx_semaphore_get                            _tx_semaphore_get
1028 #define tx_semaphore_info_get                       _tx_semaphore_info_get
1029 #define tx_semaphore_performance_info_get           _tx_semaphore_performance_info_get
1030 #define tx_semaphore_performance_system_info_get    _tx_semaphore_performance_system_info_get
1031 #define tx_semaphore_prioritize                     _tx_semaphore_prioritize
1032 #define tx_semaphore_put                            _tx_semaphore_put
1033 #define tx_semaphore_put_notify                     _tx_semaphore_put_notify
1034 
1035 #define tx_thread_create                            _tx_thread_create
1036 #define tx_thread_delete                            _tx_thread_delete
1037 #define tx_thread_entry_exit_notify                 _tx_thread_entry_exit_notify
1038 #define tx_thread_identify                          _tx_thread_identify
1039 #define tx_thread_info_get                          _tx_thread_info_get
1040 #define tx_thread_performance_info_get              _tx_thread_performance_info_get
1041 #define tx_thread_performance_system_info_get       _tx_thread_performance_system_info_get
1042 #define tx_thread_preemption_change                 _tx_thread_preemption_change
1043 #define tx_thread_priority_change                   _tx_thread_priority_change
1044 #define tx_thread_relinquish                        _tx_thread_relinquish
1045 #define tx_thread_reset                             _tx_thread_reset
1046 #define tx_thread_resume                            _tx_thread_resume
1047 #define tx_thread_sleep                             _tx_thread_sleep
1048 #define tx_thread_stack_error_notify                _tx_thread_stack_error_notify
1049 #define tx_thread_suspend                           _tx_thread_suspend
1050 #define tx_thread_terminate                         _tx_thread_terminate
1051 #define tx_thread_time_slice_change                 _tx_thread_time_slice_change
1052 #define tx_thread_wait_abort                        _tx_thread_wait_abort
1053 
1054 #define tx_time_get                                 _tx_time_get
1055 #define tx_time_set                                 _tx_time_set
1056 #define tx_timer_activate                           _tx_timer_activate
1057 #define tx_timer_change                             _tx_timer_change
1058 #define tx_timer_create                             _tx_timer_create
1059 #define tx_timer_deactivate                         _tx_timer_deactivate
1060 #define tx_timer_delete                             _tx_timer_delete
1061 #define tx_timer_info_get                           _tx_timer_info_get
1062 #define tx_timer_performance_info_get               _tx_timer_performance_info_get
1063 #define tx_timer_performance_system_info_get        _tx_timer_performance_system_info_get
1064 
1065 #define tx_trace_enable                             _tx_trace_enable
1066 #define tx_trace_event_filter                       _tx_trace_event_filter
1067 #define tx_trace_event_unfilter                     _tx_trace_event_unfilter
1068 #define tx_trace_disable                            _tx_trace_disable
1069 #define tx_trace_isr_enter_insert                   _tx_trace_isr_enter_insert
1070 #define tx_trace_isr_exit_insert                    _tx_trace_isr_exit_insert
1071 #define tx_trace_buffer_full_notify                 _tx_trace_buffer_full_notify
1072 #define tx_trace_user_event_insert                  _tx_trace_user_event_insert
1073 
1074 #else
1075 
1076 /* Services with error checking.  */
1077 
1078 #define tx_kernel_enter                             _tx_initialize_kernel_enter
1079 
1080 /* Define the system API mappings depending on the runtime error
1081    checking behavior selected by the user.  */
1082 
1083 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1084 
1085 
1086 /* Services with MULTI runtime error checking ThreadX.  */
1087 
1088 #define tx_block_allocate                           _txr_block_allocate
1089 #define tx_block_pool_create(p,n,b,s,l)             _txr_block_pool_create((p),(n),(b),(s),(l),(sizeof(TX_BLOCK_POOL)))
1090 #define tx_block_pool_delete                        _txr_block_pool_delete
1091 #define tx_block_pool_info_get                      _txr_block_pool_info_get
1092 #define tx_block_pool_performance_info_get          _tx_block_pool_performance_info_get
1093 #define tx_block_pool_performance_system_info_get   _tx_block_pool_performance_system_info_get
1094 #define tx_block_pool_prioritize                    _txr_block_pool_prioritize
1095 #define tx_block_release                            _txr_block_release
1096 
1097 #define tx_byte_allocate                            _txr_byte_allocate
1098 #define tx_byte_pool_create(p,n,s,l)                _txr_byte_pool_create((p),(n),(s),(l),(sizeof(TX_BYTE_POOL)))
1099 #define tx_byte_pool_delete                         _txr_byte_pool_delete
1100 #define tx_byte_pool_info_get                       _txr_byte_pool_info_get
1101 #define tx_byte_pool_performance_info_get           _tx_byte_pool_performance_info_get
1102 #define tx_byte_pool_performance_system_info_get    _tx_byte_pool_performance_system_info_get
1103 #define tx_byte_pool_prioritize                     _txr_byte_pool_prioritize
1104 #define tx_byte_release                             _txr_byte_release
1105 
1106 #define tx_event_flags_create(g,n)                  _txr_event_flags_create((g),(n),(sizeof(TX_EVENT_FLAGS_GROUP)))
1107 #define tx_event_flags_delete                       _txr_event_flags_delete
1108 #define tx_event_flags_get                          _txr_event_flags_get
1109 #define tx_event_flags_info_get                     _txr_event_flags_info_get
1110 #define tx_event_flags_performance_info_get         _tx_event_flags_performance_info_get
1111 #define tx_event_flags_performance_system_info_get  _tx_event_flags_performance_system_info_get
1112 #define tx_event_flags_set                          _txr_event_flags_set
1113 #define tx_event_flags_set_notify                   _txr_event_flags_set_notify
1114 
1115 #ifdef TX_ENABLE_EVENT_LOGGING
1116 UINT    _tx_el_interrupt_control(UINT new_posture);
1117 #define tx_interrupt_control                        _tx_el_interrupt_control
1118 #else
1119 #ifdef TX_ENABLE_EVENT_TRACE
1120 UINT    _tx_trace_interrupt_control(UINT new_posture);
1121 #define tx_interrupt_control                        _tx_trace_interrupt_control
1122 #else
1123 #define tx_interrupt_control                        _tx_thread_interrupt_control
1124 #endif
1125 #endif
1126 
1127 #define tx_mutex_create(m,n,i)                      _txr_mutex_create((m),(n),(i),(sizeof(TX_MUTEX)))
1128 #define tx_mutex_delete                             _txr_mutex_delete
1129 #define tx_mutex_get                                _txr_mutex_get
1130 #define tx_mutex_info_get                           _txr_mutex_info_get
1131 #define tx_mutex_performance_info_get               _tx_mutex_performance_info_get
1132 #define tx_mutex_performance_system_info_get        _tx_mutex_performance_system_info_get
1133 #define tx_mutex_prioritize                         _txr_mutex_prioritize
1134 #define tx_mutex_put                                _txr_mutex_put
1135 
1136 #define tx_queue_create(q,n,m,s,l)                  _txr_queue_create((q),(n),(m),(s),(l),(sizeof(TX_QUEUE)))
1137 #define tx_queue_delete                             _txr_queue_delete
1138 #define tx_queue_flush                              _txr_queue_flush
1139 #define tx_queue_info_get                           _txr_queue_info_get
1140 #define tx_queue_performance_info_get               _tx_queue_performance_info_get
1141 #define tx_queue_performance_system_info_get        _tx_queue_performance_system_info_get
1142 #define tx_queue_receive                            _txr_queue_receive
1143 #define tx_queue_send                               _txr_queue_send
1144 #define tx_queue_send_notify                        _txr_queue_send_notify
1145 #define tx_queue_front_send                         _txr_queue_front_send
1146 #define tx_queue_prioritize                         _txr_queue_prioritize
1147 
1148 #define tx_semaphore_ceiling_put                    _txr_semaphore_ceiling_put
1149 #define tx_semaphore_create(s,n,i)                  _txr_semaphore_create((s),(n),(i),(sizeof(TX_SEMAPHORE)))
1150 #define tx_semaphore_delete                         _txr_semaphore_delete
1151 #define tx_semaphore_get                            _txr_semaphore_get
1152 #define tx_semaphore_info_get                       _txr_semaphore_info_get
1153 #define tx_semaphore_performance_info_get           _tx_semaphore_performance_info_get
1154 #define tx_semaphore_performance_system_info_get    _tx_semaphore_performance_system_info_get
1155 #define tx_semaphore_prioritize                     _txr_semaphore_prioritize
1156 #define tx_semaphore_put                            _txr_semaphore_put
1157 #define tx_semaphore_put_notify                     _txr_semaphore_put_notify
1158 
1159 #define tx_thread_create(t,n,e,i,s,l,p,r,c,a)       _txr_thread_create((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
1160 #define tx_thread_delete                            _txr_thread_delete
1161 #define tx_thread_entry_exit_notify                 _txr_thread_entry_exit_notify
1162 #define tx_thread_identify                          _tx_thread_identify
1163 #define tx_thread_info_get                          _txr_thread_info_get
1164 #define tx_thread_performance_info_get              _tx_thread_performance_info_get
1165 #define tx_thread_performance_system_info_get       _tx_thread_performance_system_info_get
1166 #define tx_thread_preemption_change                 _txr_thread_preemption_change
1167 #define tx_thread_priority_change                   _txr_thread_priority_change
1168 #define tx_thread_relinquish                        _txe_thread_relinquish
1169 #define tx_thread_reset                             _txr_thread_reset
1170 #define tx_thread_resume                            _txr_thread_resume
1171 #define tx_thread_sleep                             _tx_thread_sleep
1172 #define tx_thread_stack_error_notify                _tx_thread_stack_error_notify
1173 #define tx_thread_suspend                           _txr_thread_suspend
1174 #define tx_thread_terminate                         _txr_thread_terminate
1175 #define tx_thread_time_slice_change                 _txr_thread_time_slice_change
1176 #define tx_thread_wait_abort                        _txr_thread_wait_abort
1177 
1178 #define tx_time_get                                 _tx_time_get
1179 #define tx_time_set                                 _tx_time_set
1180 #define tx_timer_activate                           _txr_timer_activate
1181 #define tx_timer_change                             _txr_timer_change
1182 #define tx_timer_create(t,n,e,i,c,r,a)              _txr_timer_create((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
1183 #define tx_timer_deactivate                         _txr_timer_deactivate
1184 #define tx_timer_delete                             _txr_timer_delete
1185 #define tx_timer_info_get                           _txr_timer_info_get
1186 #define tx_timer_performance_info_get               _tx_timer_performance_info_get
1187 #define tx_timer_performance_system_info_get        _tx_timer_performance_system_info_get
1188 
1189 #define tx_trace_enable                             _tx_trace_enable
1190 #define tx_trace_event_filter                       _tx_trace_event_filter
1191 #define tx_trace_event_unfilter                     _tx_trace_event_unfilter
1192 #define tx_trace_disable                            _tx_trace_disable
1193 #define tx_trace_isr_enter_insert                   _tx_trace_isr_enter_insert
1194 #define tx_trace_isr_exit_insert                    _tx_trace_isr_exit_insert
1195 #define tx_trace_buffer_full_notify                 _tx_trace_buffer_full_notify
1196 #define tx_trace_user_event_insert                  _tx_trace_user_event_insert
1197 
1198 #else
1199 
1200 #define tx_block_allocate                           _txe_block_allocate
1201 #define tx_block_pool_create(p,n,b,s,l)             _txe_block_pool_create((p),(n),(b),(s),(l),(sizeof(TX_BLOCK_POOL)))
1202 #define tx_block_pool_delete                        _txe_block_pool_delete
1203 #define tx_block_pool_info_get                      _txe_block_pool_info_get
1204 #define tx_block_pool_performance_info_get          _tx_block_pool_performance_info_get
1205 #define tx_block_pool_performance_system_info_get   _tx_block_pool_performance_system_info_get
1206 #define tx_block_pool_prioritize                    _txe_block_pool_prioritize
1207 #define tx_block_release                            _txe_block_release
1208 
1209 #define tx_byte_allocate                            _txe_byte_allocate
1210 #define tx_byte_pool_create(p,n,s,l)                _txe_byte_pool_create((p),(n),(s),(l),(sizeof(TX_BYTE_POOL)))
1211 #define tx_byte_pool_delete                         _txe_byte_pool_delete
1212 #define tx_byte_pool_info_get                       _txe_byte_pool_info_get
1213 #define tx_byte_pool_performance_info_get           _tx_byte_pool_performance_info_get
1214 #define tx_byte_pool_performance_system_info_get    _tx_byte_pool_performance_system_info_get
1215 #define tx_byte_pool_prioritize                     _txe_byte_pool_prioritize
1216 #define tx_byte_release                             _txe_byte_release
1217 
1218 #define tx_event_flags_create(g,n)                  _txe_event_flags_create((g),(n),(sizeof(TX_EVENT_FLAGS_GROUP)))
1219 #define tx_event_flags_delete                       _txe_event_flags_delete
1220 #define tx_event_flags_get                          _txe_event_flags_get
1221 #define tx_event_flags_info_get                     _txe_event_flags_info_get
1222 #define tx_event_flags_performance_info_get         _tx_event_flags_performance_info_get
1223 #define tx_event_flags_performance_system_info_get  _tx_event_flags_performance_system_info_get
1224 #define tx_event_flags_set                          _txe_event_flags_set
1225 #define tx_event_flags_set_notify                   _txe_event_flags_set_notify
1226 
1227 #ifdef TX_ENABLE_EVENT_LOGGING
1228 UINT    _tx_el_interrupt_control(UINT new_posture);
1229 #define tx_interrupt_control                        _tx_el_interrupt_control
1230 #else
1231 #ifdef TX_ENABLE_EVENT_TRACE
1232 #define tx_interrupt_control                        _tx_trace_interrupt_control
1233 #else
1234 #define tx_interrupt_control                        _tx_thread_interrupt_control
1235 #endif
1236 #endif
1237 
1238 #define tx_mutex_create(m,n,i)                      _txe_mutex_create((m),(n),(i),(sizeof(TX_MUTEX)))
1239 #define tx_mutex_delete                             _txe_mutex_delete
1240 #define tx_mutex_get                                _txe_mutex_get
1241 #define tx_mutex_info_get                           _txe_mutex_info_get
1242 #define tx_mutex_performance_info_get               _tx_mutex_performance_info_get
1243 #define tx_mutex_performance_system_info_get        _tx_mutex_performance_system_info_get
1244 #define tx_mutex_prioritize                         _txe_mutex_prioritize
1245 #define tx_mutex_put                                _txe_mutex_put
1246 
1247 #define tx_queue_create(q,n,m,s,l)                  _txe_queue_create((q),(n),(m),(s),(l),(sizeof(TX_QUEUE)))
1248 #define tx_queue_delete                             _txe_queue_delete
1249 #define tx_queue_flush                              _txe_queue_flush
1250 #define tx_queue_info_get                           _txe_queue_info_get
1251 #define tx_queue_performance_info_get               _tx_queue_performance_info_get
1252 #define tx_queue_performance_system_info_get        _tx_queue_performance_system_info_get
1253 #define tx_queue_receive                            _txe_queue_receive
1254 #define tx_queue_send                               _txe_queue_send
1255 #define tx_queue_send_notify                        _txe_queue_send_notify
1256 #define tx_queue_front_send                         _txe_queue_front_send
1257 #define tx_queue_prioritize                         _txe_queue_prioritize
1258 
1259 #define tx_semaphore_ceiling_put                    _txe_semaphore_ceiling_put
1260 #define tx_semaphore_create(s,n,i)                  _txe_semaphore_create((s),(n),(i),(sizeof(TX_SEMAPHORE)))
1261 #define tx_semaphore_delete                         _txe_semaphore_delete
1262 #define tx_semaphore_get                            _txe_semaphore_get
1263 #define tx_semaphore_info_get                       _txe_semaphore_info_get
1264 #define tx_semaphore_performance_info_get           _tx_semaphore_performance_info_get
1265 #define tx_semaphore_performance_system_info_get    _tx_semaphore_performance_system_info_get
1266 #define tx_semaphore_prioritize                     _txe_semaphore_prioritize
1267 #define tx_semaphore_put                            _txe_semaphore_put
1268 #define tx_semaphore_put_notify                     _txe_semaphore_put_notify
1269 
1270 #define tx_thread_create(t,n,e,i,s,l,p,r,c,a)       _txe_thread_create((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
1271 #define tx_thread_delete                            _txe_thread_delete
1272 #define tx_thread_entry_exit_notify                 _txe_thread_entry_exit_notify
1273 #define tx_thread_identify                          _tx_thread_identify
1274 #define tx_thread_info_get                          _txe_thread_info_get
1275 #define tx_thread_performance_info_get              _tx_thread_performance_info_get
1276 #define tx_thread_performance_system_info_get       _tx_thread_performance_system_info_get
1277 #define tx_thread_preemption_change                 _txe_thread_preemption_change
1278 #define tx_thread_priority_change                   _txe_thread_priority_change
1279 #define tx_thread_relinquish                        _txe_thread_relinquish
1280 #define tx_thread_reset                             _txe_thread_reset
1281 #define tx_thread_resume                            _txe_thread_resume
1282 #define tx_thread_sleep                             _tx_thread_sleep
1283 #define tx_thread_stack_error_notify                _tx_thread_stack_error_notify
1284 #define tx_thread_suspend                           _txe_thread_suspend
1285 #define tx_thread_terminate                         _txe_thread_terminate
1286 #define tx_thread_time_slice_change                 _txe_thread_time_slice_change
1287 #define tx_thread_wait_abort                        _txe_thread_wait_abort
1288 
1289 #define tx_time_get                                 _tx_time_get
1290 #define tx_time_set                                 _tx_time_set
1291 #define tx_timer_activate                           _txe_timer_activate
1292 #define tx_timer_change                             _txe_timer_change
1293 #define tx_timer_create(t,n,e,i,c,r,a)              _txe_timer_create((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
1294 #define tx_timer_deactivate                         _txe_timer_deactivate
1295 #define tx_timer_delete                             _txe_timer_delete
1296 #define tx_timer_info_get                           _txe_timer_info_get
1297 #define tx_timer_performance_info_get               _tx_timer_performance_info_get
1298 #define tx_timer_performance_system_info_get        _tx_timer_performance_system_info_get
1299 
1300 #define tx_trace_enable                             _tx_trace_enable
1301 #define tx_trace_event_filter                       _tx_trace_event_filter
1302 #define tx_trace_event_unfilter                     _tx_trace_event_unfilter
1303 #define tx_trace_disable                            _tx_trace_disable
1304 #define tx_trace_isr_enter_insert                   _tx_trace_isr_enter_insert
1305 #define tx_trace_isr_exit_insert                    _tx_trace_isr_exit_insert
1306 #define tx_trace_buffer_full_notify                 _tx_trace_buffer_full_notify
1307 #define tx_trace_user_event_insert                  _tx_trace_user_event_insert
1308 
1309 #endif
1310 #endif
1311 
1312 #endif
1313 
1314 
1315 /* Declare the tx_application_define function as having C linkage.  */
1316 
1317 VOID        tx_application_define(VOID *first_unused_memory);
1318 
1319 
1320 /* Define the function prototypes of the ThreadX API.  */
1321 
1322 
1323 /* Define block memory pool management function prototypes.  */
1324 
1325 UINT        _tx_block_allocate(TX_BLOCK_POOL *pool_ptr, VOID **block_ptr, ULONG wait_option);
1326 UINT        _tx_block_pool_create(TX_BLOCK_POOL *pool_ptr, CHAR *name_ptr, ULONG block_size,
1327                     VOID *pool_start, ULONG pool_size);
1328 UINT        _tx_block_pool_delete(TX_BLOCK_POOL *pool_ptr);
1329 UINT        _tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks,
1330                     ULONG *total_blocks, TX_THREAD **first_suspended,
1331                     ULONG *suspended_count, TX_BLOCK_POOL **next_pool);
1332 UINT        _tx_block_pool_performance_info_get(TX_BLOCK_POOL *pool_ptr, ULONG *allocates, ULONG *releases,
1333                     ULONG *suspensions, ULONG *timeouts);
1334 UINT        _tx_block_pool_performance_system_info_get(ULONG *allocates, ULONG *releases,
1335                     ULONG *suspensions, ULONG *timeouts);
1336 UINT        _tx_block_pool_prioritize(TX_BLOCK_POOL *pool_ptr);
1337 UINT        _tx_block_release(VOID *block_ptr);
1338 
1339 
1340 /* Define error checking shells for API services.  These are only referenced by the
1341    application.  */
1342 
1343 UINT        _txe_block_allocate(TX_BLOCK_POOL *pool_ptr, VOID **block_ptr, ULONG wait_option);
1344 UINT        _txe_block_pool_create(TX_BLOCK_POOL *pool_ptr, CHAR *name_ptr, ULONG block_size,
1345                     VOID *pool_start, ULONG pool_size, UINT pool_control_block_size);
1346 UINT        _txe_block_pool_delete(TX_BLOCK_POOL *pool_ptr);
1347 UINT        _txe_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks,
1348                     ULONG *total_blocks, TX_THREAD **first_suspended,
1349                     ULONG *suspended_count, TX_BLOCK_POOL **next_pool);
1350 UINT        _txe_block_pool_prioritize(TX_BLOCK_POOL *pool_ptr);
1351 UINT        _txe_block_release(VOID *block_ptr);
1352 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1353 UINT        _txr_block_allocate(TX_BLOCK_POOL *pool_ptr, VOID **block_ptr, ULONG wait_option);
1354 UINT        _txr_block_pool_create(TX_BLOCK_POOL *pool_ptr, CHAR *name_ptr, ULONG block_size,
1355                     VOID *pool_start, ULONG pool_size, UINT pool_control_block_size);
1356 UINT        _txr_block_pool_delete(TX_BLOCK_POOL *pool_ptr);
1357 UINT        _txr_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks,
1358                     ULONG *total_blocks, TX_THREAD **first_suspended,
1359                     ULONG *suspended_count, TX_BLOCK_POOL **next_pool);
1360 UINT        _txr_block_pool_prioritize(TX_BLOCK_POOL *pool_ptr);
1361 UINT        _txr_block_release(VOID *block_ptr);
1362 #endif
1363 
1364 
1365 /* Define byte memory pool management function prototypes.  */
1366 
1367 UINT        _tx_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size,
1368                     ULONG wait_option);
1369 UINT        _tx_byte_pool_create(TX_BYTE_POOL *pool_ptr, CHAR *name_ptr, VOID *pool_start,
1370                     ULONG pool_size);
1371 UINT        _tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr);
1372 UINT        _tx_byte_pool_info_get(TX_BYTE_POOL *pool_ptr, CHAR **name, ULONG *available_bytes,
1373                     ULONG *fragments, TX_THREAD **first_suspended,
1374                     ULONG *suspended_count, TX_BYTE_POOL **next_pool);
1375 UINT        _tx_byte_pool_performance_info_get(TX_BYTE_POOL *pool_ptr, ULONG *allocates, ULONG *releases,
1376                     ULONG *fragments_searched, ULONG *merges, ULONG *splits, ULONG *suspensions, ULONG *timeouts);
1377 UINT        _tx_byte_pool_performance_system_info_get(ULONG *allocates, ULONG *releases,
1378                     ULONG *fragments_searched, ULONG *merges, ULONG *splits, ULONG *suspensions, ULONG *timeouts);
1379 UINT        _tx_byte_pool_prioritize(TX_BYTE_POOL *pool_ptr);
1380 UINT        _tx_byte_release(VOID *memory_ptr);
1381 
1382 
1383 /* Define error checking shells for API services.  These are only referenced by the
1384    application.  */
1385 
1386 UINT        _txe_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size,
1387                     ULONG wait_option);
1388 UINT        _txe_byte_pool_create(TX_BYTE_POOL *pool_ptr, CHAR *name_ptr, VOID *pool_start,
1389                     ULONG pool_size, UINT pool_control_block_size);
1390 UINT        _txe_byte_pool_delete(TX_BYTE_POOL *pool_ptr);
1391 UINT        _txe_byte_pool_info_get(TX_BYTE_POOL *pool_ptr, CHAR **name, ULONG *available_bytes,
1392                     ULONG *fragments, TX_THREAD **first_suspended,
1393                     ULONG *suspended_count, TX_BYTE_POOL **next_pool);
1394 UINT        _txe_byte_pool_prioritize(TX_BYTE_POOL *pool_ptr);
1395 UINT        _txe_byte_release(VOID *memory_ptr);
1396 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1397 UINT        _txr_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size,
1398                     ULONG wait_option);
1399 UINT        _txr_byte_pool_create(TX_BYTE_POOL *pool_ptr, CHAR *name_ptr, VOID *pool_start,
1400                     ULONG pool_size, UINT pool_control_block_size);
1401 UINT        _txr_byte_pool_delete(TX_BYTE_POOL *pool_ptr);
1402 UINT        _txr_byte_pool_info_get(TX_BYTE_POOL *pool_ptr, CHAR **name, ULONG *available_bytes,
1403                     ULONG *fragments, TX_THREAD **first_suspended,
1404                     ULONG *suspended_count, TX_BYTE_POOL **next_pool);
1405 UINT        _txr_byte_pool_prioritize(TX_BYTE_POOL *pool_ptr);
1406 UINT        _txr_byte_release(VOID *memory_ptr);
1407 #endif
1408 
1409 
1410 /* Define event flags management function prototypes.  */
1411 
1412 UINT        _tx_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr);
1413 UINT        _tx_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr);
1414 UINT        _tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags,
1415                     UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option);
1416 UINT        _tx_event_flags_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR **name, ULONG *current_flags,
1417                     TX_THREAD **first_suspended, ULONG *suspended_count,
1418                     TX_EVENT_FLAGS_GROUP **next_group);
1419 UINT        _tx_event_flags_performance_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG *sets, ULONG *gets,
1420                     ULONG *suspensions, ULONG *timeouts);
1421 UINT        _tx_event_flags_performance_system_info_get(ULONG *sets, ULONG *gets,
1422                     ULONG *suspensions, ULONG *timeouts);
1423 UINT        _tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set,
1424                     UINT set_option);
1425 UINT        _tx_event_flags_set_notify(TX_EVENT_FLAGS_GROUP *group_ptr, VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *notify_group_ptr));
1426 
1427 
1428 /* Define error checking shells for API services.  These are only referenced by the
1429    application.  */
1430 
1431 UINT        _txe_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr, UINT event_control_block_size);
1432 UINT        _txe_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr);
1433 UINT        _txe_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags,
1434                     UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option);
1435 UINT        _txe_event_flags_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR **name, ULONG *current_flags,
1436                     TX_THREAD **first_suspended, ULONG *suspended_count,
1437                     TX_EVENT_FLAGS_GROUP **next_group);
1438 UINT        _txe_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set,
1439                     UINT set_option);
1440 UINT        _txe_event_flags_set_notify(TX_EVENT_FLAGS_GROUP *group_ptr, VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *notify_group_ptr));
1441 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1442 UINT        _txr_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr, UINT event_control_block_size);
1443 UINT        _txr_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr);
1444 UINT        _txr_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags,
1445                     UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option);
1446 UINT        _txr_event_flags_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR **name, ULONG *current_flags,
1447                     TX_THREAD **first_suspended, ULONG *suspended_count,
1448                     TX_EVENT_FLAGS_GROUP **next_group);
1449 UINT        _txr_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set,
1450                     UINT set_option);
1451 UINT        _txr_event_flags_set_notify(TX_EVENT_FLAGS_GROUP *group_ptr, VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *notify_group_ptr));
1452 #endif
1453 
1454 
1455 /* Define initialization function prototypes.  */
1456 
1457 VOID        _tx_initialize_kernel_enter(VOID);
1458 
1459 
1460 /* Define mutex management function prototypes.  */
1461 
1462 UINT        _tx_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr, UINT inherit);
1463 UINT        _tx_mutex_delete(TX_MUTEX *mutex_ptr);
1464 UINT        _tx_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option);
1465 UINT        _tx_mutex_info_get(TX_MUTEX *mutex_ptr, CHAR **name, ULONG *count, TX_THREAD **owner,
1466                     TX_THREAD **first_suspended, ULONG *suspended_count,
1467                     TX_MUTEX **next_mutex);
1468 UINT        _tx_mutex_performance_info_get(TX_MUTEX *mutex_ptr, ULONG *puts, ULONG *gets,
1469                     ULONG *suspensions, ULONG *timeouts, ULONG *inversions, ULONG *inheritances);
1470 UINT        _tx_mutex_performance_system_info_get(ULONG *puts, ULONG *gets, ULONG *suspensions, ULONG *timeouts,
1471                     ULONG *inversions, ULONG *inheritances);
1472 UINT        _tx_mutex_prioritize(TX_MUTEX *mutex_ptr);
1473 UINT        _tx_mutex_put(TX_MUTEX *mutex_ptr);
1474 
1475 
1476 /* Define error checking shells for API services.  These are only referenced by the
1477    application.  */
1478 
1479 UINT        _txe_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr, UINT inherit, UINT mutex_control_block_size);
1480 UINT        _txe_mutex_delete(TX_MUTEX *mutex_ptr);
1481 UINT        _txe_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option);
1482 UINT        _txe_mutex_info_get(TX_MUTEX *mutex_ptr, CHAR **name, ULONG *count, TX_THREAD **owner,
1483                     TX_THREAD **first_suspended, ULONG *suspended_count,
1484                     TX_MUTEX **next_mutex);
1485 UINT        _txe_mutex_prioritize(TX_MUTEX *mutex_ptr);
1486 UINT        _txe_mutex_put(TX_MUTEX *mutex_ptr);
1487 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1488 UINT        _txr_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr, UINT inherit, UINT mutex_control_block_size);
1489 UINT        _txr_mutex_delete(TX_MUTEX *mutex_ptr);
1490 UINT        _txr_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option);
1491 UINT        _txr_mutex_info_get(TX_MUTEX *mutex_ptr, CHAR **name, ULONG *count, TX_THREAD **owner,
1492                     TX_THREAD **first_suspended, ULONG *suspended_count,
1493                     TX_MUTEX **next_mutex);
1494 UINT        _txr_mutex_prioritize(TX_MUTEX *mutex_ptr);
1495 UINT        _txr_mutex_put(TX_MUTEX *mutex_ptr);
1496 #endif
1497 
1498 
1499 /* Define queue management function prototypes.  */
1500 
1501 UINT        _tx_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,
1502                         VOID *queue_start, ULONG queue_size);
1503 UINT        _tx_queue_delete(TX_QUEUE *queue_ptr);
1504 UINT        _tx_queue_flush(TX_QUEUE *queue_ptr);
1505 UINT        _tx_queue_info_get(TX_QUEUE *queue_ptr, CHAR **name, ULONG *enqueued, ULONG *available_storage,
1506                     TX_THREAD **first_suspended, ULONG *suspended_count, TX_QUEUE **next_queue);
1507 UINT        _tx_queue_performance_info_get(TX_QUEUE *queue_ptr, ULONG *messages_sent, ULONG *messages_received,
1508                     ULONG *empty_suspensions, ULONG *full_suspensions, ULONG *full_errors, ULONG *timeouts);
1509 UINT        _tx_queue_performance_system_info_get(ULONG *messages_sent, ULONG *messages_received,
1510                     ULONG *empty_suspensions, ULONG *full_suspensions, ULONG *full_errors, ULONG *timeouts);
1511 UINT        _tx_queue_prioritize(TX_QUEUE *queue_ptr);
1512 UINT        _tx_queue_receive(TX_QUEUE *queue_ptr, VOID *destination_ptr, ULONG wait_option);
1513 UINT        _tx_queue_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
1514 UINT        _tx_queue_send_notify(TX_QUEUE *queue_ptr, VOID (*queue_send_notify)(TX_QUEUE *notify_queue_ptr));
1515 UINT        _tx_queue_front_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
1516 
1517 
1518 /* Define error checking shells for API services.  These are only referenced by the
1519    application.  */
1520 
1521 UINT        _txe_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,
1522                         VOID *queue_start, ULONG queue_size, UINT queue_control_block_size);
1523 UINT        _txe_queue_delete(TX_QUEUE *queue_ptr);
1524 UINT        _txe_queue_flush(TX_QUEUE *queue_ptr);
1525 UINT        _txe_queue_info_get(TX_QUEUE *queue_ptr, CHAR **name, ULONG *enqueued, ULONG *available_storage,
1526                     TX_THREAD **first_suspended, ULONG *suspended_count, TX_QUEUE **next_queue);
1527 UINT        _txe_queue_prioritize(TX_QUEUE *queue_ptr);
1528 UINT        _txe_queue_receive(TX_QUEUE *queue_ptr, VOID *destination_ptr, ULONG wait_option);
1529 UINT        _txe_queue_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
1530 UINT        _txe_queue_send_notify(TX_QUEUE *queue_ptr, VOID (*queue_send_notify)(TX_QUEUE *notify_queue_ptr));
1531 UINT        _txe_queue_front_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
1532 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1533 UINT        _txr_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,
1534                         VOID *queue_start, ULONG queue_size, UINT queue_control_block_size);
1535 UINT        _txr_queue_delete(TX_QUEUE *queue_ptr);
1536 UINT        _txr_queue_flush(TX_QUEUE *queue_ptr);
1537 UINT        _txr_queue_info_get(TX_QUEUE *queue_ptr, CHAR **name, ULONG *enqueued, ULONG *available_storage,
1538                     TX_THREAD **first_suspended, ULONG *suspended_count, TX_QUEUE **next_queue);
1539 UINT        _txr_queue_prioritize(TX_QUEUE *queue_ptr);
1540 UINT        _txr_queue_receive(TX_QUEUE *queue_ptr, VOID *destination_ptr, ULONG wait_option);
1541 UINT        _txr_queue_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
1542 UINT        _txr_queue_send_notify(TX_QUEUE *queue_ptr, VOID (*queue_send_notify)(TX_QUEUE *notify_queue_ptr));
1543 UINT        _txr_queue_front_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
1544 #endif
1545 
1546 
1547 /* Define semaphore management function prototypes.  */
1548 
1549 UINT        _tx_semaphore_ceiling_put(TX_SEMAPHORE *semaphore_ptr, ULONG ceiling);
1550 UINT        _tx_semaphore_create(TX_SEMAPHORE *semaphore_ptr, CHAR *name_ptr, ULONG initial_count);
1551 UINT        _tx_semaphore_delete(TX_SEMAPHORE *semaphore_ptr);
1552 UINT        _tx_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option);
1553 UINT        _tx_semaphore_info_get(TX_SEMAPHORE *semaphore_ptr, CHAR **name, ULONG *current_value,
1554                     TX_THREAD **first_suspended, ULONG *suspended_count,
1555                     TX_SEMAPHORE **next_semaphore);
1556 UINT        _tx_semaphore_performance_info_get(TX_SEMAPHORE *semaphore_ptr, ULONG *puts, ULONG *gets,
1557                     ULONG *suspensions, ULONG *timeouts);
1558 UINT        _tx_semaphore_performance_system_info_get(ULONG *puts, ULONG *gets, ULONG *suspensions, ULONG *timeouts);
1559 UINT        _tx_semaphore_prioritize(TX_SEMAPHORE *semaphore_ptr);
1560 UINT        _tx_semaphore_put(TX_SEMAPHORE *semaphore_ptr);
1561 UINT        _tx_semaphore_put_notify(TX_SEMAPHORE *semaphore_ptr, VOID (*semaphore_put_notify)(TX_SEMAPHORE *notify_semaphore_ptr));
1562 
1563 
1564 /* Define error checking shells for API services.  These are only referenced by the
1565    application.  */
1566 
1567 UINT        _txe_semaphore_ceiling_put(TX_SEMAPHORE *semaphore_ptr, ULONG ceiling);
1568 UINT        _txe_semaphore_create(TX_SEMAPHORE *semaphore_ptr, CHAR *name_ptr, ULONG initial_count, UINT semaphore_control_block_size);
1569 UINT        _txe_semaphore_delete(TX_SEMAPHORE *semaphore_ptr);
1570 UINT        _txe_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option);
1571 UINT        _txe_semaphore_info_get(TX_SEMAPHORE *semaphore_ptr, CHAR **name, ULONG *current_value,
1572                     TX_THREAD **first_suspended, ULONG *suspended_count,
1573                     TX_SEMAPHORE **next_semaphore);
1574 UINT        _txe_semaphore_prioritize(TX_SEMAPHORE *semaphore_ptr);
1575 UINT        _txe_semaphore_put(TX_SEMAPHORE *semaphore_ptr);
1576 UINT        _txe_semaphore_put_notify(TX_SEMAPHORE *semaphore_ptr, VOID (*semaphore_put_notify)(TX_SEMAPHORE *notify_semaphore_ptr));
1577 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1578 UINT        _txr_semaphore_ceiling_put(TX_SEMAPHORE *semaphore_ptr, ULONG ceiling);
1579 UINT        _txr_semaphore_create(TX_SEMAPHORE *semaphore_ptr, CHAR *name_ptr, ULONG initial_count, UINT semaphore_control_block_size);
1580 UINT        _txr_semaphore_delete(TX_SEMAPHORE *semaphore_ptr);
1581 UINT        _txr_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option);
1582 UINT        _txr_semaphore_info_get(TX_SEMAPHORE *semaphore_ptr, CHAR **name, ULONG *current_value,
1583                     TX_THREAD **first_suspended, ULONG *suspended_count,
1584                     TX_SEMAPHORE **next_semaphore);
1585 UINT        _txr_semaphore_prioritize(TX_SEMAPHORE *semaphore_ptr);
1586 UINT        _txr_semaphore_put(TX_SEMAPHORE *semaphore_ptr);
1587 UINT        _txr_semaphore_put_notify(TX_SEMAPHORE *semaphore_ptr, VOID (*semaphore_put_notify)(TX_SEMAPHORE *notify_semaphore_ptr));
1588 #endif
1589 
1590 
1591 /* Define thread control function prototypes.  */
1592 
1593 VOID        _tx_thread_context_save(VOID);
1594 VOID        _tx_thread_context_restore(VOID);
1595 UINT        _tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
1596                 VOID (*entry_function)(ULONG entry_input), ULONG entry_input,
1597                 VOID *stack_start, ULONG stack_size,
1598                 UINT priority, UINT preempt_threshold,
1599                 ULONG time_slice, UINT auto_start);
1600 UINT        _tx_thread_delete(TX_THREAD *thread_ptr);
1601 UINT        _tx_thread_entry_exit_notify(TX_THREAD *thread_ptr, VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type));
1602 TX_THREAD  *_tx_thread_identify(VOID);
1603 UINT        _tx_thread_info_get(TX_THREAD *thread_ptr, CHAR **name, UINT *state, ULONG *run_count,
1604                 UINT *priority, UINT *preemption_threshold, ULONG *time_slice,
1605                 TX_THREAD **next_thread, TX_THREAD **next_suspended_thread);
1606 UINT        _tx_thread_interrupt_control(UINT new_posture);
1607 UINT        _tx_thread_performance_info_get(TX_THREAD *thread_ptr, ULONG *resumptions, ULONG *suspensions,
1608                 ULONG *solicited_preemptions, ULONG *interrupt_preemptions, ULONG *priority_inversions,
1609                 ULONG *time_slices, ULONG *relinquishes, ULONG *timeouts, ULONG *wait_aborts, TX_THREAD **last_preempted_by);
1610 UINT        _tx_thread_performance_system_info_get(ULONG *resumptions, ULONG *suspensions,
1611                 ULONG *solicited_preemptions, ULONG *interrupt_preemptions, ULONG *priority_inversions,
1612                 ULONG *time_slices, ULONG *relinquishes, ULONG *timeouts, ULONG *wait_aborts,
1613                 ULONG *non_idle_returns, ULONG *idle_returns);
1614 UINT        _tx_thread_preemption_change(TX_THREAD *thread_ptr, UINT new_threshold,
1615                         UINT *old_threshold);
1616 UINT        _tx_thread_priority_change(TX_THREAD *thread_ptr, UINT new_priority,
1617                         UINT *old_priority);
1618 VOID        _tx_thread_relinquish(VOID);
1619 UINT        _tx_thread_reset(TX_THREAD *thread_ptr);
1620 UINT        _tx_thread_resume(TX_THREAD *thread_ptr);
1621 UINT        _tx_thread_sleep(ULONG timer_ticks);
1622 UINT        _tx_thread_stack_error_notify(VOID (*stack_error_handler)(TX_THREAD *thread_ptr));
1623 UINT        _tx_thread_suspend(TX_THREAD *thread_ptr);
1624 UINT        _tx_thread_terminate(TX_THREAD *thread_ptr);
1625 UINT        _tx_thread_time_slice_change(TX_THREAD *thread_ptr, ULONG new_time_slice, ULONG *old_time_slice);
1626 UINT        _tx_thread_wait_abort(TX_THREAD *thread_ptr);
1627 
1628 
1629 /* Define error checking shells for API services.  These are only referenced by the
1630    application.  */
1631 
1632 UINT        _txe_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
1633                 VOID (*entry_function)(ULONG entry_input), ULONG entry_input,
1634                 VOID *stack_start, ULONG stack_size,
1635                 UINT priority, UINT preempt_threshold,
1636                 ULONG time_slice, UINT auto_start, UINT thread_control_block_size);
1637 UINT        _txe_thread_delete(TX_THREAD *thread_ptr);
1638 UINT        _txe_thread_entry_exit_notify(TX_THREAD *thread_ptr, VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type));
1639 UINT        _txe_thread_info_get(TX_THREAD *thread_ptr, CHAR **name, UINT *state, ULONG *run_count,
1640                 UINT *priority, UINT *preemption_threshold, ULONG *time_slice,
1641                 TX_THREAD **next_thread, TX_THREAD **next_suspended_thread);
1642 UINT        _txe_thread_preemption_change(TX_THREAD *thread_ptr, UINT new_threshold,
1643                         UINT *old_threshold);
1644 UINT        _txe_thread_priority_change(TX_THREAD *thread_ptr, UINT new_priority,
1645                         UINT *old_priority);
1646 VOID        _txe_thread_relinquish(VOID);
1647 UINT        _txe_thread_reset(TX_THREAD *thread_ptr);
1648 UINT        _txe_thread_resume(TX_THREAD *thread_ptr);
1649 UINT        _txe_thread_suspend(TX_THREAD *thread_ptr);
1650 UINT        _txe_thread_terminate(TX_THREAD *thread_ptr);
1651 UINT        _txe_thread_time_slice_change(TX_THREAD *thread_ptr, ULONG new_time_slice, ULONG *old_time_slice);
1652 UINT        _txe_thread_wait_abort(TX_THREAD *thread_ptr);
1653 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1654 UINT        _txr_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
1655                 VOID (*entry_function)(ULONG entry_input), ULONG entry_input,
1656                 VOID *stack_start, ULONG stack_size,
1657                 UINT priority, UINT preempt_threshold,
1658                 ULONG time_slice, UINT auto_start, UINT thread_control_block_size);
1659 UINT        _txr_thread_delete(TX_THREAD *thread_ptr);
1660 UINT        _txr_thread_entry_exit_notify(TX_THREAD *thread_ptr, VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type));
1661 UINT        _txr_thread_info_get(TX_THREAD *thread_ptr, CHAR **name, UINT *state, ULONG *run_count,
1662                 UINT *priority, UINT *preemption_threshold, ULONG *time_slice,
1663                 TX_THREAD **next_thread, TX_THREAD **next_suspended_thread);
1664 UINT        _txr_thread_preemption_change(TX_THREAD *thread_ptr, UINT new_threshold,
1665                         UINT *old_threshold);
1666 UINT        _txr_thread_priority_change(TX_THREAD *thread_ptr, UINT new_priority,
1667                         UINT *old_priority);
1668 UINT        _txr_thread_reset(TX_THREAD *thread_ptr);
1669 UINT        _txr_thread_resume(TX_THREAD *thread_ptr);
1670 UINT        _txr_thread_suspend(TX_THREAD *thread_ptr);
1671 UINT        _txr_thread_terminate(TX_THREAD *thread_ptr);
1672 UINT        _txr_thread_time_slice_change(TX_THREAD *thread_ptr, ULONG new_time_slice, ULONG *old_time_slice);
1673 UINT        _txr_thread_wait_abort(TX_THREAD *thread_ptr);
1674 #endif
1675 
1676 
1677 /* Define timer management function prototypes.  */
1678 
1679 UINT        _tx_timer_activate(TX_TIMER *timer_ptr);
1680 UINT        _tx_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG reschedule_ticks);
1681 UINT        _tx_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr,
1682                 VOID (*expiration_function)(ULONG input), ULONG expiration_input,
1683                 ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate);
1684 UINT        _tx_timer_deactivate(TX_TIMER *timer_ptr);
1685 UINT        _tx_timer_delete(TX_TIMER *timer_ptr);
1686 UINT        _tx_timer_info_get(TX_TIMER *timer_ptr, CHAR **name, UINT *active, ULONG *remaining_ticks,
1687                 ULONG *reschedule_ticks, TX_TIMER **next_timer);
1688 UINT        _tx_timer_performance_info_get(TX_TIMER *timer_ptr, ULONG *activates, ULONG *reactivates,
1689                 ULONG *deactivates, ULONG *expirations, ULONG *expiration_adjusts);
1690 UINT        _tx_timer_performance_system_info_get(ULONG *activates, ULONG *reactivates,
1691                 ULONG *deactivates, ULONG *expirations, ULONG *expiration_adjusts);
1692 
1693 ULONG       _tx_time_get(VOID);
1694 VOID        _tx_time_set(ULONG new_time);
1695 
1696 
1697 /* Define error checking shells for API services.  These are only referenced by the
1698    application.  */
1699 
1700 UINT        _txe_timer_activate(TX_TIMER *timer_ptr);
1701 UINT        _txe_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG reschedule_ticks);
1702 UINT        _txe_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr,
1703                 VOID (*expiration_function)(ULONG input), ULONG expiration_input,
1704                 ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate, UINT timer_control_block_size);
1705 UINT        _txe_timer_deactivate(TX_TIMER *timer_ptr);
1706 UINT        _txe_timer_delete(TX_TIMER *timer_ptr);
1707 UINT        _txe_timer_info_get(TX_TIMER *timer_ptr, CHAR **name, UINT *active, ULONG *remaining_ticks,
1708                 ULONG *reschedule_ticks, TX_TIMER **next_timer);
1709 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
1710 UINT        _txr_timer_activate(TX_TIMER *timer_ptr);
1711 UINT        _txr_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG reschedule_ticks);
1712 UINT        _txr_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr,
1713                 VOID (*expiration_function)(ULONG input), ULONG expiration_input,
1714                 ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate, UINT timer_control_block_size);
1715 UINT        _txr_timer_deactivate(TX_TIMER *timer_ptr);
1716 UINT        _txr_timer_delete(TX_TIMER *timer_ptr);
1717 UINT        _txr_timer_info_get(TX_TIMER *timer_ptr, CHAR **name, UINT *active, ULONG *remaining_ticks,
1718                 ULONG *reschedule_ticks, TX_TIMER **next_timer);
1719 #endif
1720 
1721 
1722 /* Define trace API function prototypes.  */
1723 
1724 UINT        _tx_trace_enable(VOID *trace_buffer_start, ULONG trace_buffer_size, ULONG registry_entries);
1725 UINT        _tx_trace_event_filter(ULONG event_filter_bits);
1726 UINT        _tx_trace_event_unfilter(ULONG event_unfilter_bits);
1727 UINT        _tx_trace_disable(VOID);
1728 VOID        _tx_trace_isr_enter_insert(ULONG isr_id);
1729 VOID        _tx_trace_isr_exit_insert(ULONG isr_id);
1730 UINT        _tx_trace_buffer_full_notify(VOID (*full_buffer_callback)(VOID *buffer));
1731 UINT        _tx_trace_user_event_insert(ULONG event_id, ULONG info_field_1, ULONG info_field_2, ULONG info_field_3, ULONG info_field_4);
1732 UINT        _tx_trace_interrupt_control(UINT new_posture);
1733 
1734 
1735 /* Add a default macro that can be re-defined in tx_port.h to add default processing when a thread starts. Common usage
1736    would be for enabling floating point for a thread by default, however, the additional processing could be anything
1737    defined in tx_port.h.  */
1738 
1739 #ifndef TX_THREAD_STARTED_EXTENSION
1740 #define TX_THREAD_STARTED_EXTENSION(thread_ptr)
1741 #endif
1742 
1743 
1744 /* Add a default macro that can be re-defined in tx_port.h to add processing to the thread stack analyze function.
1745    By default, this is simply defined as whitespace.  */
1746 
1747 #ifndef TX_THREAD_STACK_ANALYZE_EXTENSION
1748 #define TX_THREAD_STACK_ANALYZE_EXTENSION
1749 #endif
1750 
1751 
1752 /* Add a default macro that can be re-defined in tx_port.h to add processing to the initialize kernel enter function.
1753    By default, this is simply defined as whitespace.  */
1754 
1755 #ifndef TX_INITIALIZE_KERNEL_ENTER_EXTENSION
1756 #define TX_INITIALIZE_KERNEL_ENTER_EXTENSION
1757 #endif
1758 
1759 
1760 /* Check for MISRA compliance requirements.  */
1761 
1762 #ifdef TX_MISRA_ENABLE
1763 
1764 
1765 /* Define MISRA-specific routines.  */
1766 
1767 VOID                    _tx_misra_memset(VOID *ptr, UINT value, UINT size);
1768 UCHAR                   *_tx_misra_uchar_pointer_add(UCHAR *ptr, ULONG amount);
1769 UCHAR                   *_tx_misra_uchar_pointer_sub(UCHAR *ptr, ULONG amount);
1770 ULONG                   _tx_misra_uchar_pointer_dif(UCHAR *ptr1, UCHAR *ptr2);
1771 ULONG                   _tx_misra_pointer_to_ulong_convert(VOID *ptr);
1772 ULONG                   *_tx_misra_ulong_pointer_add(ULONG *ptr, ULONG amount);
1773 ULONG                   *_tx_misra_ulong_pointer_sub(ULONG *ptr, ULONG amount);
1774 ULONG                   _tx_misra_ulong_pointer_dif(ULONG *ptr1, ULONG *ptr2);
1775 VOID                    *_tx_misra_ulong_to_pointer_convert(ULONG input);
1776 VOID                    _tx_misra_message_copy(ULONG **source, ULONG **destination, UINT size);
1777 ULONG                   _tx_misra_timer_pointer_dif(TX_TIMER_INTERNAL **ptr1, TX_TIMER_INTERNAL **ptr2);
1778 TX_TIMER_INTERNAL       **_tx_misra_timer_pointer_add(TX_TIMER_INTERNAL **ptr1, ULONG size);
1779 VOID                    _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL *internal_timer, TX_TIMER **user_timer);
1780 VOID                    _tx_misra_thread_stack_check(TX_THREAD *thread_ptr, VOID **highest_stack);
1781 VOID                    _tx_misra_trace_event_insert(ULONG event_id, VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, ULONG info_field_4, ULONG filter, ULONG time_stamp);
1782 UINT                    _tx_misra_always_true(void);
1783 
1784 UCHAR                   **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **pointer);
1785 UCHAR                   **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer);
1786 UCHAR                   *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool);
1787 TX_BLOCK_POOL           *_tx_misra_void_to_block_pool_pointer_convert(VOID *pointer);
1788 UCHAR                   *_tx_misra_void_to_uchar_pointer_convert(VOID *pointer);
1789 TX_BLOCK_POOL           *_tx_misra_uchar_to_block_pool_pointer_convert(UCHAR *pointer);
1790 UCHAR                   **_tx_misra_void_to_indirect_uchar_pointer_convert(VOID *pointer);
1791 TX_BYTE_POOL            *_tx_misra_void_to_byte_pool_pointer_convert(VOID *pointer);
1792 UCHAR                   *_tx_misra_byte_pool_to_uchar_pointer_convert(TX_BYTE_POOL *pool);
1793 ALIGN_TYPE              *_tx_misra_uchar_to_align_type_pointer_convert(UCHAR *pointer);
1794 TX_BYTE_POOL            **_tx_misra_uchar_to_indirect_byte_pool_pointer_convert(UCHAR *pointer);
1795 TX_EVENT_FLAGS_GROUP    *_tx_misra_void_to_event_flags_pointer_convert(VOID *pointer);
1796 ULONG                   *_tx_misra_void_to_ulong_pointer_convert(VOID *pointer);
1797 TX_MUTEX                *_tx_misra_void_to_mutex_pointer_convert(VOID *pointer);
1798 UINT                    _tx_misra_status_get(UINT status);
1799 TX_QUEUE                *_tx_misra_void_to_queue_pointer_convert(VOID *pointer);
1800 TX_SEMAPHORE            *_tx_misra_void_to_semaphore_pointer_convert(VOID *pointer);
1801 VOID                    *_tx_misra_uchar_to_void_pointer_convert(UCHAR  *pointer);
1802 TX_THREAD               *_tx_misra_ulong_to_thread_pointer_convert(ULONG value);
1803 VOID                    *_tx_misra_timer_indirect_to_void_pointer_convert(TX_TIMER_INTERNAL **pointer);
1804 CHAR                    *_tx_misra_const_char_to_char_pointer_convert(const char *pointer);
1805 TX_THREAD               *_tx_misra_void_to_thread_pointer_convert(VOID  *pointer);
1806 UCHAR                   *_tx_misra_char_to_uchar_pointer_convert(CHAR  *pointer);
1807 VOID                    _tx_misra_event_flags_group_not_used(TX_EVENT_FLAGS_GROUP *group_ptr);
1808 VOID                    _tx_misra_event_flags_set_notify_not_used(VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *notify_group_ptr));
1809 VOID                    _tx_misra_queue_not_used(TX_QUEUE *queue_ptr);
1810 VOID                    _tx_misra_queue_send_notify_not_used(VOID (*queue_send_notify)(TX_QUEUE *notify_queue_ptr));
1811 VOID                    _tx_misra_semaphore_not_used(TX_SEMAPHORE *semaphore_ptr);
1812 VOID                    _tx_misra_semaphore_put_notify_not_used(VOID (*semaphore_put_notify)(TX_SEMAPHORE *notify_semaphore_ptr));
1813 VOID                    _tx_misra_thread_not_used(TX_THREAD *thread_ptr);
1814 VOID                    _tx_misra_thread_entry_exit_notify_not_used(VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT id));
1815 
1816 
1817 #define TX_MEMSET(a,b,c)                                _tx_misra_memset((a), (UINT) (b), (UINT) (c))
1818 #define TX_UCHAR_POINTER_ADD(a,b)                       _tx_misra_uchar_pointer_add((UCHAR *) (a), (ULONG) (b))
1819 #define TX_UCHAR_POINTER_SUB(a,b)                       _tx_misra_uchar_pointer_sub((UCHAR *) (a), (ULONG) (b))
1820 #define TX_UCHAR_POINTER_DIF(a,b)                       _tx_misra_uchar_pointer_dif((UCHAR *) (a), (UCHAR *) (b))
1821 #define TX_ULONG_POINTER_ADD(a,b)                       _tx_misra_ulong_pointer_add((ULONG *) (a), (ULONG) (b))
1822 #define TX_ULONG_POINTER_SUB(a,b)                       _tx_misra_ulong_pointer_sub((ULONG *) (a), (ULONG) (b))
1823 #define TX_ULONG_POINTER_DIF(a,b)                       _tx_misra_ulong_pointer_dif((ULONG *) (a), (ULONG *) (b))
1824 #define TX_POINTER_TO_ULONG_CONVERT(a)                  _tx_misra_pointer_to_ulong_convert((VOID *) (a))
1825 #define TX_ULONG_TO_POINTER_CONVERT(a)                  _tx_misra_ulong_to_pointer_convert((ULONG) (a))
1826 #define TX_QUEUE_MESSAGE_COPY(s,d,z)                    _tx_misra_message_copy(&(s), &(d), (z));
1827 #define TX_TIMER_POINTER_DIF(a,b)                       _tx_misra_timer_pointer_dif((TX_TIMER_INTERNAL **) (a), (TX_TIMER_INTERNAL **) (b))
1828 #define TX_TIMER_POINTER_ADD(a,b)                       _tx_misra_timer_pointer_add((TX_TIMER_INTERNAL **) (a), (ULONG) (b))
1829 #define TX_USER_TIMER_POINTER_GET(a,b)                  _tx_misra_user_timer_pointer_get((TX_TIMER_INTERNAL *) (a), (TX_TIMER **) &(b));
1830 #define TX_THREAD_STACK_CHECK(a)                        _tx_misra_thread_stack_check((a), &((a)->tx_thread_stack_highest_ptr));
1831 #ifdef TX_ENABLE_EVENT_TRACE
1832 #define TX_TRACE_IN_LINE_INSERT(i,a,b,c,d,e)            _tx_misra_trace_event_insert((ULONG) (i), (VOID *) (a), (ULONG) (b), (ULONG) (c), (ULONG) (d), (ULONG) (e), ((ULONG) TX_TRACE_TIME_SOURCE));
1833 #endif
1834 #define TX_LOOP_FOREVER                                 (_tx_misra_always_true() == TX_TRUE)
1835 
1836 
1837 #define TX_INDIRECT_VOID_TO_UCHAR_POINTER_CONVERT(a)    _tx_misra_indirect_void_to_uchar_pointer_convert((a))
1838 #define TX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(a)   _tx_misra_uchar_to_indirect_uchar_pointer_convert((a))
1839 #define TX_BLOCK_POOL_TO_UCHAR_POINTER_CONVERT(a)       _tx_misra_block_pool_to_uchar_pointer_convert((a))
1840 #define TX_VOID_TO_BLOCK_POOL_POINTER_CONVERT(a)        _tx_misra_void_to_block_pool_pointer_convert((a))
1841 #define TX_VOID_TO_UCHAR_POINTER_CONVERT(a)             _tx_misra_void_to_uchar_pointer_convert((a))
1842 #define TX_UCHAR_TO_BLOCK_POOL_POINTER_CONVERT(a)       _tx_misra_uchar_to_block_pool_pointer_convert((a))
1843 #define TX_VOID_TO_INDIRECT_UCHAR_POINTER_CONVERT(a)    _tx_misra_void_to_indirect_uchar_pointer_convert((a))
1844 #define TX_VOID_TO_BYTE_POOL_POINTER_CONVERT(a)         _tx_misra_void_to_byte_pool_pointer_convert((a))
1845 #define TX_BYTE_POOL_TO_UCHAR_POINTER_CONVERT(a)        _tx_misra_byte_pool_to_uchar_pointer_convert((a))
1846 #define TX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(a)       _tx_misra_uchar_to_align_type_pointer_convert((a))
1847 #define TX_UCHAR_TO_INDIRECT_BYTE_POOL_POINTER(a)       _tx_misra_uchar_to_indirect_byte_pool_pointer_convert((a))
1848 #define TX_VOID_TO_EVENT_FLAGS_POINTER_CONVERT(a)       _tx_misra_void_to_event_flags_pointer_convert((a))
1849 #define TX_VOID_TO_ULONG_POINTER_CONVERT(a)             _tx_misra_void_to_ulong_pointer_convert((a))
1850 #define TX_VOID_TO_MUTEX_POINTER_CONVERT(a)             _tx_misra_void_to_mutex_pointer_convert((a))
1851 #define TX_MUTEX_PRIORITIZE_MISRA_EXTENSION(a)          _tx_misra_status_get((a))
1852 #define TX_VOID_TO_QUEUE_POINTER_CONVERT(a)             _tx_misra_void_to_queue_pointer_convert((a))
1853 #define TX_VOID_TO_SEMAPHORE_POINTER_CONVERT(a)         _tx_misra_void_to_semaphore_pointer_convert((a))
1854 #define TX_UCHAR_TO_VOID_POINTER_CONVERT(a)             _tx_misra_uchar_to_void_pointer_convert((a))
1855 #define TX_ULONG_TO_THREAD_POINTER_CONVERT(a)           _tx_misra_ulong_to_thread_pointer_convert((a))
1856 #define TX_TIMER_INDIRECT_TO_VOID_POINTER_CONVERT(a)    _tx_misra_timer_indirect_to_void_pointer_convert((a))
1857 #ifndef TX_TIMER_INITIALIZE_EXTENSION
1858 #define TX_TIMER_INITIALIZE_EXTENSION(a)                status =  _tx_misra_status_get((a));
1859 #endif
1860 #define TX_CONST_CHAR_TO_CHAR_POINTER_CONVERT(a)        _tx_misra_const_char_to_char_pointer_convert((a))
1861 #define TX_VOID_TO_THREAD_POINTER_CONVERT(a)            _tx_misra_void_to_thread_pointer_convert((a))
1862 #define TX_CHAR_TO_UCHAR_POINTER_CONVERT(a)             _tx_misra_char_to_uchar_pointer_convert((a))
1863 #define TX_EVENT_FLAGS_GROUP_NOT_USED(a)                _tx_misra_event_flags_group_not_used((a))
1864 #define TX_EVENT_FLAGS_SET_NOTIFY_NOT_USED(a)           _tx_misra_event_flags_set_notify_not_used((a))
1865 #define TX_QUEUE_NOT_USED(a)                            _tx_misra_queue_not_used((a))
1866 #define TX_QUEUE_SEND_NOTIFY_NOT_USED(a)                _tx_misra_queue_send_notify_not_used((a))
1867 #define TX_SEMAPHORE_NOT_USED(a)                        _tx_misra_semaphore_not_used((a))
1868 #define TX_SEMAPHORE_PUT_NOTIFY_NOT_USED(a)             _tx_misra_semaphore_put_notify_not_used((a))
1869 #define TX_THREAD_NOT_USED(a)                           _tx_misra_thread_not_used((a))
1870 #define TX_THREAD_ENTRY_EXIT_NOTIFY_NOT_USED(a)         _tx_misra_thread_entry_exit_notify_not_used((a))
1871 
1872 
1873 #else
1874 
1875 /* Define the TX_MEMSET macro to the standard library function, if not already defined.  */
1876 
1877 #ifndef TX_MEMSET
1878 #define TX_MEMSET(a,b,c)                                memset((a),(b),(c))
1879 #endif
1880 
1881 #define TX_UCHAR_POINTER_ADD(a,b)                       (((UCHAR *) (a)) + ((UINT) (b)))
1882 #define TX_UCHAR_POINTER_SUB(a,b)                       (((UCHAR *) (a)) - ((UINT) (b)))
1883 #define TX_UCHAR_POINTER_DIF(a,b)                       ((ULONG)(((UCHAR *) (a)) - ((UCHAR *) (b))))
1884 #define TX_ULONG_POINTER_ADD(a,b)                       (((ULONG *) (a)) + ((UINT) (b)))
1885 #define TX_ULONG_POINTER_SUB(a,b)                       (((ULONG *) (a)) - ((UINT) (b)))
1886 #define TX_ULONG_POINTER_DIF(a,b)                       ((ULONG)(((ULONG *) (a)) - ((ULONG *) (b))))
1887 #define TX_POINTER_TO_ULONG_CONVERT(a)                  ((ULONG) ((VOID *) (a)))
1888 #define TX_ULONG_TO_POINTER_CONVERT(a)                  ((VOID *) ((ULONG) (a)))
1889 #define TX_POINTER_TO_ALIGN_TYPE_CONVERT(a)             ((ALIGN_TYPE) ((VOID *) (a)))
1890 #define TX_ALIGN_TYPE_TO_POINTER_CONVERT(a)             ((VOID *) ((ALIGN_TYPE) (a)))
1891 #define TX_TIMER_POINTER_DIF(a,b)                       ((ULONG)(((TX_TIMER_INTERNAL **) (a)) - ((TX_TIMER_INTERNAL **) (b))))
1892 #define TX_TIMER_POINTER_ADD(a,b)                       (((TX_TIMER_INTERNAL **) (a)) + ((ULONG) (b)))
1893 #define TX_USER_TIMER_POINTER_GET(a,b)                  { \
1894                                                             UCHAR   *working_ptr; \
1895                                                             working_ptr =  (UCHAR *) (a);   \
1896                                                             (b) =  (TX_TIMER *) working_ptr; \
1897                                                             working_ptr =  working_ptr - (((UCHAR *) &(b) -> tx_timer_internal) - ((UCHAR *) &(b) -> tx_timer_id)); \
1898                                                             (b) =  (TX_TIMER *) working_ptr; \
1899                                                         }
1900 #define TX_LOOP_FOREVER                                 ((UINT) 1)
1901 
1902 
1903 #define TX_INDIRECT_VOID_TO_UCHAR_POINTER_CONVERT(a)    ((UCHAR **) ((VOID *) (a)))
1904 #define TX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(a)   ((UCHAR **) ((VOID *) (a)))
1905 #define TX_BLOCK_POOL_TO_UCHAR_POINTER_CONVERT(a)       ((UCHAR *) ((VOID *) (a)))
1906 #define TX_VOID_TO_BLOCK_POOL_POINTER_CONVERT(a)        ((TX_BLOCK_POOL *) ((VOID *) (a)))
1907 #define TX_VOID_TO_UCHAR_POINTER_CONVERT(a)             ((UCHAR *) ((VOID *) (a)))
1908 #define TX_UCHAR_TO_BLOCK_POOL_POINTER_CONVERT(a)       ((TX_BLOCK_POOL *) ((VOID *) (a)))
1909 #define TX_VOID_TO_INDIRECT_UCHAR_POINTER_CONVERT(a)    ((UCHAR **) ((VOID *) (a)))
1910 #define TX_VOID_TO_BYTE_POOL_POINTER_CONVERT(a)         ((TX_BYTE_POOL *) ((VOID *) (a)))
1911 #define TX_BYTE_POOL_TO_UCHAR_POINTER_CONVERT(a)        ((UCHAR *) ((VOID *) (a)))
1912 #ifndef TX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT
1913 #define TX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(a)       ((ALIGN_TYPE *) ((VOID *) (a)))
1914 #endif
1915 #define TX_UCHAR_TO_INDIRECT_BYTE_POOL_POINTER(a)       ((TX_BYTE_POOL **) ((VOID *) (a)))
1916 #define TX_VOID_TO_EVENT_FLAGS_POINTER_CONVERT(a)       ((TX_EVENT_FLAGS_GROUP *) ((VOID *) (a)))
1917 #define TX_VOID_TO_ULONG_POINTER_CONVERT(a)             ((ULONG *) ((VOID *) (a)))
1918 #define TX_VOID_TO_MUTEX_POINTER_CONVERT(a)             ((TX_MUTEX *) ((VOID *) (a)))
1919 #define TX_VOID_TO_QUEUE_POINTER_CONVERT(a)             ((TX_QUEUE *) ((VOID *) (a)))
1920 #define TX_VOID_TO_SEMAPHORE_POINTER_CONVERT(a)         ((TX_SEMAPHORE *) ((VOID *) (a)))
1921 #define TX_UCHAR_TO_VOID_POINTER_CONVERT(a)             ((VOID *) (a))
1922 #define TX_ULONG_TO_THREAD_POINTER_CONVERT(a)           ((TX_THREAD *) ((VOID *) (a)))
1923 #ifndef TX_TIMER_INDIRECT_TO_VOID_POINTER_CONVERT
1924 #define TX_TIMER_INDIRECT_TO_VOID_POINTER_CONVERT(a)    ((VOID *) (a))
1925 #endif
1926 #ifndef TX_TIMER_INITIALIZE_EXTENSION
1927 #define TX_TIMER_INITIALIZE_EXTENSION(a)
1928 #endif
1929 #define TX_CONST_CHAR_TO_CHAR_POINTER_CONVERT(a)        ((CHAR *) ((VOID *) (a)))
1930 #define TX_VOID_TO_THREAD_POINTER_CONVERT(a)            ((TX_THREAD *) ((VOID *) (a)))
1931 #define TX_CHAR_TO_UCHAR_POINTER_CONVERT(a)             ((UCHAR *) ((VOID *) (a)))
1932 #ifndef TX_EVENT_FLAGS_GROUP_NOT_USED
1933 #define TX_EVENT_FLAGS_GROUP_NOT_USED(a)                ((void)(a))
1934 #endif
1935 #ifndef TX_EVENT_FLAGS_SET_NOTIFY_NOT_USED
1936 #define TX_EVENT_FLAGS_SET_NOTIFY_NOT_USED(a)           ((void)(a))
1937 #endif
1938 #ifndef TX_QUEUE_NOT_USED
1939 #define TX_QUEUE_NOT_USED(a)                            ((void)(a))
1940 #endif
1941 #ifndef TX_QUEUE_SEND_NOTIFY_NOT_USED
1942 #define TX_QUEUE_SEND_NOTIFY_NOT_USED(a)                ((void)(a))
1943 #endif
1944 #ifndef TX_SEMAPHORE_NOT_USED
1945 #define TX_SEMAPHORE_NOT_USED(a)                        ((void)(a))
1946 #endif
1947 #ifndef TX_SEMAPHORE_PUT_NOTIFY_NOT_USED
1948 #define TX_SEMAPHORE_PUT_NOTIFY_NOT_USED(a)             ((void)(a))
1949 #endif
1950 #ifndef TX_THREAD_NOT_USED
1951 #define TX_THREAD_NOT_USED(a)                           ((void)(a))
1952 #endif
1953 #ifndef TX_THREAD_ENTRY_EXIT_NOTIFY_NOT_USED
1954 #define TX_THREAD_ENTRY_EXIT_NOTIFY_NOT_USED(a)         ((void)(a))
1955 #endif
1956 
1957 #endif
1958 
1959 
1960 /* Determine if there is an tx_api.h extension file to include.  */
1961 
1962 #ifdef TX_THREAD_API_EXTENSION
1963 
1964 /* Yes, bring in the tx_api.h extension file.  */
1965 #include "tx_api_extension.h"
1966 
1967 #endif
1968 
1969 
1970 /* Define safety critical configuration and exception handling.  */
1971 
1972 #ifdef TX_SAFETY_CRITICAL
1973 
1974 /* Ensure the maximum number of priorities is defined in safety critical mode.  */
1975 #ifndef TX_MAX_PRIORITIES
1976 #error "tx_port.h: TX_MAX_PRIORITIES not defined."
1977 #endif
1978 
1979 /* Ensure the maximum number of priorities is a multiple of 32.  */
1980 #if (TX_MAX_PRIORITIES  %32) != 0
1981 #error "tx_port.h: TX_MAX_PRIORITIES must be a multiple of 32."
1982 #endif
1983 
1984 /* Ensure error checking is enabled.  */
1985 #ifdef TX_DISABLE_ERROR_CHECKING
1986 #error "TX_DISABLE_ERROR_CHECKING must not be defined."
1987 #endif
1988 
1989 /* Ensure timer ISR processing is not defined.  */
1990 #ifdef TX_TIMER_PROCESS_IN_ISR
1991 #error "TX_TIMER_PROCESS_IN_ISR must not be defined."
1992 #endif
1993 
1994 /* Ensure timer reactivation in-line is not defined.  */
1995 #ifdef TX_REACTIVATE_INLINE
1996 #error "TX_REACTIVATE_INLINE must not be defined."
1997 #endif
1998 
1999 /* Ensure disable stack filling is not defined.  */
2000 #ifdef TX_DISABLE_STACK_FILLING
2001 #error "TX_DISABLE_STACK_FILLING must not be defined."
2002 #endif
2003 
2004 /* Ensure enable stack checking is not defined.  */
2005 #ifdef TX_ENABLE_STACK_CHECKING
2006 #error "TX_ENABLE_STACK_CHECKING must not be defined."
2007 #endif
2008 
2009 /* Ensure disable preemption-threshold is not defined.  */
2010 #ifdef TX_DISABLE_PREEMPTION_THRESHOLD
2011 #error "TX_DISABLE_PREEMPTION_THRESHOLD must not be defined."
2012 #endif
2013 
2014 /* Ensure disable redundant clearing is not defined.  */
2015 #ifdef TX_DISABLE_REDUNDANT_CLEARING
2016 #error "TX_DISABLE_REDUNDANT_CLEARING must not be defined."
2017 #endif
2018 
2019 /* Ensure no timer is not defined.  */
2020 #ifdef TX_NO_TIMER
2021 #error "TX_NO_TIMER must not be defined."
2022 #endif
2023 
2024 /* Ensure disable notify callbacks is not defined.  */
2025 #ifdef TX_DISABLE_NOTIFY_CALLBACKS
2026 #error "TX_DISABLE_NOTIFY_CALLBACKS must not be defined."
2027 #endif
2028 
2029 /* Ensure in-line thread suspend/resume is not defined.  */
2030 #ifdef TX_INLINE_THREAD_RESUME_SUSPEND
2031 #error "TX_INLINE_THREAD_RESUME_SUSPEND must not be defined."
2032 #endif
2033 
2034 /* Ensure not interruptable is not defined.  */
2035 #ifdef TX_NOT_INTERRUPTABLE
2036 #error "TX_NOT_INTERRUPTABLE must not be defined."
2037 #endif
2038 
2039 /* Ensure event trace enable is not defined.  */
2040 #ifdef TX_ENABLE_EVENT_TRACE
2041 #error "TX_ENABLE_EVENT_TRACE must not be defined."
2042 #endif
2043 
2044 /* Ensure block pool performance info enable is not defined.  */
2045 #ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
2046 #error "TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO must not be defined."
2047 #endif
2048 
2049 /* Ensure byte pool performance info enable is not defined.  */
2050 #ifdef TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO
2051 #error "TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO must not be defined."
2052 #endif
2053 
2054 /* Ensure event flag performance info enable is not defined.  */
2055 #ifdef TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO
2056 #error "TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO must not be defined."
2057 #endif
2058 
2059 /* Ensure mutex performance info enable is not defined.   */
2060 #ifdef TX_MUTEX_ENABLE_PERFORMANCE_INFO
2061 #error "TX_MUTEX_ENABLE_PERFORMANCE_INFO must not be defined."
2062 #endif
2063 
2064 /* Ensure queue performance info enable is not defined.  */
2065 #ifdef TX_QUEUE_ENABLE_PERFORMANCE_INFO
2066 #error "TX_QUEUE_ENABLE_PERFORMANCE_INFO must not be defined."
2067 #endif
2068 
2069 /* Ensure semaphore performance info enable is not defined.  */
2070 #ifdef TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO
2071 #error "TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO must not be defined."
2072 #endif
2073 
2074 /* Ensure thread performance info enable is not defined.  */
2075 #ifdef TX_THREAD_ENABLE_PERFORMANCE_INFO
2076 #error "TX_THREAD_ENABLE_PERFORMANCE_INFO must not be defined."
2077 #endif
2078 
2079 /* Ensure timer performance info enable is not defined.  */
2080 #ifdef TX_TIMER_ENABLE_PERFORMANCE_INFO
2081 #error "TX_TIMER_ENABLE_PERFORMANCE_INFO must not be defined."
2082 #endif
2083 
2084 
2085 /* Now define the safety critical exception handler.  */
2086 
2087 VOID    _tx_safety_critical_exception_handler(CHAR *file_name, INT line_number, UINT status);
2088 
2089 
2090 #ifndef TX_SAFETY_CRITICAL_EXCEPTION
2091 #define TX_SAFETY_CRITICAL_EXCEPTION(a, b, c)   _tx_safety_critical_exception_handler(a, b, c);
2092 #endif
2093 
2094 #ifndef TX_SAFETY_CRITICAL_EXCEPTION_HANDLER
2095 #define TX_SAFETY_CRITICAL_EXCEPTION_HANDLER    VOID  _tx_safety_critical_exception_handler(CHAR *file_name, INT line_number, UINT status) \
2096                                                 { \
2097                                                     while(1) \
2098                                                     { \
2099                                                     } \
2100                                                 }
2101 #endif
2102 #endif
2103 
2104 
2105 #ifdef TX_ENABLE_MULTI_ERROR_CHECKING
2106 
2107 /* Define ThreadX API MULTI run-time error checking function.  */
2108 void __ghs_rnerr(char *errMsg, int stackLevels, int stackTraceDisplay, void *hexVal);
2109 
2110 #endif
2111 
2112 /* Bring in the event logging constants and prototypes.  Note that
2113    TX_ENABLE_EVENT_LOGGING must be defined when building the ThreadX
2114    library components in order to enable event logging.  */
2115 
2116 #ifdef TX_ENABLE_EVENT_LOGGING
2117 #include "tx_el.h"
2118 #else
2119 #ifndef TX_SOURCE_CODE
2120 #ifndef TX_MISRA_ENABLE
2121 #define _tx_el_user_event_insert(a,b,c,d,e)
2122 #endif
2123 #endif
2124 #define TX_EL_INITIALIZE
2125 #define TX_EL_THREAD_REGISTER(a)
2126 #define TX_EL_THREAD_UNREGISTER(a)
2127 #define TX_EL_THREAD_STATUS_CHANGE_INSERT(a, b)
2128 #define TX_EL_BYTE_ALLOCATE_INSERT
2129 #define TX_EL_BYTE_POOL_CREATE_INSERT
2130 #define TX_EL_BYTE_POOL_DELETE_INSERT
2131 #define TX_EL_BYTE_RELEASE_INSERT
2132 #define TX_EL_BLOCK_ALLOCATE_INSERT
2133 #define TX_EL_BLOCK_POOL_CREATE_INSERT
2134 #define TX_EL_BLOCK_POOL_DELETE_INSERT
2135 #define TX_EL_BLOCK_RELEASE_INSERT
2136 #define TX_EL_EVENT_FLAGS_CREATE_INSERT
2137 #define TX_EL_EVENT_FLAGS_DELETE_INSERT
2138 #define TX_EL_EVENT_FLAGS_GET_INSERT
2139 #define TX_EL_EVENT_FLAGS_SET_INSERT
2140 #define TX_EL_INTERRUPT_CONTROL_INSERT
2141 #define TX_EL_QUEUE_CREATE_INSERT
2142 #define TX_EL_QUEUE_DELETE_INSERT
2143 #define TX_EL_QUEUE_FLUSH_INSERT
2144 #define TX_EL_QUEUE_RECEIVE_INSERT
2145 #define TX_EL_QUEUE_SEND_INSERT
2146 #define TX_EL_SEMAPHORE_CREATE_INSERT
2147 #define TX_EL_SEMAPHORE_DELETE_INSERT
2148 #define TX_EL_SEMAPHORE_GET_INSERT
2149 #define TX_EL_SEMAPHORE_PUT_INSERT
2150 #define TX_EL_THREAD_CREATE_INSERT
2151 #define TX_EL_THREAD_DELETE_INSERT
2152 #define TX_EL_THREAD_IDENTIFY_INSERT
2153 #define TX_EL_THREAD_PREEMPTION_CHANGE_INSERT
2154 #define TX_EL_THREAD_PRIORITY_CHANGE_INSERT
2155 #define TX_EL_THREAD_RELINQUISH_INSERT
2156 #define TX_EL_THREAD_RESUME_INSERT
2157 #define TX_EL_THREAD_SLEEP_INSERT
2158 #define TX_EL_THREAD_SUSPEND_INSERT
2159 #define TX_EL_THREAD_TERMINATE_INSERT
2160 #define TX_EL_THREAD_TIME_SLICE_CHANGE_INSERT
2161 #define TX_EL_TIME_GET_INSERT
2162 #define TX_EL_TIME_SET_INSERT
2163 #define TX_EL_TIMER_ACTIVATE_INSERT
2164 #define TX_EL_TIMER_CHANGE_INSERT
2165 #define TX_EL_TIMER_CREATE_INSERT
2166 #define TX_EL_TIMER_DEACTIVATE_INSERT
2167 #define TX_EL_TIMER_DELETE_INSERT
2168 #define TX_EL_BLOCK_POOL_INFO_GET_INSERT
2169 #define TX_EL_BLOCK_POOL_PRIORITIZE_INSERT
2170 #define TX_EL_BYTE_POOL_INFO_GET_INSERT
2171 #define TX_EL_BYTE_POOL_PRIORITIZE_INSERT
2172 #define TX_EL_EVENT_FLAGS_INFO_GET_INSERT
2173 #define TX_EL_MUTEX_CREATE_INSERT
2174 #define TX_EL_MUTEX_DELETE_INSERT
2175 #define TX_EL_MUTEX_GET_INSERT
2176 #define TX_EL_MUTEX_INFO_GET_INSERT
2177 #define TX_EL_MUTEX_PRIORITIZE_INSERT
2178 #define TX_EL_MUTEX_PUT_INSERT
2179 #define TX_EL_QUEUE_INFO_GET_INSERT
2180 #define TX_EL_QUEUE_FRONT_SEND_INSERT
2181 #define TX_EL_QUEUE_PRIORITIZE_INSERT
2182 #define TX_EL_SEMAPHORE_INFO_GET_INSERT
2183 #define TX_EL_SEMAPHORE_PRIORITIZE_INSERT
2184 #define TX_EL_THREAD_INFO_GET_INSERT
2185 #define TX_EL_THREAD_WAIT_ABORT_INSERT
2186 #define TX_EL_TIMER_INFO_GET_INSERT
2187 #define TX_EL_BLOCK_POOL_PERFORMANCE_INFO_GET_INSERT
2188 #define TX_EL_BLOCK_POOL_PERFORMANCE_SYSTEM_INFO_GET_INSERT
2189 #define TX_EL_BYTE_POOL_PERFORMANCE_INFO_GET_INSERT
2190 #define TX_EL_BYTE_POOL_PERFORMANCE_SYSTEM_INFO_GET_INSERT
2191 #define TX_EL_EVENT_FLAGS_PERFORMANCE_INFO_GET_INSERT
2192 #define TX_EL_EVENT_FLAGS__PERFORMANCE_SYSTEM_INFO_GET_INSERT
2193 #define TX_EL_EVENT_FLAGS_SET_NOTIFY_INSERT
2194 #define TX_EL_MUTEX_PERFORMANCE_INFO_GET_INSERT
2195 #define TX_EL_MUTEX_PERFORMANCE_SYSTEM_INFO_GET_INSERT
2196 #define TX_EL_QUEUE_PERFORMANCE_INFO_GET_INSERT
2197 #define TX_EL_QUEUE_PERFORMANCE_SYSTEM_INFO_GET_INSERT
2198 #define TX_EL_QUEUE_SEND_NOTIFY_INSERT
2199 #define TX_EL_SEMAPHORE_CEILING_PUT_INSERT
2200 #define TX_EL_SEMAPHORE_PERFORMANCE_INFO_GET_INSERT
2201 #define TX_EL_SEMAPHORE_PERFORMANCE_SYSTEM_INFO_GET_INSERT
2202 #define TX_EL_SEMAPHORE_PUT_NOTIFY_INSERT
2203 #define TX_EL_THREAD_ENTRY_EXIT_NOTIFY_INSERT
2204 #define TX_EL_THREAD_RESET_INSERT
2205 #define TX_EL_THREAD_PERFORMANCE_INFO_GET_INSERT
2206 #define TX_EL_THREAD_PERFORMANCE_SYSTEM_INFO_GET_INSERT
2207 #define TX_EL_THREAD_STACK_ERROR_NOTIFY_INSERT
2208 #define TX_EL_TIMER_PERFORMANCE_INFO_GET_INSERT
2209 #define TX_EL_TIMER_PERFORMANCE_SYSTEM_INFO_GET_INSERT
2210 
2211 #endif
2212 
2213 
2214 
2215 /* Determine if a C++ compiler is being used.  If so, complete the standard
2216    C conditional started above.  */
2217 #ifdef __cplusplus
2218         }
2219 #endif
2220 
2221 #endif
2222 
2223