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;
32FP          .set    A15
33DP          .set    B14
34SP          .set    B15
35;
36;
37    .sect   ".text"
38;/**************************************************************************/
39;/*                                                                        */
40;/*  FUNCTION                                               RELEASE        */
41;/*                                                                        */
42;/*    _tx_thread_interrupt_control                        C667x/TI        */
43;/*                                                           6.1          */
44;/*  AUTHOR                                                                */
45;/*                                                                        */
46;/*    William E. Lamie, Microsoft Corporation                             */
47;/*                                                                        */
48;/*  DESCRIPTION                                                           */
49;/*                                                                        */
50;/*    This function is responsible for changing the interrupt lockout     */
51;/*    posture of the system.                                              */
52;/*                                                                        */
53;/*  INPUT                                                                 */
54;/*                                                                        */
55;/*    new_posture                           New interrupt lockout posture */
56;/*                                                                        */
57;/*  OUTPUT                                                                */
58;/*                                                                        */
59;/*    old_posture                           Old interrupt lockout posture */
60;/*                                                                        */
61;/*  CALLS                                                                 */
62;/*                                                                        */
63;/*    None                                                                */
64;/*                                                                        */
65;/*  CALLED BY                                                             */
66;/*                                                                        */
67;/*    Application Code                                                    */
68;/*                                                                        */
69;/*  RELEASE HISTORY                                                       */
70;/*                                                                        */
71;/*    DATE              NAME                      DESCRIPTION             */
72;/*                                                                        */
73;/*  09-30-2020     William E. Lamie         Initial Version 6.1           */
74;/*                                                                        */
75;/**************************************************************************/
76;UINT   _tx_thread_interrupt_control(UINT new_posture)
77;{
78    .global _tx_thread_interrupt_control
79_tx_thread_interrupt_control:
80;
81;    /* Pickup current interrupt lockout posture.  */
82;
83        MVC         CSR,B0                              ; Pickup current CSR
84;
85;    /* Apply the new interrupt posture.  */
86;
87        B           B3                                  ; Return to caller
88        AND         -2,B0,B0                            ; Clear GIE bit
89        OR          A4,B0,B0                            ; Build new interrupt posture
90        MVC         CSR,B1                              ; Return previous posture
91        MVC         B0,CSR                              ; Apply new interrupt posture
92        AND         1,B1,A4                             ; Clear non-GIE bits
93;
94;}
95
96