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/**************************************************************************/ 27/* */ 28/* FUNCTION RELEASE */ 29/* */ 30/* _tx_thread_interrupt_control Cortex-Mxx/AC6 */ 31/* 6.2.1 */ 32/* AUTHOR */ 33/* */ 34/* Scott Larson, Microsoft Corporation */ 35/* */ 36/* DESCRIPTION */ 37/* */ 38/* This function is responsible for changing the interrupt lockout */ 39/* posture of the system. */ 40/* */ 41/* INPUT */ 42/* */ 43/* new_posture New interrupt lockout posture */ 44/* */ 45/* OUTPUT */ 46/* */ 47/* old_posture Old interrupt lockout posture */ 48/* */ 49/* CALLS */ 50/* */ 51/* None */ 52/* */ 53/* CALLED BY */ 54/* */ 55/* Application Code */ 56/* */ 57/* RELEASE HISTORY */ 58/* */ 59/* DATE NAME DESCRIPTION */ 60/* */ 61/* 09-30-2020 Scott Larson Initial Version 6.1 */ 62/* 03-08-2023 Scott Larson Include tx_user.h, */ 63/* resulting in version 6.2.1 */ 64/* */ 65/**************************************************************************/ 66// UINT _tx_thread_interrupt_control(UINT new_posture) 67// { 68 .section .text 69 .balign 4 70 .eabi_attribute Tag_ABI_align_preserved, 1 71 .global _tx_thread_interrupt_control 72 .thumb_func 73.type _tx_thread_interrupt_control, function 74_tx_thread_interrupt_control: 75#ifdef TX_PORT_USE_BASEPRI 76 MRS r1, BASEPRI // Pickup current interrupt posture 77 MSR BASEPRI, r0 // Apply the new interrupt posture 78 MOV r0, r1 // Transfer old to return register 79#else 80 MRS r1, PRIMASK // Pickup current interrupt lockout 81 MSR PRIMASK, r0 // Apply the new interrupt lockout 82 MOV r0, r1 // Transfer old to return register 83#endif 84 BX lr // Return to caller 85// } 86 .end 87