]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S
ArmPkg/ArmGicV3: switch to ASM_FUNC() asm macro
[mirror_edk2.git] / ArmPkg / Drivers / ArmGic / GicV3 / AArch64 / ArmGicV3.S
CommitLineData
d7133859
OM
1#\r
2# Copyright (c) 2014, ARM Limited. All rights reserved.\r
3#\r
4# This program and the accompanying materials are licensed and made available\r
5# under the terms and conditions of the BSD License which accompanies this\r
6# distribution. The full text of the license may be found at\r
7# http://opensource.org/licenses/bsd-license.php\r
8#\r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11#\r
12#\r
13\r
14#include <AsmMacroIoLibV8.h>\r
15\r
906e8ce4
AB
16#if !defined(__clang__)\r
17\r
18//\r
19// Clang versions before v3.6 do not support the GNU extension that allows\r
20// system registers outside of the IMPLEMENTATION DEFINED range to be specified\r
21// using the generic notation below. However, clang knows these registers by\r
22// their architectural names, so it has no need for these aliases anyway.\r
23//\r
d7133859
OM
24#define ICC_SRE_EL1 S3_0_C12_C12_5\r
25#define ICC_SRE_EL2 S3_4_C12_C9_5\r
26#define ICC_SRE_EL3 S3_6_C12_C12_5\r
27#define ICC_IGRPEN1_EL1 S3_0_C12_C12_7\r
28#define ICC_EOIR1_EL1 S3_0_C12_C12_1\r
29#define ICC_IAR1_EL1 S3_0_C12_C12_0\r
30#define ICC_PMR_EL1 S3_0_C4_C6_0\r
31#define ICC_BPR1_EL1 S3_0_C12_C12_3\r
32\r
906e8ce4
AB
33#endif\r
34\r
d7133859
OM
35//UINT32\r
36//EFIAPI\r
5f81082e 37//ArmGicV3GetControlSystemRegisterEnable (\r
d7133859
OM
38// VOID\r
39// );\r
f0883e35 40ASM_FUNC(ArmGicV3GetControlSystemRegisterEnable)\r
d7133859
OM
41 EL1_OR_EL2_OR_EL3(x1)\r
421: mrs x0, ICC_SRE_EL1\r
43 b 4f\r
442: mrs x0, ICC_SRE_EL2\r
45 b 4f\r
463: mrs x0, ICC_SRE_EL3\r
474: ret\r
48\r
49//VOID\r
50//EFIAPI\r
5f81082e 51//ArmGicV3SetControlSystemRegisterEnable (\r
d7133859
OM
52// IN UINT32 ControlSystemRegisterEnable\r
53// );\r
f0883e35 54ASM_FUNC(ArmGicV3SetControlSystemRegisterEnable)\r
d7133859
OM
55 EL1_OR_EL2_OR_EL3(x1)\r
561: msr ICC_SRE_EL1, x0\r
57 b 4f\r
582: msr ICC_SRE_EL2, x0\r
59 b 4f\r
603: msr ICC_SRE_EL3, x0\r
614: isb\r
62 ret\r
63\r
64//VOID\r
65//ArmGicV3EnableInterruptInterface (\r
66// VOID\r
67// );\r
f0883e35 68ASM_FUNC(ArmGicV3EnableInterruptInterface)\r
d7133859
OM
69 mov x0, #1\r
70 msr ICC_IGRPEN1_EL1, x0\r
71 ret\r
72\r
73//VOID\r
74//ArmGicV3DisableInterruptInterface (\r
75// VOID\r
76// );\r
f0883e35 77ASM_FUNC(ArmGicV3DisableInterruptInterface)\r
d7133859
OM
78 mov x0, #0\r
79 msr ICC_IGRPEN1_EL1, x0\r
80 ret\r
81\r
82//VOID\r
83//ArmGicV3EndOfInterrupt (\r
84// IN UINTN InterruptId\r
85// );\r
f0883e35 86ASM_FUNC(ArmGicV3EndOfInterrupt)\r
d7133859
OM
87 msr ICC_EOIR1_EL1, x0\r
88 ret\r
89\r
90//UINTN\r
91//ArmGicV3AcknowledgeInterrupt (\r
92// VOID\r
93// );\r
f0883e35 94ASM_FUNC(ArmGicV3AcknowledgeInterrupt)\r
d7133859
OM
95 mrs x0, ICC_IAR1_EL1\r
96 ret\r
97\r
98//VOID\r
99//ArmGicV3SetPriorityMask (\r
100// IN UINTN Priority\r
101// );\r
f0883e35 102ASM_FUNC(ArmGicV3SetPriorityMask)\r
d7133859
OM
103 msr ICC_PMR_EL1, x0\r
104 ret\r
105\r
106//VOID\r
107//ArmGicV3SetBinaryPointer (\r
108// IN UINTN BinaryPoint\r
109// );\r
f0883e35 110ASM_FUNC(ArmGicV3SetBinaryPointer)\r
d7133859
OM
111 msr ICC_BPR1_EL1, x0\r
112 ret\r