1 #------------------------------------------------------------------------------
3 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 # Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.
5 # Copyright (c) 2016, Linaro Limited. All rights reserved.
7 # This program and the accompanying materials
8 # are licensed and made available under the terms and conditions of the BSD License
9 # which accompanies this distribution. The full text of the license may be found at
10 # http://opensource.org/licenses/bsd-license.php
12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #------------------------------------------------------------------------------
17 #include <AsmMacroIoLibV8.h>
19 .set MPIDR_U_BIT, (30)
20 .set MPIDR_U_MASK, (1 << MPIDR_U_BIT)
22 // DAIF bit definitions for writing through msr daifclr/sr daifset
23 .set DAIF_WR_FIQ_BIT, (1 << 0)
24 .set DAIF_WR_IRQ_BIT, (1 << 1)
25 .set DAIF_WR_ABORT_BIT, (1 << 2)
26 .set DAIF_WR_DEBUG_BIT, (1 << 3)
27 .set DAIF_WR_INT_BITS, (DAIF_WR_FIQ_BIT | DAIF_WR_IRQ_BIT)
28 .set DAIF_WR_ALL, (DAIF_WR_DEBUG_BIT | DAIF_WR_ABORT_BIT | DAIF_WR_INT_BITS)
32 mrs x0, mpidr_el1 // Read EL1 Mutliprocessor Affinty Reg (MPIDR)
33 and x0, x0, #MPIDR_U_MASK // U Bit clear, the processor is part of a multiprocessor system
34 lsr x0, x0, #MPIDR_U_BIT
39 ASM_FUNC(ArmEnableAsynchronousAbort)
40 msr daifclr, #DAIF_WR_ABORT_BIT
45 ASM_FUNC(ArmDisableAsynchronousAbort)
46 msr daifset, #DAIF_WR_ABORT_BIT
51 ASM_FUNC(ArmEnableIrq)
52 msr daifclr, #DAIF_WR_IRQ_BIT
57 ASM_FUNC(ArmDisableIrq)
58 msr daifset, #DAIF_WR_IRQ_BIT
63 ASM_FUNC(ArmEnableFiq)
64 msr daifclr, #DAIF_WR_FIQ_BIT
69 ASM_FUNC(ArmDisableFiq)
70 msr daifset, #DAIF_WR_FIQ_BIT
75 ASM_FUNC(ArmEnableInterrupts)
76 msr daifclr, #DAIF_WR_INT_BITS
81 ASM_FUNC(ArmDisableInterrupts)
82 msr daifset, #DAIF_WR_INT_BITS
87 ASM_FUNC(ArmDisableAllExceptions)
88 msr daifset, #DAIF_WR_ALL
98 msr csselr_el1, x0 // Write Cache Size Selection Register (CSSELR)
100 mrs x0, ccsidr_el1 // Read current Cache Size ID Register (CCSIDR)
109 mrs x0, clidr_el1 // Read Cache Level ID Register
112 ASM_FUNCTION_REMOVE_IF_UNREFERENCED