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