1/*************************************************************************** 2 * Copyright (c) 2024 Microsoft Corporation 3 * 4 * This program and the accompanying materials are made available under the 5 * terms of the MIT License which is available at 6 * https://opensource.org/licenses/MIT. 7 * 8 * SPDX-License-Identifier: MIT 9 **************************************************************************/ 10 11 12/**************************************************************************/ 13/**************************************************************************/ 14/** */ 15/** ThreadX Component */ 16/** */ 17/** Thread */ 18/** */ 19/**************************************************************************/ 20/**************************************************************************/ 21 22#ifdef TX_INCLUDE_USER_DEFINE_FILE 23#include "tx_user.h" 24#endif 25 26 .text 27 .align 4 28 .syntax unified 29#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) 30 .global _tx_execution_isr_enter 31#endif 32/**************************************************************************/ 33/* */ 34/* FUNCTION RELEASE */ 35/* */ 36/* _tx_thread_context_save Cortex-Mx/AC6 */ 37/* 6.2.1 */ 38/* AUTHOR */ 39/* */ 40/* Scott Larson, Microsoft Corporation */ 41/* */ 42/* DESCRIPTION */ 43/* */ 44/* This function is only needed for legacy applications and it should */ 45/* not be called in any new development on a Cortex-M. */ 46/* */ 47/* INPUT */ 48/* */ 49/* None */ 50/* */ 51/* OUTPUT */ 52/* */ 53/* None */ 54/* */ 55/* CALLS */ 56/* */ 57/* [_tx_execution_isr_enter] Execution profiling ISR enter */ 58/* */ 59/* CALLED BY */ 60/* */ 61/* ISRs */ 62/* */ 63/* RELEASE HISTORY */ 64/* */ 65/* DATE NAME DESCRIPTION */ 66/* */ 67/* 06-02-2021 Scott Larson Initial Version 6.1.7 */ 68/* 03-08-2023 Scott Larson Include tx_user.h, */ 69/* resulting in version 6.2.1 */ 70/* */ 71/**************************************************************************/ 72// VOID _tx_thread_context_save(VOID) 73// { 74 .global _tx_thread_context_save 75 .thumb_func 76_tx_thread_context_save: 77 78#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) 79 /* Call the ISR enter function to indicate an ISR is starting. */ 80 PUSH {r0, lr} // Save return address 81 BL _tx_execution_isr_enter // Call the ISR enter function 82 POP {r0, lr} // Recover return address 83#endif 84 85 /* Context is already saved - just return. */ 86 87 BX lr 88// } 89