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 EXTERN _tx_execution_isr_enter 28 SECTION `.text`:CODE:NOROOT(2) 29 THUMB 30/**************************************************************************/ 31/* */ 32/* FUNCTION RELEASE */ 33/* */ 34/* _tx_thread_context_save Cortex-Mx/IAR */ 35/* 6.3.0 */ 36/* AUTHOR */ 37/* */ 38/* Scott Larson, Microsoft Corporation */ 39/* */ 40/* DESCRIPTION */ 41/* */ 42/* This function is only needed for legacy applications and it should */ 43/* not be called in any new development on a Cortex-M. */ 44/* */ 45/* INPUT */ 46/* */ 47/* None */ 48/* */ 49/* OUTPUT */ 50/* */ 51/* None */ 52/* */ 53/* CALLS */ 54/* */ 55/* [_tx_execution_isr_enter] Execution profiling ISR enter */ 56/* */ 57/* CALLED BY */ 58/* */ 59/* ISRs */ 60/* */ 61/* RELEASE HISTORY */ 62/* */ 63/* DATE NAME DESCRIPTION */ 64/* */ 65/* 06-02-2021 Scott Larson Initial Version 6.1.7 */ 66/* 10-31-2023 Tiejun Zhou Included tx_user.h, */ 67/* resulting in version 6.3.0 */ 68/* */ 69/**************************************************************************/ 70// VOID _tx_thread_context_save(VOID) 71// { 72 PUBLIC _tx_thread_context_save 73_tx_thread_context_save: 74 75#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) 76 /* Call the ISR enter function to indicate an ISR is starting. */ 77 PUSH {r0, lr} // Save return address 78 BL _tx_execution_isr_enter // Call the ISR enter function 79 POP {r0, lr} // Recover return address 80#endif 81 82 /* Context is already saved - just return. */ 83 84 BX lr 85// } 86 END 87