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/**   ThreadX MISRA Compliance                                            */
19/**                                                                       */
20/**************************************************************************/
21/**************************************************************************/
22
23#ifdef TX_INCLUDE_USER_DEFINE_FILE
24#include "tx_user.h"
25#endif
26
27        #define SHT_PROGBITS 0x1
28
29        .global __aeabi_memset
30        .global _tx_thread_current_ptr
31        .global _tx_thread_interrupt_disable
32        .global _tx_thread_interrupt_restore
33        .global _tx_thread_stack_analyze
34        .global _tx_thread_stack_error_handler
35        .global _tx_thread_system_state
36#ifdef TX_ENABLE_EVENT_TRACE
37        .global _tx_trace_buffer_current_ptr
38        .global _tx_trace_buffer_end_ptr
39        .global _tx_trace_buffer_start_ptr
40        .global _tx_trace_event_enable_bits
41        .global _tx_trace_full_notify_function
42        .global _tx_trace_header_ptr
43#endif
44
45        .global _tx_misra_always_true
46        .global _tx_misra_block_pool_to_uchar_pointer_convert
47        .global _tx_misra_byte_pool_to_uchar_pointer_convert
48        .global _tx_misra_char_to_uchar_pointer_convert
49        .global _tx_misra_const_char_to_char_pointer_convert
50#ifdef TX_ENABLE_EVENT_TRACE
51        .global _tx_misra_entry_to_uchar_pointer_convert
52#endif
53        .global _tx_misra_indirect_void_to_uchar_pointer_convert
54        .global _tx_misra_memset
55        .global _tx_misra_message_copy
56#ifdef TX_ENABLE_EVENT_TRACE
57        .global _tx_misra_object_to_uchar_pointer_convert
58#endif
59        .global _tx_misra_pointer_to_ulong_convert
60        .global _tx_misra_status_get
61        .global _tx_misra_thread_stack_check
62#ifdef TX_ENABLE_EVENT_TRACE
63        .global _tx_misra_time_stamp_get
64#endif
65        .global _tx_misra_timer_indirect_to_void_pointer_convert
66        .global _tx_misra_timer_pointer_add
67        .global _tx_misra_timer_pointer_dif
68#ifdef TX_ENABLE_EVENT_TRACE
69        .global _tx_misra_trace_event_insert
70#endif
71        .global _tx_misra_uchar_pointer_add
72        .global _tx_misra_uchar_pointer_dif
73        .global _tx_misra_uchar_pointer_sub
74        .global _tx_misra_uchar_to_align_type_pointer_convert
75        .global _tx_misra_uchar_to_block_pool_pointer_convert
76#ifdef TX_ENABLE_EVENT_TRACE
77        .global _tx_misra_uchar_to_entry_pointer_convert
78        .global _tx_misra_uchar_to_header_pointer_convert
79#endif
80        .global _tx_misra_uchar_to_indirect_byte_pool_pointer_convert
81        .global _tx_misra_uchar_to_indirect_uchar_pointer_convert
82#ifdef TX_ENABLE_EVENT_TRACE
83        .global _tx_misra_uchar_to_object_pointer_convert
84#endif
85        .global _tx_misra_uchar_to_void_pointer_convert
86        .global _tx_misra_ulong_pointer_add
87        .global _tx_misra_ulong_pointer_dif
88        .global _tx_misra_ulong_pointer_sub
89        .global _tx_misra_ulong_to_pointer_convert
90        .global _tx_misra_ulong_to_thread_pointer_convert
91        .global _tx_misra_user_timer_pointer_get
92        .global _tx_misra_void_to_block_pool_pointer_convert
93        .global _tx_misra_void_to_byte_pool_pointer_convert
94        .global _tx_misra_void_to_event_flags_pointer_convert
95        .global _tx_misra_void_to_indirect_uchar_pointer_convert
96        .global _tx_misra_void_to_mutex_pointer_convert
97        .global _tx_misra_void_to_queue_pointer_convert
98        .global _tx_misra_void_to_semaphore_pointer_convert
99        .global _tx_misra_void_to_thread_pointer_convert
100        .global _tx_misra_void_to_uchar_pointer_convert
101        .global _tx_misra_void_to_ulong_pointer_convert
102        .global _tx_misra_ipsr_get
103        .global _tx_misra_control_get
104        .global _tx_misra_control_set
105#ifdef __ARM_FP
106        .global _tx_misra_fpccr_get
107        .global _tx_misra_vfp_touch
108#endif
109
110        .global _tx_misra_event_flags_group_not_used
111        .global _tx_misra_event_flags_set_notify_not_used
112        .global _tx_misra_queue_not_used
113        .global _tx_misra_queue_send_notify_not_used
114        .global _tx_misra_semaphore_not_used
115        .global _tx_misra_semaphore_put_notify_not_used
116        .global _tx_misra_thread_entry_exit_notify_not_used
117        .global _tx_misra_thread_not_used
118
119/**************************************************************************/
120/**************************************************************************/
121/**                                                                       */
122/**  VOID  _tx_misra_memset(VOID *ptr, UINT value, UINT size);            */
123/**                                                                       */
124/**************************************************************************/
125/**************************************************************************/
126
127        .text
128        .align 4
129        .syntax unified
130        .thumb_func
131_tx_misra_memset:
132        PUSH     {R4,LR}
133        MOVS     R4,R0
134        MOVS     R0,R2
135        MOVS     R2,R1
136        MOVS     R1,R0
137        MOVS     R0,R4
138        BL       __aeabi_memset
139        POP      {R4,PC}          // return
140
141/**************************************************************************/
142/**************************************************************************/
143/**                                                                       */
144/**  UCHAR  *_tx_misra_uchar_pointer_add(UCHAR *ptr, ULONG amount);       */
145/**                                                                       */
146/**************************************************************************/
147/**************************************************************************/
148
149        .text
150        .thumb_func
151_tx_misra_uchar_pointer_add:
152        ADD      R0,R0,R1
153        BX       LR               // return
154
155
156/**************************************************************************/
157/**************************************************************************/
158/**                                                                       */
159/**  UCHAR  *_tx_misra_uchar_pointer_sub(UCHAR *ptr, ULONG amount);       */
160/**                                                                       */
161/**************************************************************************/
162/**************************************************************************/
163
164        .text
165        .thumb_func
166_tx_misra_uchar_pointer_sub:
167        RSBS     R1,R1,#+0
168        ADD      R0,R0,R1
169        BX       LR               // return
170
171
172/**************************************************************************/
173/**************************************************************************/
174/**                                                                       */
175/**  ULONG  _tx_misra_uchar_pointer_dif(UCHAR *ptr1, UCHAR *ptr2);        */
176/**                                                                       */
177/**************************************************************************/
178/**************************************************************************/
179
180        .text
181        .thumb_func
182_tx_misra_uchar_pointer_dif:
183        SUBS     R0,R0,R1
184        BX       LR               // return
185
186
187/************************************************************************************************************************************/
188/************************************************************************************************************************************/
189/**                                                                                                                                 */
190/**  This single function serves all of the below prototypes.                                                                       */
191/**                                                                                                                                 */
192/**  ULONG  _tx_misra_pointer_to_ulong_convert(VOID *ptr);                                                                          */
193/**  VOID  *_tx_misra_ulong_to_pointer_convert(ULONG input);                                                                        */
194/**  UCHAR  **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **return_ptr);                                                  */
195/**  UCHAR  **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer);                                                    */
196/**  UCHAR  *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool);                                                    */
197/**  TX_BLOCK_POOL  *_tx_misra_void_to_block_pool_pointer_convert(VOID *pointer);                                                   */
198/**  UCHAR  *_tx_misra_void_to_uchar_pointer_convert(VOID *pointer);                                                                */
199/**  TX_BLOCK_POOL *_tx_misra_uchar_to_block_pool_pointer_convert(UCHAR *pointer);                                                  */
200/**  UCHAR  **_tx_misra_void_to_indirect_uchar_pointer_convert(VOID *pointer);                                                      */
201/**  TX_BYTE_POOL  *_tx_misra_void_to_byte_pool_pointer_convert(VOID *pointer);                                                     */
202/**  UCHAR  *_tx_misra_byte_pool_to_uchar_pointer_convert(TX_BYTE_POOL *pool);                                                      */
203/**  ALIGN_TYPE  *_tx_misra_uchar_to_align_type_pointer_convert(UCHAR *pointer);                                                    */
204/**  TX_BYTE_POOL  **_tx_misra_uchar_to_indirect_byte_pool_pointer_convert(UCHAR *pointer);                                         */
205/**  TX_EVENT_FLAGS_GROUP  *_tx_misra_void_to_event_flags_pointer_convert(VOID *pointer);                                           */
206/**  ULONG  *_tx_misra_void_to_ulong_pointer_convert(VOID *pointer);                                                                */
207/**  TX_MUTEX  *_tx_misra_void_to_mutex_pointer_convert(VOID *pointer);                                                             */
208/**  TX_QUEUE  *_tx_misra_void_to_queue_pointer_convert(VOID *pointer);                                                             */
209/**  TX_SEMAPHORE  *_tx_misra_void_to_semaphore_pointer_convert(VOID *pointer);                                                     */
210/**  VOID  *_tx_misra_uchar_to_void_pointer_convert(UCHAR *pointer);                                                                */
211/**  TX_THREAD  *_tx_misra_ulong_to_thread_pointer_convert(ULONG value);                                                            */
212/**  VOID  *_tx_misra_timer_indirect_to_void_pointer_convert(TX_TIMER_INTERNAL **pointer);                                          */
213/**  CHAR  *_tx_misra_const_char_to_char_pointer_convert(const char *pointer);                                                      */
214/**  TX_THREAD  *_tx_misra_void_to_thread_pointer_convert(void *pointer);                                                           */
215/**  UCHAR  *_tx_misra_object_to_uchar_pointer_convert(TX_TRACE_OBJECT_ENTRY *pointer);                                             */
216/**  TX_TRACE_OBJECT_ENTRY  *_tx_misra_uchar_to_object_pointer_convert(UCHAR *pointer);                                             */
217/**  TX_TRACE_HEADER  *_tx_misra_uchar_to_header_pointer_convert(UCHAR *pointer);                                                   */
218/**  TX_TRACE_BUFFER_ENTRY  *_tx_misra_uchar_to_entry_pointer_convert(UCHAR *pointer);                                              */
219/**  UCHAR  *_tx_misra_entry_to_uchar_pointer_convert(TX_TRACE_BUFFER_ENTRY *pointer);                                              */
220/**  UCHAR  *_tx_misra_char_to_uchar_pointer_convert(CHAR *pointer);                                                                */
221/**  VOID    _tx_misra_event_flags_group_not_used(TX_EVENT_FLAGS_GROUP *group_ptr);                                                 */
222/**  VOID    _tx_misra_event_flags_set_notify_not_used(VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *notify_group_ptr));          */
223/**  VOID    _tx_misra_queue_not_used(TX_QUEUE *queue_ptr);                                                                         */
224/**  VOID    _tx_misra_queue_send_notify_not_used(VOID (*queue_send_notify)(TX_QUEUE *notify_queue_ptr));                           */
225/**  VOID    _tx_misra_semaphore_not_used(TX_SEMAPHORE *semaphore_ptr);                                                             */
226/**  VOID    _tx_misra_semaphore_put_notify_not_used(VOID (*semaphore_put_notify)(TX_SEMAPHORE *notify_semaphore_ptr));             */
227/**  VOID    _tx_misra_thread_not_used(TX_THREAD *thread_ptr);                                                                      */
228/**  VOID    _tx_misra_thread_entry_exit_notify_not_used(VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT id));  */
229/**                                                                                                                                 */
230/************************************************************************************************************************************/
231/************************************************************************************************************************************/
232        .text
233        .thumb_func
234_tx_misra_pointer_to_ulong_convert:
235_tx_misra_ulong_to_pointer_convert:
236_tx_misra_indirect_void_to_uchar_pointer_convert:
237_tx_misra_uchar_to_indirect_uchar_pointer_convert:
238_tx_misra_block_pool_to_uchar_pointer_convert:
239_tx_misra_void_to_block_pool_pointer_convert:
240_tx_misra_void_to_uchar_pointer_convert:
241_tx_misra_uchar_to_block_pool_pointer_convert:
242_tx_misra_void_to_indirect_uchar_pointer_convert:
243_tx_misra_void_to_byte_pool_pointer_convert:
244_tx_misra_byte_pool_to_uchar_pointer_convert:
245_tx_misra_uchar_to_align_type_pointer_convert:
246_tx_misra_uchar_to_indirect_byte_pool_pointer_convert:
247_tx_misra_void_to_event_flags_pointer_convert:
248_tx_misra_void_to_ulong_pointer_convert:
249_tx_misra_void_to_mutex_pointer_convert:
250_tx_misra_void_to_queue_pointer_convert:
251_tx_misra_void_to_semaphore_pointer_convert:
252_tx_misra_uchar_to_void_pointer_convert:
253_tx_misra_ulong_to_thread_pointer_convert:
254_tx_misra_timer_indirect_to_void_pointer_convert:
255_tx_misra_const_char_to_char_pointer_convert:
256_tx_misra_void_to_thread_pointer_convert:
257#ifdef TX_ENABLE_EVENT_TRACE
258_tx_misra_object_to_uchar_pointer_convert:
259_tx_misra_uchar_to_object_pointer_convert:
260_tx_misra_uchar_to_header_pointer_convert:
261_tx_misra_uchar_to_entry_pointer_convert:
262_tx_misra_entry_to_uchar_pointer_convert:
263#endif
264_tx_misra_char_to_uchar_pointer_convert:
265_tx_misra_event_flags_group_not_used:
266_tx_misra_event_flags_set_notify_not_used:
267_tx_misra_queue_not_used:
268_tx_misra_queue_send_notify_not_used:
269_tx_misra_semaphore_not_used:
270_tx_misra_semaphore_put_notify_not_used:
271_tx_misra_thread_entry_exit_notify_not_used:
272_tx_misra_thread_not_used:
273
274        BX       LR               // return
275
276
277/**************************************************************************/
278/**************************************************************************/
279/**                                                                       */
280/**  ULONG  *_tx_misra_ulong_pointer_add(ULONG *ptr, ULONG amount);       */
281/**                                                                       */
282/**************************************************************************/
283/**************************************************************************/
284
285        .text
286        .thumb_func
287_tx_misra_ulong_pointer_add:
288        LSLS    R1,#2
289        ADD     R0,R0,R1
290        BX      LR              // return
291
292
293/**************************************************************************/
294/**************************************************************************/
295/**                                                                       */
296/**  ULONG  *_tx_misra_ulong_pointer_sub(ULONG *ptr, ULONG amount);       */
297/**                                                                       */
298/**************************************************************************/
299/**************************************************************************/
300
301        .text
302        .thumb_func
303_tx_misra_ulong_pointer_sub:
304        MOVS    R3,#3
305        MVNS    R2,R3
306        MULS    R1,R2,R1
307        ADD     R0,R0,R1
308        BX      LR               // return
309
310
311/**************************************************************************/
312/**************************************************************************/
313/**                                                                       */
314/**  ULONG  _tx_misra_ulong_pointer_dif(ULONG *ptr1, ULONG *ptr2);        */
315/**                                                                       */
316/**************************************************************************/
317/**************************************************************************/
318
319        .text
320        .thumb_func
321_tx_misra_ulong_pointer_dif:
322        SUBS     R0,R0,R1
323        ASRS     R0,R0,#+2
324        BX       LR               // return
325
326
327/**************************************************************************/
328/**************************************************************************/
329/**                                                                       */
330/**  VOID  _tx_misra_message_copy(ULONG **source, ULONG **destination,    */
331/**                                                           UINT size); */
332/**                                                                       */
333/**************************************************************************/
334/**************************************************************************/
335
336        .text
337        .thumb_func
338_tx_misra_message_copy:
339        PUSH     {R4,R5}
340        LDR      R3,[R0, #+0]
341        LDR      R4,[R1, #+0]
342        LDR      R5,[R3, #+0]
343        STR      R5,[R4, #+0]
344        ADDS     R4,R4,#+4
345        ADDS     R3,R3,#+4
346        CMP      R2,#+2
347        BCC.N    _tx_misra_message_copy_0
348        SUBS     R2,R2,#+1
349        B.N      _tx_misra_message_copy_1
350_tx_misra_message_copy_2:
351        LDR      R5,[R3, #+0]
352        STR      R5,[R4, #+0]
353        ADDS     R4,R4,#+4
354        ADDS     R3,R3,#+4
355        SUBS     R2,R2,#+1
356_tx_misra_message_copy_1:
357        CMP      R2,#+0
358        BNE.N    _tx_misra_message_copy_2
359_tx_misra_message_copy_0:
360        STR      R3,[R0, #+0]
361        STR      R4,[R1, #+0]
362        POP      {R4,R5}
363        BX       LR               // return
364
365
366/**************************************************************************/
367/**************************************************************************/
368/**                                                                       */
369/**  ULONG  _tx_misra_timer_pointer_dif(TX_TIMER_INTERNAL **ptr1,         */
370/**                                           TX_TIMER_INTERNAL **ptr2);  */
371/**                                                                       */
372/**************************************************************************/
373/**************************************************************************/
374
375        .text
376        .thumb_func
377_tx_misra_timer_pointer_dif:
378        SUBS     R0,R0,R1
379        ASRS     R0,R0,#+2
380        BX       LR               // return
381
382
383/**************************************************************************/
384/**************************************************************************/
385/**                                                                       */
386/**  TX_TIMER_INTERNAL **_tx_misra_timer_pointer_add(TX_TIMER_INTERNAL    */
387/**                                                  **ptr1, ULONG size); */
388/**                                                                       */
389/**************************************************************************/
390/**************************************************************************/
391
392        .text
393        .thumb_func
394_tx_misra_timer_pointer_add:
395        LSLS    R1,#2
396        ADD     R0,R0,R1
397        BX      LR               // return
398
399
400/**************************************************************************/
401/**************************************************************************/
402/**                                                                       */
403/**  VOID  _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL             */
404/**                              *internal_timer, TX_TIMER **user_timer); */
405/**                                                                       */
406/**************************************************************************/
407/**************************************************************************/
408
409        .text
410        .thumb_func
411_tx_misra_user_timer_pointer_get:
412        SUBS    R0,#8
413        STR     R0,[R1, #+0]
414        BX      LR               // return
415
416
417/**************************************************************************/
418/**************************************************************************/
419/**                                                                       */
420/**  VOID  _tx_misra_thread_stack_check(TX_THREAD *thread_ptr,            */
421/**                                              VOID **highest_stack);   */
422/**                                                                       */
423/**************************************************************************/
424/**************************************************************************/
425
426        .text
427        .thumb_func
428_tx_misra_thread_stack_check:
429        PUSH    {R3-R7,LR}
430        MOVS    R4,R0
431        MOVS    R5,R1
432        BL      _tx_thread_interrupt_disable
433        CMP     R4,#0
434        BEQ.N   _tx_misra_thread_stack_check_0
435        LDR     R1,[R4]
436        LDR     R2,=0x54485244
437        CMP     R1,R2
438        BNE.N   _tx_misra_thread_stack_check_0
439        LDR     R1,[R4, #8]
440        LDR     R2,[R5]
441        CMP     R1,R2
442        BCS.N   _tx_misra_thread_stack_check_1
443        STR     R1,[R5]
444_tx_misra_thread_stack_check_1:
445        LDR     R1,[R4, #12]
446        LDR     R1,[R1]
447        LDR     R6,=0xEFEFEFEF
448        CMP     R1,R6
449        BNE.N   _tx_misra_thread_stack_check_2
450        LDR     R1,[R4, #16]
451        MOVS    R7,#1
452        LDR     R1,[R1, R7]
453        CMP     R1,R6
454        BNE.N   _tx_misra_thread_stack_check_2
455        LDR     R1,[R5]
456        LDR     R2,[R4, #12]
457        CMP     R1,R2
458        BCS.N   _tx_misra_thread_stack_check_3
459_tx_misra_thread_stack_check_2:
460        BL      _tx_thread_interrupt_restore
461        MOVS    R0,R4
462        BL      _tx_thread_stack_error_handler
463        BL      _tx_thread_interrupt_disable
464_tx_misra_thread_stack_check_3:
465        LDR     R1,[R5]
466        LDR     R7,=-4
467        LDR     R1,[R1, R7]
468        CMP     R1,R6
469        BEQ.N   _tx_misra_thread_stack_check_0
470        BL      _tx_thread_interrupt_restore
471        MOVS    R0,R4
472        BL      _tx_thread_stack_analyze
473        BL      _tx_thread_interrupt_disable
474_tx_misra_thread_stack_check_0:
475        BL      _tx_thread_interrupt_restore
476        POP     {R0,R4,R5,R6,R7,PC}    // return
477
478#ifdef TX_ENABLE_EVENT_TRACE
479
480/**************************************************************************/
481/**************************************************************************/
482/**                                                                       */
483/**  VOID  _tx_misra_trace_event_insert(ULONG event_id,                   */
484/**           VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, */
485/**           ULONG info_field_4, ULONG filter, ULONG time_stamp);        */
486/**                                                                       */
487/**************************************************************************/
488/**************************************************************************/
489
490        .text
491        .thumb_func
492_tx_misra_trace_event_insert:
493        PUSH     {R3-R7,LR}
494        LDR.N    R4,DataTable2_1
495        LDR      R4,[R4, #+0]
496        CMP      R4,#+0
497        BEQ.N    _tx_misra_trace_event_insert_0
498        LDR.N    R5,DataTable2_2
499        LDR      R5,[R5, #+0]
500        LDR      R6,[SP, #+28]
501        TST      R5,R6
502        BEQ.N    _tx_misra_trace_event_insert_0
503        LDR.N    R5,DataTable2_3
504        LDR      R5,[R5, #+0]
505        LDR.N    R6,DataTable2_4
506        LDR      R6,[R6, #+0]
507        CMP      R5,#+0
508        BNE.N    _tx_misra_trace_event_insert_1
509        LDR      R5,[R6, #+44]
510        LDR      R7,[R6, #+60]
511        LSLS     R7,R7,#+16
512        ORRS     R7,R7,#0x80000000
513        ORRS     R5,R7,R5
514        B.N      _tx_misra_trace_event_insert_2
515_tx_misra_trace_event_insert_1:
516        CMP      R5,#-252645136
517        BCS.N    _tx_misra_trace_event_insert_3
518        MOVS     R5,R6
519        MOVS     R6,#-1
520        B.N      _tx_misra_trace_event_insert_2
521_tx_misra_trace_event_insert_3:
522        MOVS     R6,#-252645136
523        MOVS     R5,#+0
524_tx_misra_trace_event_insert_2:
525        STR      R6,[R4, #+0]
526        STR      R5,[R4, #+4]
527        STR      R0,[R4, #+8]
528        LDR      R0,[SP, #+32]
529        STR      R0,[R4, #+12]
530        STR      R1,[R4, #+16]
531        STR      R2,[R4, #+20]
532        STR      R3,[R4, #+24]
533        LDR      R0,[SP, #+24]
534        STR      R0,[R4, #+28]
535        ADDS     R4,R4,#+32
536        LDR.N    R0,DataTable2_5
537        LDR      R0,[R0, #+0]
538        CMP      R4,R0
539        BCC.N    _tx_misra_trace_event_insert_4
540        LDR.N    R0,DataTable2_6
541        LDR      R4,[R0, #+0]
542        LDR.N    R0,DataTable2_1
543        STR      R4,[R0, #+0]
544        LDR.N    R0,DataTable2_7
545        LDR      R0,[R0, #+0]
546        STR      R4,[R0, #+32]
547        LDR.N    R0,DataTable2_8
548        LDR      R0,[R0, #+0]
549        CMP      R0,#+0
550        BEQ.N    _tx_misra_trace_event_insert_0
551        LDR.N    R0,DataTable2_7
552        LDR      R0,[R0, #+0]
553        LDR.N    R1,DataTable2_8
554        LDR      R1,[R1, #+0]
555        BLX      R1
556        B.N      _tx_misra_trace_event_insert_0
557_tx_misra_trace_event_insert_4:
558        LDR.N    R0,DataTable2_1
559        STR      R4,[R0, #+0]
560        LDR.N    R0,DataTable2_7
561        LDR      R0,[R0, #+0]
562        STR      R4,[R0, #+32]
563_tx_misra_trace_event_insert_0:
564        POP      {R0,R4-R7,PC}    // return
565
566
567        .data
568DataTable2_1:
569        .word     _tx_trace_buffer_current_ptr
570
571        .data
572DataTable2_2:
573        .word     _tx_trace_event_enable_bits
574
575        .data
576DataTable2_5:
577        .word     _tx_trace_buffer_end_ptr
578
579        .data
580DataTable2_6:
581        .word     _tx_trace_buffer_start_ptr
582
583        .data
584DataTable2_7:
585        .word     _tx_trace_header_ptr
586
587        .data
588DataTable2_8:
589        .word     _tx_trace_full_notify_function
590
591
592/**************************************************************************/
593/**************************************************************************/
594/**                                                                       */
595/**  ULONG  _tx_misra_time_stamp_get(VOID);                               */
596/**                                                                       */
597/**************************************************************************/
598/**************************************************************************/
599
600        .text
601        .thumb_func
602_tx_misra_time_stamp_get:
603        MOVS     R0,#+0
604        BX       LR               // return
605
606#endif
607
608        .data
609DataTable2_3:
610        .word     _tx_thread_system_state
611
612        .data
613DataTable2_4:
614        .word     _tx_thread_current_ptr
615
616
617/**************************************************************************/
618/**************************************************************************/
619/**                                                                       */
620/**  UINT  _tx_misra_always_true(void);                                   */
621/**                                                                       */
622/**************************************************************************/
623/**************************************************************************/
624
625        .text
626        .thumb_func
627_tx_misra_always_true:
628        MOVS     R0,#+1
629        BX       LR               // return
630
631
632/**************************************************************************/
633/**************************************************************************/
634/**                                                                       */
635/**  UINT  _tx_misra_status_get(UINT status);                             */
636/**                                                                       */
637/**************************************************************************/
638/**************************************************************************/
639
640        .text
641        .thumb_func
642_tx_misra_status_get:
643        MOVS     R0,#+0
644        BX       LR               // return
645
646
647/***********************************************************************************************/
648/***********************************************************************************************/
649/**                                                                                            */
650/**  ULONG  _tx_misra_ipsr_get(void);                                                          */
651/**                                                                                            */
652/***********************************************************************************************/
653/***********************************************************************************************/
654
655        .text
656        .thumb_func
657_tx_misra_ipsr_get:
658        MRS      R0, IPSR
659        BX       LR               // return
660
661
662/***********************************************************************************************/
663/***********************************************************************************************/
664/**                                                                                            */
665/**  ULONG  _tx_misra_control_get(void);                                                       */
666/**                                                                                            */
667/***********************************************************************************************/
668/***********************************************************************************************/
669
670        .text
671        .thumb_func
672_tx_misra_control_get:
673        MRS      R0, CONTROL
674        BX       LR               // return
675
676
677/***********************************************************************************************/
678/***********************************************************************************************/
679/**                                                                                            */
680/**  void   _tx_misra_control_set(ULONG value);                                                */
681/**                                                                                            */
682/***********************************************************************************************/
683/***********************************************************************************************/
684
685        .text
686        .thumb_func
687_tx_misra_control_set:
688        MSR      CONTROL, R0
689        BX       LR               // return
690
691
692#ifdef __ARM_FP
693
694/***********************************************************************************************/
695/***********************************************************************************************/
696/**                                                                                            */
697/**  ULONG  _tx_misra_fpccr_get(void);                                                         */
698/**                                                                                            */
699/***********************************************************************************************/
700/***********************************************************************************************/
701
702        .text
703        .thumb_func
704_tx_misra_fpccr_get:
705        LDR      r0, =0xE000EF34  // Build FPCCR address
706        LDR      r0, [r0]         // Load FPCCR value
707        BX       LR               // return
708
709
710/***********************************************************************************************/
711/***********************************************************************************************/
712/**                                                                                            */
713/**  void   _tx_misra_vfp_touch(void);                                                         */
714/**                                                                                            */
715/***********************************************************************************************/
716/***********************************************************************************************/
717
718        .text
719        .thumb_func
720_tx_misra_vfp_touch:
721        vmov.f32 s0, s0
722        BX       LR               // return
723
724#endif
725
726
727        .data
728        .word 0
729