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    .text
24    .align  4
25/**************************************************************************/
26/*                                                                        */
27/*  FUNCTION                                               RELEASE        */
28/*                                                                        */
29/*    _tx_thread_context_save                          Cortex-Mx/GHS      */
30/*                                                           6.1.7        */
31/*  AUTHOR                                                                */
32/*                                                                        */
33/*    Scott Larson, Microsoft Corporation                                 */
34/*                                                                        */
35/*  DESCRIPTION                                                           */
36/*                                                                        */
37/*    This function is only needed for legacy applications and it should  */
38/*    not be called in any new development on a Cortex-M.                 */
39/*                                                                        */
40/*  INPUT                                                                 */
41/*                                                                        */
42/*    None                                                                */
43/*                                                                        */
44/*  OUTPUT                                                                */
45/*                                                                        */
46/*    None                                                                */
47/*                                                                        */
48/*  CALLS                                                                 */
49/*                                                                        */
50/*    [_tx_execution_isr_enter]             Execution profiling ISR enter */
51/*                                                                        */
52/*  CALLED BY                                                             */
53/*                                                                        */
54/*    ISRs                                                                */
55/*                                                                        */
56/*  RELEASE HISTORY                                                       */
57/*                                                                        */
58/*    DATE              NAME                      DESCRIPTION             */
59/*                                                                        */
60/*  06-02-2021      Scott Larson            Initial Version 6.1.7         */
61/*                                                                        */
62/**************************************************************************/
63// VOID   _tx_thread_context_save(VOID)
64// {
65    .globl  _tx_thread_context_save
66_tx_thread_context_save:
67
68#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY
69    /* Call the ISR enter function to indicate an ISR is starting.  */
70    PUSH    {r0, lr}                                // Save return address
71    BL      _tx_execution_isr_enter                 // Call the ISR enter function
72    POP     {r0, lr}                                // Recover return address
73#endif
74
75    /* Context is already saved - just return.  */
76
77    BX      lr
78// }
79    .type _tx_thread_context_save,$function
80    .size _tx_thread_context_save,.-_tx_thread_context_save
81