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#ifdef TX_INCLUDE_USER_DEFINE_FILE
23#include "tx_user.h"
24#endif
25
26    .text
27    .align 3
28/**************************************************************************/
29/*                                                                        */
30/*  FUNCTION                                               RELEASE        */
31/*                                                                        */
32/*    _tx_thread_interrupt_control                         ARMv8-A        */
33/*                                                           6.3.0        */
34/*  AUTHOR                                                                */
35/*                                                                        */
36/*    William E. Lamie, Microsoft Corporation                             */
37/*                                                                        */
38/*  DESCRIPTION                                                           */
39/*                                                                        */
40/*    This function is responsible for changing the interrupt lockout     */
41/*    posture of the system.                                              */
42/*                                                                        */
43/*  INPUT                                                                 */
44/*                                                                        */
45/*    new_posture                           New interrupt lockout posture */
46/*                                                                        */
47/*  OUTPUT                                                                */
48/*                                                                        */
49/*    old_posture                           Old interrupt lockout posture */
50/*                                                                        */
51/*  CALLS                                                                 */
52/*                                                                        */
53/*    None                                                                */
54/*                                                                        */
55/*  CALLED BY                                                             */
56/*                                                                        */
57/*    Application Code                                                    */
58/*                                                                        */
59/*  RELEASE HISTORY                                                       */
60/*                                                                        */
61/*    DATE              NAME                      DESCRIPTION             */
62/*                                                                        */
63/*  09-30-2020     William E. Lamie         Initial Version 6.1           */
64/*  01-31-2022     Andres Mlinar            Updated comments,             */
65/*                                            resulting in version 6.1.10 */
66/*  10-31-2023     Tiejun Zhou              Modified comment(s), added    */
67/*                                            #include tx_user.h,         */
68/*                                            resulting in version 6.3.0  */
69/*                                                                        */
70/**************************************************************************/
71// UINT   _tx_thread_interrupt_control(UINT new_posture)
72// {
73    .global  _tx_thread_interrupt_control
74    .type    _tx_thread_interrupt_control, @function
75_tx_thread_interrupt_control:
76
77    /* Pickup current interrupt lockout posture.  */
78
79    MRS     x1, DAIF                            // Pickup current interrupt posture
80
81    /* Apply the new interrupt posture.  */
82
83    MSR     DAIF, x0                            // Set new interrupt posture
84    MOV     x0, x1                              // Setup return value
85    RET                                         // Return to caller
86// }
87