2 # Copyright (c) 2014, ARM Limited. All rights reserved.
4 # This program and the accompanying materials are licensed and made available
5 # under the terms and conditions of the BSD License which accompanies this
6 # distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 #include <AsmMacroIoLibV8.h>
16 #if !defined(__clang__)
19 // Clang versions before v3.6 do not support the GNU extension that allows
20 // system registers outside of the IMPLEMENTATION DEFINED range to be specified
21 // using the generic notation below. However, clang knows these registers by
22 // their architectural names, so it has no need for these aliases anyway.
24 #define ICC_SRE_EL1 S3_0_C12_C12_5
25 #define ICC_SRE_EL2 S3_4_C12_C9_5
26 #define ICC_SRE_EL3 S3_6_C12_C12_5
27 #define ICC_IGRPEN1_EL1 S3_0_C12_C12_7
28 #define ICC_EOIR1_EL1 S3_0_C12_C12_1
29 #define ICC_IAR1_EL1 S3_0_C12_C12_0
30 #define ICC_PMR_EL1 S3_0_C4_C6_0
31 #define ICC_BPR1_EL1 S3_0_C12_C12_3
37 //ArmGicV3GetControlSystemRegisterEnable (
40 ASM_FUNC(ArmGicV3GetControlSystemRegisterEnable)
42 1: mrs x0, ICC_SRE_EL1
44 2: mrs x0, ICC_SRE_EL2
46 3: mrs x0, ICC_SRE_EL3
51 //ArmGicV3SetControlSystemRegisterEnable (
52 // IN UINT32 ControlSystemRegisterEnable
54 ASM_FUNC(ArmGicV3SetControlSystemRegisterEnable)
56 1: msr ICC_SRE_EL1, x0
58 2: msr ICC_SRE_EL2, x0
60 3: msr ICC_SRE_EL3, x0
65 //ArmGicV3EnableInterruptInterface (
68 ASM_FUNC(ArmGicV3EnableInterruptInterface)
70 msr ICC_IGRPEN1_EL1, x0
74 //ArmGicV3DisableInterruptInterface (
77 ASM_FUNC(ArmGicV3DisableInterruptInterface)
79 msr ICC_IGRPEN1_EL1, x0
83 //ArmGicV3EndOfInterrupt (
84 // IN UINTN InterruptId
86 ASM_FUNC(ArmGicV3EndOfInterrupt)
91 //ArmGicV3AcknowledgeInterrupt (
94 ASM_FUNC(ArmGicV3AcknowledgeInterrupt)
99 //ArmGicV3SetPriorityMask (
102 ASM_FUNC(ArmGicV3SetPriorityMask)
107 //ArmGicV3SetBinaryPointer (
108 // IN UINTN BinaryPoint
110 ASM_FUNC(ArmGicV3SetBinaryPointer)