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;#define TX_SOURCE_CODE
23;
24;
25;/* Include necessary system files.  */
26;
27;#include "tx_api.h"
28;#include "tx_thread.h"
29;
30;
31;/**************************************************************************/
32;/*                                                                        */
33;/*  FUNCTION                                               RELEASE        */
34;/*                                                                        */
35;/*    _tx_thread_interrupt_restore                        ARM11/IAR       */
36;/*                                                           6.1          */
37;/*  AUTHOR                                                                */
38;/*                                                                        */
39;/*    William E. Lamie, Microsoft Corporation                             */
40;/*                                                                        */
41;/*  DESCRIPTION                                                           */
42;/*                                                                        */
43;/*    This function is responsible for restoring interrupts to the state  */
44;/*    returned by a previous _tx_thread_interrupt_disable call.           */
45;/*                                                                        */
46;/*  INPUT                                                                 */
47;/*                                                                        */
48;/*    old_posture                           Old interrupt lockout posture */
49;/*                                                                        */
50;/*  OUTPUT                                                                */
51;/*                                                                        */
52;/*    None                                                                */
53;/*                                                                        */
54;/*  CALLS                                                                 */
55;/*                                                                        */
56;/*    None                                                                */
57;/*                                                                        */
58;/*  CALLED BY                                                             */
59;/*                                                                        */
60;/*    Application Code                                                    */
61;/*                                                                        */
62;/*  RELEASE HISTORY                                                       */
63;/*                                                                        */
64;/*    DATE              NAME                      DESCRIPTION             */
65;/*                                                                        */
66;/*  09-30-2020     William E. Lamie         Initial Version 6.1           */
67;/*                                                                        */
68;/**************************************************************************/
69;void   _tx_thread_interrupt_restore(UINT old_posture)
70;{
71    RSEG    .text:CODE:NOROOT(2)
72    PUBLIC  _tx_thread_interrupt_restore
73    CODE32
74_tx_thread_interrupt_restore
75;
76;    /* Apply the new interrupt posture.  */
77;
78    MSR     CPSR_cxsf, r0                       ; Setup new CPSR
79#ifdef TX_THUMB
80    BX      lr                                  ; Return to caller
81#else
82    MOV     pc, lr                              ; Return to caller
83#endif
84;}
85;
86    END
87