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#ifdef TX_INCLUDE_USER_DEFINE_FILE
22#include "tx_user.h"
23#endif
24
25    .text
26    .align 3
27/**************************************************************************/
28/*                                                                        */
29/*  FUNCTION                                               RELEASE        */
30/*                                                                        */
31/*    _tx_thread_interrupt_disable                         ARMv8-A        */
32/*                                                           6.3.0        */
33/*  AUTHOR                                                                */
34/*                                                                        */
35/*    William E. Lamie, Microsoft Corporation                             */
36/*                                                                        */
37/*  DESCRIPTION                                                           */
38/*                                                                        */
39/*    This function is responsible for disabling interrupts               */
40/*                                                                        */
41/*  INPUT                                                                 */
42/*                                                                        */
43/*    None                                                                */
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     William E. Lamie         Initial Version 6.1           */
62/*  01-31-2022     Andres Mlinar            Updated comments,             */
63/*                                            resulting in version 6.1.10 */
64/*  10-31-2023     Tiejun Zhou              Modified comment(s), added    */
65/*                                            #include tx_user.h,         */
66/*                                            resulting in version 6.3.0  */
67/*                                                                        */
68/**************************************************************************/
69// UINT   _tx_thread_interrupt_disable(void)
70// {
71    .global _tx_thread_interrupt_disable
72    .type   _tx_thread_interrupt_disable, @function
73_tx_thread_interrupt_disable:
74
75    /* Pickup current interrupt lockout posture.  */
76
77    MRS     x0, DAIF                            // Pickup current interrupt lockout posture
78
79    /* Mask interrupts.  */
80
81    MSR     DAIFSet, 0x3                        // Lockout interrupts
82    RET                                         // Return to caller
83// }
84