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/**   Thread                                                              */
19/**                                                                       */
20/**************************************************************************/
21/**************************************************************************/
22
23#ifdef TX_INCLUDE_USER_DEFINE_FILE
24#include "tx_user.h"
25#endif
26
27#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE))
28    .global  _tx_execution_isr_enter
29#endif
30/**************************************************************************/
31/*                                                                        */
32/*  FUNCTION                                               RELEASE        */
33/*                                                                        */
34/*    _tx_thread_context_save                           Cortex-Mxx/GNU    */
35/*                                                           6.2.1        */
36/*  AUTHOR                                                                */
37/*                                                                        */
38/*    Scott Larson, Microsoft Corporation                                 */
39/*                                                                        */
40/*  DESCRIPTION                                                           */
41/*                                                                        */
42/*    This function is not needed for Cortex-M.                           */
43/*                                                                        */
44/*  INPUT                                                                 */
45/*                                                                        */
46/*    None                                                                */
47/*                                                                        */
48/*  OUTPUT                                                                */
49/*                                                                        */
50/*    None                                                                */
51/*                                                                        */
52/*  CALLS                                                                 */
53/*                                                                        */
54/*    [_tx_execution_isr_enter]             Execution profiling ISR enter */
55/*                                                                        */
56/*  CALLED BY                                                             */
57/*                                                                        */
58/*    ISRs                                                                */
59/*                                                                        */
60/*  RELEASE HISTORY                                                       */
61/*                                                                        */
62/*    DATE              NAME                      DESCRIPTION             */
63/*                                                                        */
64/*  09-30-2020      Scott Larson            Initial Version 6.1           */
65/*  03-08-2023      Scott Larson            Include tx_user.h,            */
66/*                                            resulting in version 6.2.1  */
67/*                                                                        */
68/**************************************************************************/
69// VOID   _tx_thread_context_save(VOID)
70// {
71    .section .text
72    .balign 4
73    .syntax unified
74    .eabi_attribute Tag_ABI_align_preserved, 1
75    .global  _tx_thread_context_save
76    .thumb_func
77.type _tx_thread_context_save, function
78_tx_thread_context_save:
79
80#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE))
81    /* Call the ISR enter function to indicate an ISR is starting.  */
82    PUSH    {r0, lr}                                // Save return address
83    BL      _tx_execution_isr_enter                 // Call the ISR enter function
84    POP     {r0, lr}                                // Recover return address
85#endif
86
87    BX      lr
88// }
89    .end
90