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
38 GCC_ASM_EXPORT(ArmGicV3GetControlSystemRegisterEnable)
39 GCC_ASM_EXPORT(ArmGicV3SetControlSystemRegisterEnable)
40 GCC_ASM_EXPORT(ArmGicV3EnableInterruptInterface)
41 GCC_ASM_EXPORT(ArmGicV3DisableInterruptInterface)
42 GCC_ASM_EXPORT(ArmGicV3EndOfInterrupt)
43 GCC_ASM_EXPORT(ArmGicV3AcknowledgeInterrupt)
44 GCC_ASM_EXPORT(ArmGicV3SetPriorityMask)
45 GCC_ASM_EXPORT(ArmGicV3SetBinaryPointer)
49 //ArmGicV3GetControlSystemRegisterEnable (
52 ASM_PFX(ArmGicV3GetControlSystemRegisterEnable):
54 1: mrs x0, ICC_SRE_EL1
56 2: mrs x0, ICC_SRE_EL2
58 3: mrs x0, ICC_SRE_EL3
63 //ArmGicV3SetControlSystemRegisterEnable (
64 // IN UINT32 ControlSystemRegisterEnable
66 ASM_PFX(ArmGicV3SetControlSystemRegisterEnable):
68 1: msr ICC_SRE_EL1, x0
70 2: msr ICC_SRE_EL2, x0
72 3: msr ICC_SRE_EL3, x0
77 //ArmGicV3EnableInterruptInterface (
80 ASM_PFX(ArmGicV3EnableInterruptInterface):
82 msr ICC_IGRPEN1_EL1, x0
86 //ArmGicV3DisableInterruptInterface (
89 ASM_PFX(ArmGicV3DisableInterruptInterface):
91 msr ICC_IGRPEN1_EL1, x0
95 //ArmGicV3EndOfInterrupt (
96 // IN UINTN InterruptId
98 ASM_PFX(ArmGicV3EndOfInterrupt):
103 //ArmGicV3AcknowledgeInterrupt (
106 ASM_PFX(ArmGicV3AcknowledgeInterrupt):
111 //ArmGicV3SetPriorityMask (
114 ASM_PFX(ArmGicV3SetPriorityMask):
119 //ArmGicV3SetBinaryPointer (
120 // IN UINTN BinaryPoint
122 ASM_PFX(ArmGicV3SetBinaryPointer):