Fri Mar 6 20:28:26 2020 UTC ()
fix missing paren


(ryo)
diff -r1.37 -r1.38 src/sys/arch/aarch64/include/armreg.h

cvs diff -r1.37 -r1.38 src/sys/arch/aarch64/include/armreg.h (switch to unified diff)

--- src/sys/arch/aarch64/include/armreg.h 2020/03/06 20:13:24 1.37
+++ src/sys/arch/aarch64/include/armreg.h 2020/03/06 20:28:26 1.38
@@ -1,1210 +1,1210 @@ @@ -1,1210 +1,1210 @@
1/* $NetBSD: armreg.h,v 1.37 2020/03/06 20:13:24 ryo Exp $ */ 1/* $NetBSD: armreg.h,v 1.38 2020/03/06 20:28:26 ryo Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2014 The NetBSD Foundation, Inc. 4 * Copyright (c) 2014 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matt Thomas of 3am Software Foundry. 8 * by Matt Thomas of 3am Software Foundry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _AARCH64_ARMREG_H_ 32#ifndef _AARCH64_ARMREG_H_
33#define _AARCH64_ARMREG_H_ 33#define _AARCH64_ARMREG_H_
34 34
35#include <arm/cputypes.h> 35#include <arm/cputypes.h>
36#include <sys/types.h> 36#include <sys/types.h>
37 37
38#define AARCH64REG_READ_INLINE3(regname, regdesc, fnattrs) \ 38#define AARCH64REG_READ_INLINE3(regname, regdesc, fnattrs) \
39static __inline uint64_t fnattrs \ 39static __inline uint64_t fnattrs \
40reg_##regname##_read(void) \ 40reg_##regname##_read(void) \
41{ \ 41{ \
42 uint64_t __rv; \ 42 uint64_t __rv; \
43 __asm __volatile("mrs %0, " #regdesc : "=r"(__rv)); \ 43 __asm __volatile("mrs %0, " #regdesc : "=r"(__rv)); \
44 return __rv; \ 44 return __rv; \
45} 45}
46 46
47#define AARCH64REG_READ_INLINE2(regname, regdesc) \ 47#define AARCH64REG_READ_INLINE2(regname, regdesc) \
48 AARCH64REG_READ_INLINE3(regname, regdesc, ) 48 AARCH64REG_READ_INLINE3(regname, regdesc, )
49 49
50#define AARCH64REG_WRITE_INLINE3(regname, regdesc, fnattrs) \ 50#define AARCH64REG_WRITE_INLINE3(regname, regdesc, fnattrs) \
51static __inline void fnattrs \ 51static __inline void fnattrs \
52reg_##regname##_write(uint64_t __val) \ 52reg_##regname##_write(uint64_t __val) \
53{ \ 53{ \
54 __asm __volatile("msr " #regdesc ", %0" :: "r"(__val)); \ 54 __asm __volatile("msr " #regdesc ", %0" :: "r"(__val)); \
55} 55}
56 56
57#define AARCH64REG_WRITE_INLINE2(regname, regdesc) \ 57#define AARCH64REG_WRITE_INLINE2(regname, regdesc) \
58 AARCH64REG_WRITE_INLINE3(regname, regdesc, ) 58 AARCH64REG_WRITE_INLINE3(regname, regdesc, )
59 59
60#define AARCH64REG_WRITEIMM_INLINE2(regname, regdesc) \ 60#define AARCH64REG_WRITEIMM_INLINE2(regname, regdesc) \
61static __inline void \ 61static __inline void \
62reg_##regname##_write(uint64_t __val) \ 62reg_##regname##_write(uint64_t __val) \
63{ \ 63{ \
64 __asm __volatile("msr " #regdesc ", %0" :: "n"(__val)); \ 64 __asm __volatile("msr " #regdesc ", %0" :: "n"(__val)); \
65} 65}
66 66
67#define AARCH64REG_READ_INLINE(regname) \ 67#define AARCH64REG_READ_INLINE(regname) \
68 AARCH64REG_READ_INLINE2(regname, regname) 68 AARCH64REG_READ_INLINE2(regname, regname)
69 69
70#define AARCH64REG_WRITE_INLINE(regname) \ 70#define AARCH64REG_WRITE_INLINE(regname) \
71 AARCH64REG_WRITE_INLINE2(regname, regname) 71 AARCH64REG_WRITE_INLINE2(regname, regname)
72 72
73#define AARCH64REG_WRITEIMM_INLINE(regname) \ 73#define AARCH64REG_WRITEIMM_INLINE(regname) \
74 AARCH64REG_WRITEIMM_INLINE2(regname, regname) 74 AARCH64REG_WRITEIMM_INLINE2(regname, regname)
75 75
76#define AARCH64REG_READWRITE_INLINE2(regname, regdesc) \ 76#define AARCH64REG_READWRITE_INLINE2(regname, regdesc) \
77 AARCH64REG_READ_INLINE2(regname, regdesc) \ 77 AARCH64REG_READ_INLINE2(regname, regdesc) \
78 AARCH64REG_WRITE_INLINE2(regname, regdesc) 78 AARCH64REG_WRITE_INLINE2(regname, regdesc)
79 79
80#define AARCH64REG_ATWRITE_INLINE2(regname, regdesc) \ 80#define AARCH64REG_ATWRITE_INLINE2(regname, regdesc) \
81static __inline void \ 81static __inline void \
82reg_##regname##_write(uint64_t __val) \ 82reg_##regname##_write(uint64_t __val) \
83{ \ 83{ \
84 __asm __volatile("at " #regdesc ", %0" :: "r"(__val)); \ 84 __asm __volatile("at " #regdesc ", %0" :: "r"(__val)); \
85} 85}
86 86
87#define AARCH64REG_ATWRITE_INLINE(regname) \ 87#define AARCH64REG_ATWRITE_INLINE(regname) \
88 AARCH64REG_ATWRITE_INLINE2(regname, regname) 88 AARCH64REG_ATWRITE_INLINE2(regname, regname)
89 89
90/* 90/*
91 * System registers available at EL0 (user) 91 * System registers available at EL0 (user)
92 */ 92 */
93AARCH64REG_READ_INLINE(ctr_el0) // Cache Type Register 93AARCH64REG_READ_INLINE(ctr_el0) // Cache Type Register
94 94
95#define CTR_EL0_CWG_LINE __BITS(27,24) // Cacheback Writeback Granule 95#define CTR_EL0_CWG_LINE __BITS(27,24) // Cacheback Writeback Granule
96#define CTR_EL0_ERG_LINE __BITS(23,20) // Exclusives Reservation Granule 96#define CTR_EL0_ERG_LINE __BITS(23,20) // Exclusives Reservation Granule
97#define CTR_EL0_DMIN_LINE __BITS(19,16) // Dcache MIN LINE size (log2 - 2) 97#define CTR_EL0_DMIN_LINE __BITS(19,16) // Dcache MIN LINE size (log2 - 2)
98#define CTR_EL0_L1IP_MASK __BITS(15,14) 98#define CTR_EL0_L1IP_MASK __BITS(15,14)
99#define CTR_EL0_L1IP_VPIPT 0 // VMID-aware Physical Index, Physical Tag 99#define CTR_EL0_L1IP_VPIPT 0 // VMID-aware Physical Index, Physical Tag
100#define CTR_EL0_L1IP_AIVIVT 1 // ASID-tagged Virtual Index, Virtual Tag 100#define CTR_EL0_L1IP_AIVIVT 1 // ASID-tagged Virtual Index, Virtual Tag
101#define CTR_EL0_L1IP_VIPT 2 // Virtual Index, Physical Tag 101#define CTR_EL0_L1IP_VIPT 2 // Virtual Index, Physical Tag
102#define CTR_EL0_L1IP_PIPT 3 // Physical Index, Physical Tag 102#define CTR_EL0_L1IP_PIPT 3 // Physical Index, Physical Tag
103#define CTR_EL0_IMIN_LINE __BITS(3,0) // Icache MIN LINE size (log2 - 2) 103#define CTR_EL0_IMIN_LINE __BITS(3,0) // Icache MIN LINE size (log2 - 2)
104 104
105AARCH64REG_READ_INLINE(dczid_el0) // Data Cache Zero ID Register 105AARCH64REG_READ_INLINE(dczid_el0) // Data Cache Zero ID Register
106 106
107#define DCZID_DZP __BIT(4) // Data Zero Prohibited 107#define DCZID_DZP __BIT(4) // Data Zero Prohibited
108#define DCZID_BS __BITS(3,0) // Block Size (log2 - 2) 108#define DCZID_BS __BITS(3,0) // Block Size (log2 - 2)
109 109
110AARCH64REG_READ_INLINE(fpcr) // Floating Point Control Register 110AARCH64REG_READ_INLINE(fpcr) // Floating Point Control Register
111AARCH64REG_WRITE_INLINE(fpcr) 111AARCH64REG_WRITE_INLINE(fpcr)
112 112
113#define FPCR_AHP __BIT(26) // Alternative Half Precision 113#define FPCR_AHP __BIT(26) // Alternative Half Precision
114#define FPCR_DN __BIT(25) // Default Nan Control 114#define FPCR_DN __BIT(25) // Default Nan Control
115#define FPCR_FZ __BIT(24) // Flush-To-Zero 115#define FPCR_FZ __BIT(24) // Flush-To-Zero
116#define FPCR_RMODE __BITS(23,22) // Rounding Mode 116#define FPCR_RMODE __BITS(23,22) // Rounding Mode
117#define FPCR_RN 0 // Round Nearest 117#define FPCR_RN 0 // Round Nearest
118#define FPCR_RP 1 // Round towards Plus infinity 118#define FPCR_RP 1 // Round towards Plus infinity
119#define FPCR_RM 2 // Round towards Minus infinity 119#define FPCR_RM 2 // Round towards Minus infinity
120#define FPCR_RZ 3 // Round towards Zero 120#define FPCR_RZ 3 // Round towards Zero
121#define FPCR_STRIDE __BITS(21,20) 121#define FPCR_STRIDE __BITS(21,20)
122#define FPCR_FZ16 __BIT(19) // Flush-To-Zero for FP16 122#define FPCR_FZ16 __BIT(19) // Flush-To-Zero for FP16
123#define FPCR_LEN __BITS(18,16) 123#define FPCR_LEN __BITS(18,16)
124#define FPCR_IDE __BIT(15) // Input Denormal Exception enable 124#define FPCR_IDE __BIT(15) // Input Denormal Exception enable
125#define FPCR_IXE __BIT(12) // IneXact Exception enable 125#define FPCR_IXE __BIT(12) // IneXact Exception enable
126#define FPCR_UFE __BIT(11) // UnderFlow Exception enable 126#define FPCR_UFE __BIT(11) // UnderFlow Exception enable
127#define FPCR_OFE __BIT(10) // OverFlow Exception enable 127#define FPCR_OFE __BIT(10) // OverFlow Exception enable
128#define FPCR_DZE __BIT(9) // Divide by Zero Exception enable 128#define FPCR_DZE __BIT(9) // Divide by Zero Exception enable
129#define FPCR_IOE __BIT(8) // Invalid Operation Exception enable 129#define FPCR_IOE __BIT(8) // Invalid Operation Exception enable
130#define FPCR_ESUM 0x1F00 130#define FPCR_ESUM 0x1F00
131 131
132AARCH64REG_READ_INLINE(fpsr) // Floating Point Status Register 132AARCH64REG_READ_INLINE(fpsr) // Floating Point Status Register
133AARCH64REG_WRITE_INLINE(fpsr) 133AARCH64REG_WRITE_INLINE(fpsr)
134 134
135#define FPSR_N32 __BIT(31) // AARCH32 Negative 135#define FPSR_N32 __BIT(31) // AARCH32 Negative
136#define FPSR_Z32 __BIT(30) // AARCH32 Zero 136#define FPSR_Z32 __BIT(30) // AARCH32 Zero
137#define FPSR_C32 __BIT(29) // AARCH32 Carry 137#define FPSR_C32 __BIT(29) // AARCH32 Carry
138#define FPSR_V32 __BIT(28) // AARCH32 Overflow 138#define FPSR_V32 __BIT(28) // AARCH32 Overflow
139#define FPSR_QC __BIT(27) // SIMD Saturation 139#define FPSR_QC __BIT(27) // SIMD Saturation
140#define FPSR_IDC __BIT(7) // Input Denormal Cumulative status 140#define FPSR_IDC __BIT(7) // Input Denormal Cumulative status
141#define FPSR_IXC __BIT(4) // IneXact Cumulative status 141#define FPSR_IXC __BIT(4) // IneXact Cumulative status
142#define FPSR_UFC __BIT(3) // UnderFlow Cumulative status 142#define FPSR_UFC __BIT(3) // UnderFlow Cumulative status
143#define FPSR_OFC __BIT(2) // OverFlow Cumulative status 143#define FPSR_OFC __BIT(2) // OverFlow Cumulative status
144#define FPSR_DZC __BIT(1) // Divide by Zero Cumulative status 144#define FPSR_DZC __BIT(1) // Divide by Zero Cumulative status
145#define FPSR_IOC __BIT(0) // Invalid Operation Cumulative status 145#define FPSR_IOC __BIT(0) // Invalid Operation Cumulative status
146#define FPSR_CSUM 0x1F 146#define FPSR_CSUM 0x1F
147 147
148AARCH64REG_READ_INLINE(nzcv) // condition codes 148AARCH64REG_READ_INLINE(nzcv) // condition codes
149AARCH64REG_WRITE_INLINE(nzcv) 149AARCH64REG_WRITE_INLINE(nzcv)
150 150
151#define NZCV_N __BIT(31) // Negative 151#define NZCV_N __BIT(31) // Negative
152#define NZCV_Z __BIT(30) // Zero 152#define NZCV_Z __BIT(30) // Zero
153#define NZCV_C __BIT(29) // Carry 153#define NZCV_C __BIT(29) // Carry
154#define NZCV_V __BIT(28) // Overflow 154#define NZCV_V __BIT(28) // Overflow
155 155
156AARCH64REG_READ_INLINE(tpidr_el0) // Thread Pointer ID Register (RW) 156AARCH64REG_READ_INLINE(tpidr_el0) // Thread Pointer ID Register (RW)
157AARCH64REG_WRITE_INLINE(tpidr_el0) 157AARCH64REG_WRITE_INLINE(tpidr_el0)
158 158
159AARCH64REG_READ_INLINE(tpidrro_el0) // Thread Pointer ID Register (RO) 159AARCH64REG_READ_INLINE(tpidrro_el0) // Thread Pointer ID Register (RO)
160 160
161/* 161/*
162 * From here on, these can only be accessed at EL1 (kernel) 162 * From here on, these can only be accessed at EL1 (kernel)
163 */ 163 */
164 164
165/* 165/*
166 * These are readonly registers 166 * These are readonly registers
167 */ 167 */
168AARCH64REG_READ_INLINE(aidr_el1) 168AARCH64REG_READ_INLINE(aidr_el1)
169 169
170AARCH64REG_READ_INLINE2(cbar_el1, s3_1_c15_c3_0) // Cortex-A57 170AARCH64REG_READ_INLINE2(cbar_el1, s3_1_c15_c3_0) // Cortex-A57
171 171
172#define CBAR_PA __BITS(47,18) 172#define CBAR_PA __BITS(47,18)
173 173
174AARCH64REG_READ_INLINE(ccsidr_el1) 174AARCH64REG_READ_INLINE(ccsidr_el1)
175 175
176#define CCSIDR_WT __BIT(31) // OBSOLETE: Write-through supported 176#define CCSIDR_WT __BIT(31) // OBSOLETE: Write-through supported
177#define CCSIDR_WB __BIT(30) // OBSOLETE: Write-back supported 177#define CCSIDR_WB __BIT(30) // OBSOLETE: Write-back supported
178#define CCSIDR_RA __BIT(29) // OBSOLETE: Read-allocation supported 178#define CCSIDR_RA __BIT(29) // OBSOLETE: Read-allocation supported
179#define CCSIDR_WA __BIT(28) // OBSOLETE: Write-allocation supported 179#define CCSIDR_WA __BIT(28) // OBSOLETE: Write-allocation supported
180#define CCSIDR_NUMSET __BITS(27,13) // (Number of sets in cache) - 1 180#define CCSIDR_NUMSET __BITS(27,13) // (Number of sets in cache) - 1
181#define CCSIDR_ASSOC __BITS(12,3) // (Associativity of cache) - 1 181#define CCSIDR_ASSOC __BITS(12,3) // (Associativity of cache) - 1
182#define CCSIDR_LINESIZE __BITS(2,0) // Number of bytes in cache line 182#define CCSIDR_LINESIZE __BITS(2,0) // Number of bytes in cache line
183 183
184AARCH64REG_READ_INLINE(clidr_el1) 184AARCH64REG_READ_INLINE(clidr_el1)
185 185
186#define CLIDR_ICB __BITS(32,30) // Inner cache boundary 186#define CLIDR_ICB __BITS(32,30) // Inner cache boundary
187#define CLIDR_LOUU __BITS(29,27) // Level of Unification Uniprocessor 187#define CLIDR_LOUU __BITS(29,27) // Level of Unification Uniprocessor
188#define CLIDR_LOC __BITS(26,24) // Level of Coherency 188#define CLIDR_LOC __BITS(26,24) // Level of Coherency
189#define CLIDR_LOUIS __BITS(23,21) // Level of Unification InnerShareable*/ 189#define CLIDR_LOUIS __BITS(23,21) // Level of Unification InnerShareable*/
190#define CLIDR_CTYPE7 __BITS(20,18) // Cache Type field for level7 190#define CLIDR_CTYPE7 __BITS(20,18) // Cache Type field for level7
191#define CLIDR_CTYPE6 __BITS(17,15) // Cache Type field for level6 191#define CLIDR_CTYPE6 __BITS(17,15) // Cache Type field for level6
192#define CLIDR_CTYPE5 __BITS(14,12) // Cache Type field for level5 192#define CLIDR_CTYPE5 __BITS(14,12) // Cache Type field for level5
193#define CLIDR_CTYPE4 __BITS(11,9) // Cache Type field for level4 193#define CLIDR_CTYPE4 __BITS(11,9) // Cache Type field for level4
194#define CLIDR_CTYPE3 __BITS(8,6) // Cache Type field for level3 194#define CLIDR_CTYPE3 __BITS(8,6) // Cache Type field for level3
195#define CLIDR_CTYPE2 __BITS(5,3) // Cache Type field for level2 195#define CLIDR_CTYPE2 __BITS(5,3) // Cache Type field for level2
196#define CLIDR_CTYPE1 __BITS(2,0) // Cache Type field for level1 196#define CLIDR_CTYPE1 __BITS(2,0) // Cache Type field for level1
197#define CLIDR_TYPE_NOCACHE 0 // No cache 197#define CLIDR_TYPE_NOCACHE 0 // No cache
198#define CLIDR_TYPE_ICACHE 1 // Instruction cache only 198#define CLIDR_TYPE_ICACHE 1 // Instruction cache only
199#define CLIDR_TYPE_DCACHE 2 // Data cache only 199#define CLIDR_TYPE_DCACHE 2 // Data cache only
200#define CLIDR_TYPE_IDCACHE 3 // Separate inst and data caches 200#define CLIDR_TYPE_IDCACHE 3 // Separate inst and data caches
201#define CLIDR_TYPE_UNIFIEDCACHE 4 // Unified cache 201#define CLIDR_TYPE_UNIFIEDCACHE 4 // Unified cache
202 202
203AARCH64REG_READ_INLINE(currentel) 203AARCH64REG_READ_INLINE(currentel)
204AARCH64REG_READ_INLINE(id_aa64afr0_el1) 204AARCH64REG_READ_INLINE(id_aa64afr0_el1)
205AARCH64REG_READ_INLINE(id_aa64afr1_el1) 205AARCH64REG_READ_INLINE(id_aa64afr1_el1)
206AARCH64REG_READ_INLINE(id_aa64dfr0_el1) 206AARCH64REG_READ_INLINE(id_aa64dfr0_el1)
207 207
208#define ID_AA64DFR0_EL1_TRACEFILT __BITS(43,40) 208#define ID_AA64DFR0_EL1_TRACEFILT __BITS(43,40)
209#define ID_AA64DFR0_EL1_TRACEFILT_NONE 0 209#define ID_AA64DFR0_EL1_TRACEFILT_NONE 0
210#define ID_AA64DFR0_EL1_TRACEFILT_IMPL 1 210#define ID_AA64DFR0_EL1_TRACEFILT_IMPL 1
211#define ID_AA64DFR0_EL1_DBLLOCK __BITS(39,36 211#define ID_AA64DFR0_EL1_DBLLOCK __BITS(39,36)
212#define ID_AA64DFR0_EL1_DBLLOCK_IMPL 0 212#define ID_AA64DFR0_EL1_DBLLOCK_IMPL 0
213#define ID_AA64DFR0_EL1_DBLLOCK_NONE 15 213#define ID_AA64DFR0_EL1_DBLLOCK_NONE 15
214#define ID_AA64DFR0_EL1_PMSVER __BITS(35,32) 214#define ID_AA64DFR0_EL1_PMSVER __BITS(35,32)
215#define ID_AA64DFR0_EL1_CTX_CMPS __BITS(31,28) 215#define ID_AA64DFR0_EL1_CTX_CMPS __BITS(31,28)
216#define ID_AA64DFR0_EL1_WRPS __BITS(20,23) 216#define ID_AA64DFR0_EL1_WRPS __BITS(20,23)
217#define ID_AA64DFR0_EL1_BRPS __BITS(12,15) 217#define ID_AA64DFR0_EL1_BRPS __BITS(12,15)
218#define ID_AA64DFR0_EL1_PMUVER __BITS(8,11) 218#define ID_AA64DFR0_EL1_PMUVER __BITS(8,11)
219#define ID_AA64DFR0_EL1_PMUVER_NONE 0 219#define ID_AA64DFR0_EL1_PMUVER_NONE 0
220#define ID_AA64DFR0_EL1_PMUVER_V3 1 220#define ID_AA64DFR0_EL1_PMUVER_V3 1
221#define ID_AA64DFR0_EL1_PMUVER_NOV3 2 221#define ID_AA64DFR0_EL1_PMUVER_NOV3 2
222#define ID_AA64DFR0_EL1_TRACEVER __BITS(4,7) 222#define ID_AA64DFR0_EL1_TRACEVER __BITS(4,7)
223#define ID_AA64DFR0_EL1_TRACEVER_NONE 0 223#define ID_AA64DFR0_EL1_TRACEVER_NONE 0
224#define ID_AA64DFR0_EL1_TRACEVER_IMPL 1 224#define ID_AA64DFR0_EL1_TRACEVER_IMPL 1
225#define ID_AA64DFR0_EL1_DEBUGVER __BITS(0,3) 225#define ID_AA64DFR0_EL1_DEBUGVER __BITS(0,3)
226#define ID_AA64DFR0_EL1_DEBUGVER_V8A 6 226#define ID_AA64DFR0_EL1_DEBUGVER_V8A 6
227 227
228AARCH64REG_READ_INLINE(id_aa64dfr1_el1) 228AARCH64REG_READ_INLINE(id_aa64dfr1_el1)
229 229
230AARCH64REG_READ_INLINE(id_aa64isar0_el1) 230AARCH64REG_READ_INLINE(id_aa64isar0_el1)
231 231
232#define ID_AA64ISAR0_EL1_RNDR __BITS(63,30) 232#define ID_AA64ISAR0_EL1_RNDR __BITS(63,30)
233#define ID_AA64ISAR0_EL1_RNDR_NONE 0 233#define ID_AA64ISAR0_EL1_RNDR_NONE 0
234#define ID_AA64ISAR0_EL1_RNDR_RNDRRS 1 234#define ID_AA64ISAR0_EL1_RNDR_RNDRRS 1
235#define ID_AA64ISAR0_EL1_TLB __BITS(59,56) 235#define ID_AA64ISAR0_EL1_TLB __BITS(59,56)
236#define ID_AA64ISAR0_EL1_TLB_NONE 0 236#define ID_AA64ISAR0_EL1_TLB_NONE 0
237#define ID_AA64ISAR0_EL1_TLB_OS 1 237#define ID_AA64ISAR0_EL1_TLB_OS 1
238#define ID_AA64ISAR0_EL1_TLB_OS_TLB 2 238#define ID_AA64ISAR0_EL1_TLB_OS_TLB 2
239#define ID_AA64ISAR0_EL1_TS __BITS(55,52) 239#define ID_AA64ISAR0_EL1_TS __BITS(55,52)
240#define ID_AA64ISAR0_EL1_TS_NONE 0 240#define ID_AA64ISAR0_EL1_TS_NONE 0
241#define ID_AA64ISAR0_EL1_TS_CFINV 1 241#define ID_AA64ISAR0_EL1_TS_CFINV 1
242#define ID_AA64ISAR0_EL1_TS_AXFLAG 2 242#define ID_AA64ISAR0_EL1_TS_AXFLAG 2
243#define ID_AA64ISAR0_EL1_FHM __BITS(51,48) 243#define ID_AA64ISAR0_EL1_FHM __BITS(51,48)
244#define ID_AA64ISAR0_EL1_FHM_NONE 0 244#define ID_AA64ISAR0_EL1_FHM_NONE 0
245#define ID_AA64ISAR0_EL1_FHM_FMLAL 1 245#define ID_AA64ISAR0_EL1_FHM_FMLAL 1
246#define ID_AA64ISAR0_EL1_DP __BITS(47,44) 246#define ID_AA64ISAR0_EL1_DP __BITS(47,44)
247#define ID_AA64ISAR0_EL1_DP_NONE 0 247#define ID_AA64ISAR0_EL1_DP_NONE 0
248#define ID_AA64ISAR0_EL1_DP_UDOT 1 248#define ID_AA64ISAR0_EL1_DP_UDOT 1
249#define ID_AA64ISAR0_EL1_SM4 __BITS(43,40) 249#define ID_AA64ISAR0_EL1_SM4 __BITS(43,40)
250#define ID_AA64ISAR0_EL1_SM4_NONE 0 250#define ID_AA64ISAR0_EL1_SM4_NONE 0
251#define ID_AA64ISAR0_EL1_SM4_SM4 1 251#define ID_AA64ISAR0_EL1_SM4_SM4 1
252#define ID_AA64ISAR0_EL1_SM3 __BITS(39,36) 252#define ID_AA64ISAR0_EL1_SM3 __BITS(39,36)
253#define ID_AA64ISAR0_EL1_SM3_NONE 0 253#define ID_AA64ISAR0_EL1_SM3_NONE 0
254#define ID_AA64ISAR0_EL1_SM3_SM3 1 254#define ID_AA64ISAR0_EL1_SM3_SM3 1
255#define ID_AA64ISAR0_EL1_SHA3 __BITS(35,32) 255#define ID_AA64ISAR0_EL1_SHA3 __BITS(35,32)
256#define ID_AA64ISAR0_EL1_SHA3_NONE 0 256#define ID_AA64ISAR0_EL1_SHA3_NONE 0
257#define ID_AA64ISAR0_EL1_SHA3_EOR3 1 257#define ID_AA64ISAR0_EL1_SHA3_EOR3 1
258#define ID_AA64ISAR0_EL1_RDM __BITS(31,28) 258#define ID_AA64ISAR0_EL1_RDM __BITS(31,28)
259#define ID_AA64ISAR0_EL1_RDM_NONE 0 259#define ID_AA64ISAR0_EL1_RDM_NONE 0
260#define ID_AA64ISAR0_EL1_RDM_SQRDML 1 260#define ID_AA64ISAR0_EL1_RDM_SQRDML 1
261#define ID_AA64ISAR0_EL1_ATOMIC __BITS(23,20) 261#define ID_AA64ISAR0_EL1_ATOMIC __BITS(23,20)
262#define ID_AA64ISAR0_EL1_ATOMIC_NONE 0 262#define ID_AA64ISAR0_EL1_ATOMIC_NONE 0
263#define ID_AA64ISAR0_EL1_ATOMIC_SWP 1 263#define ID_AA64ISAR0_EL1_ATOMIC_SWP 1
264#define ID_AA64ISAR0_EL1_CRC32 __BITS(19,16) 264#define ID_AA64ISAR0_EL1_CRC32 __BITS(19,16)
265#define ID_AA64ISAR0_EL1_CRC32_NONE 0 265#define ID_AA64ISAR0_EL1_CRC32_NONE 0
266#define ID_AA64ISAR0_EL1_CRC32_CRC32X 1 266#define ID_AA64ISAR0_EL1_CRC32_CRC32X 1
267#define ID_AA64ISAR0_EL1_SHA2 __BITS(15,12) 267#define ID_AA64ISAR0_EL1_SHA2 __BITS(15,12)
268#define ID_AA64ISAR0_EL1_SHA2_NONE 0 268#define ID_AA64ISAR0_EL1_SHA2_NONE 0
269#define ID_AA64ISAR0_EL1_SHA2_SHA256HSU 1 269#define ID_AA64ISAR0_EL1_SHA2_SHA256HSU 1
270#define ID_AA64ISAR0_EL1_SHA2_SHA512HSU 2 270#define ID_AA64ISAR0_EL1_SHA2_SHA512HSU 2
271#define ID_AA64ISAR0_EL1_SHA1 __BITS(11,8) 271#define ID_AA64ISAR0_EL1_SHA1 __BITS(11,8)
272#define ID_AA64ISAR0_EL1_SHA1_NONE 0 272#define ID_AA64ISAR0_EL1_SHA1_NONE 0
273#define ID_AA64ISAR0_EL1_SHA1_SHA1CPMHSU 1 273#define ID_AA64ISAR0_EL1_SHA1_SHA1CPMHSU 1
274#define ID_AA64ISAR0_EL1_AES __BITS(7,4) 274#define ID_AA64ISAR0_EL1_AES __BITS(7,4)
275#define ID_AA64ISAR0_EL1_AES_NONE 0 275#define ID_AA64ISAR0_EL1_AES_NONE 0
276#define ID_AA64ISAR0_EL1_AES_AES 1 276#define ID_AA64ISAR0_EL1_AES_AES 1
277#define ID_AA64ISAR0_EL1_AES_PMUL 2 277#define ID_AA64ISAR0_EL1_AES_PMUL 2
278 278
279AARCH64REG_READ_INLINE(id_aa64isar1_el1) 279AARCH64REG_READ_INLINE(id_aa64isar1_el1)
280 280
281#define ID_AA64ISAR1_EL1_SPECRES __BITS(43,40) 281#define ID_AA64ISAR1_EL1_SPECRES __BITS(43,40)
282#define ID_AA64ISAR1_EL1_SPECRES_NONE 0 282#define ID_AA64ISAR1_EL1_SPECRES_NONE 0
283#define ID_AA64ISAR1_EL1_SPECRES_SUPPORTED 1 283#define ID_AA64ISAR1_EL1_SPECRES_SUPPORTED 1
284#define ID_AA64ISAR1_EL1_SB __BITS(39,36) 284#define ID_AA64ISAR1_EL1_SB __BITS(39,36)
285#define ID_AA64ISAR1_EL1_SB_NONE 0 285#define ID_AA64ISAR1_EL1_SB_NONE 0
286#define ID_AA64ISAR1_EL1_SB_SUPPORTED 1 286#define ID_AA64ISAR1_EL1_SB_SUPPORTED 1
287#define ID_AA64ISAR1_EL1_FRINTTS __BITS(35,32) 287#define ID_AA64ISAR1_EL1_FRINTTS __BITS(35,32)
288#define ID_AA64ISAR1_EL1_FRINTTS_NONE 0 288#define ID_AA64ISAR1_EL1_FRINTTS_NONE 0
289#define ID_AA64ISAR1_EL1_FRINTTS_SUPPORTED 1 289#define ID_AA64ISAR1_EL1_FRINTTS_SUPPORTED 1
290#define ID_AA64ISAR1_EL1_GPI __BITS(31,28) 290#define ID_AA64ISAR1_EL1_GPI __BITS(31,28)
291#define ID_AA64ISAR1_EL1_GPI_NONE 0 291#define ID_AA64ISAR1_EL1_GPI_NONE 0
292#define ID_AA64ISAR1_EL1_GPI_SUPPORTED 1 292#define ID_AA64ISAR1_EL1_GPI_SUPPORTED 1
293#define ID_AA64ISAR1_EL1_GPA __BITS(27,24) 293#define ID_AA64ISAR1_EL1_GPA __BITS(27,24)
294#define ID_AA64ISAR1_EL1_GPA_NONE 0 294#define ID_AA64ISAR1_EL1_GPA_NONE 0
295#define ID_AA64ISAR1_EL1_GPA_QARMA 1 295#define ID_AA64ISAR1_EL1_GPA_QARMA 1
296#define ID_AA64ISAR1_EL1_LRCPC __BITS(23,20) 296#define ID_AA64ISAR1_EL1_LRCPC __BITS(23,20)
297#define ID_AA64ISAR1_EL1_LRCPC_NONE 0 297#define ID_AA64ISAR1_EL1_LRCPC_NONE 0
298#define ID_AA64ISAR1_EL1_LRCPC_PR 1 298#define ID_AA64ISAR1_EL1_LRCPC_PR 1
299#define ID_AA64ISAR1_EL1_LRCPC_PR_UR 2 299#define ID_AA64ISAR1_EL1_LRCPC_PR_UR 2
300#define ID_AA64ISAR1_EL1_FCMA __BITS(19,16) 300#define ID_AA64ISAR1_EL1_FCMA __BITS(19,16)
301#define ID_AA64ISAR1_EL1_FCMA_NONE 0 301#define ID_AA64ISAR1_EL1_FCMA_NONE 0
302#define ID_AA64ISAR1_EL1_FCMA_SUPPORTED 1 302#define ID_AA64ISAR1_EL1_FCMA_SUPPORTED 1
303#define ID_AA64ISAR1_EL1_JSCVT __BITS(15,12) 303#define ID_AA64ISAR1_EL1_JSCVT __BITS(15,12)
304#define ID_AA64ISAR1_EL1_JSCVT_NONE 0 304#define ID_AA64ISAR1_EL1_JSCVT_NONE 0
305#define ID_AA64ISAR1_EL1_JSCVT_SUPPORTED 1 305#define ID_AA64ISAR1_EL1_JSCVT_SUPPORTED 1
306#define ID_AA64ISAR1_EL1_API __BITS(11,8) 306#define ID_AA64ISAR1_EL1_API __BITS(11,8)
307#define ID_AA64ISAR1_EL1_API_NONE 0 307#define ID_AA64ISAR1_EL1_API_NONE 0
308#define ID_AA64ISAR1_EL1_API_SUPPORTED 1 308#define ID_AA64ISAR1_EL1_API_SUPPORTED 1
309#define ID_AA64ISAR1_EL1_API_ENHANCED 2 309#define ID_AA64ISAR1_EL1_API_ENHANCED 2
310#define ID_AA64ISAR1_EL1_APA __BITS(7,4) 310#define ID_AA64ISAR1_EL1_APA __BITS(7,4)
311#define ID_AA64ISAR1_EL1_APA_NONE 0 311#define ID_AA64ISAR1_EL1_APA_NONE 0
312#define ID_AA64ISAR1_EL1_APA_QARMA 1 312#define ID_AA64ISAR1_EL1_APA_QARMA 1
313#define ID_AA64ISAR1_EL1_APA_QARMA_ENH 2 313#define ID_AA64ISAR1_EL1_APA_QARMA_ENH 2
314#define ID_AA64ISAR1_EL1_DPB __BITS(3,0) 314#define ID_AA64ISAR1_EL1_DPB __BITS(3,0)
315#define ID_AA64ISAR1_EL1_DPB_NONE 0 315#define ID_AA64ISAR1_EL1_DPB_NONE 0
316#define ID_AA64ISAR1_EL1_DPB_CVAP 1 316#define ID_AA64ISAR1_EL1_DPB_CVAP 1
317#define ID_AA64ISAR1_EL1_DPB_CVAP_CVADP 2 317#define ID_AA64ISAR1_EL1_DPB_CVAP_CVADP 2
318 318
319AARCH64REG_READ_INLINE(id_aa64mmfr0_el1) 319AARCH64REG_READ_INLINE(id_aa64mmfr0_el1)
320 320
321#define ID_AA64MMFR0_EL1_EXS __BITS(43,40) 321#define ID_AA64MMFR0_EL1_EXS __BITS(43,40)
322#define ID_AA64MMFR0_EL1_TGRAN4 __BITS(31,28) 322#define ID_AA64MMFR0_EL1_TGRAN4 __BITS(31,28)
323#define ID_AA64MMFR0_EL1_TGRAN4_4KB 0 323#define ID_AA64MMFR0_EL1_TGRAN4_4KB 0
324#define ID_AA64MMFR0_EL1_TGRAN4_NONE 15 324#define ID_AA64MMFR0_EL1_TGRAN4_NONE 15
325#define ID_AA64MMFR0_EL1_TGRAN64 __BITS(24,27) 325#define ID_AA64MMFR0_EL1_TGRAN64 __BITS(24,27)
326#define ID_AA64MMFR0_EL1_TGRAN64_64KB 0 326#define ID_AA64MMFR0_EL1_TGRAN64_64KB 0
327#define ID_AA64MMFR0_EL1_TGRAN64_NONE 15 327#define ID_AA64MMFR0_EL1_TGRAN64_NONE 15
328#define ID_AA64MMFR0_EL1_TGRAN16 __BITS(20,23) 328#define ID_AA64MMFR0_EL1_TGRAN16 __BITS(20,23)
329#define ID_AA64MMFR0_EL1_TGRAN16_NONE 0 329#define ID_AA64MMFR0_EL1_TGRAN16_NONE 0
330#define ID_AA64MMFR0_EL1_TGRAN16_16KB 1 330#define ID_AA64MMFR0_EL1_TGRAN16_16KB 1
331#define ID_AA64MMFR0_EL1_BIGENDEL0 __BITS(16,19) 331#define ID_AA64MMFR0_EL1_BIGENDEL0 __BITS(16,19)
332#define ID_AA64MMFR0_EL1_BIGENDEL0_NONE 0 332#define ID_AA64MMFR0_EL1_BIGENDEL0_NONE 0
333#define ID_AA64MMFR0_EL1_BIGENDEL0_MIX 1 333#define ID_AA64MMFR0_EL1_BIGENDEL0_MIX 1
334#define ID_AA64MMFR0_EL1_SNSMEM __BITS(12,15) 334#define ID_AA64MMFR0_EL1_SNSMEM __BITS(12,15)
335#define ID_AA64MMFR0_EL1_SNSMEM_NONE 0 335#define ID_AA64MMFR0_EL1_SNSMEM_NONE 0
336#define ID_AA64MMFR0_EL1_SNSMEM_SNSMEM 1 336#define ID_AA64MMFR0_EL1_SNSMEM_SNSMEM 1
337#define ID_AA64MMFR0_EL1_BIGEND __BITS(8,11) 337#define ID_AA64MMFR0_EL1_BIGEND __BITS(8,11)
338#define ID_AA64MMFR0_EL1_BIGEND_NONE 0 338#define ID_AA64MMFR0_EL1_BIGEND_NONE 0
339#define ID_AA64MMFR0_EL1_BIGEND_MIX 1 339#define ID_AA64MMFR0_EL1_BIGEND_MIX 1
340#define ID_AA64MMFR0_EL1_ASIDBITS __BITS(4,7) 340#define ID_AA64MMFR0_EL1_ASIDBITS __BITS(4,7)
341#define ID_AA64MMFR0_EL1_ASIDBITS_8BIT 0 341#define ID_AA64MMFR0_EL1_ASIDBITS_8BIT 0
342#define ID_AA64MMFR0_EL1_ASIDBITS_16BIT 2 342#define ID_AA64MMFR0_EL1_ASIDBITS_16BIT 2
343#define ID_AA64MMFR0_EL1_PARANGE __BITS(0,3) 343#define ID_AA64MMFR0_EL1_PARANGE __BITS(0,3)
344#define ID_AA64MMFR0_EL1_PARANGE_4G 0 344#define ID_AA64MMFR0_EL1_PARANGE_4G 0
345#define ID_AA64MMFR0_EL1_PARANGE_64G 1 345#define ID_AA64MMFR0_EL1_PARANGE_64G 1
346#define ID_AA64MMFR0_EL1_PARANGE_1T 2 346#define ID_AA64MMFR0_EL1_PARANGE_1T 2
347#define ID_AA64MMFR0_EL1_PARANGE_4T 3 347#define ID_AA64MMFR0_EL1_PARANGE_4T 3
348#define ID_AA64MMFR0_EL1_PARANGE_16T 4 348#define ID_AA64MMFR0_EL1_PARANGE_16T 4
349#define ID_AA64MMFR0_EL1_PARANGE_256T 5 349#define ID_AA64MMFR0_EL1_PARANGE_256T 5
350#define ID_AA64MMFR0_EL1_PARANGE_4P 6 350#define ID_AA64MMFR0_EL1_PARANGE_4P 6
351 351
352AARCH64REG_READ_INLINE(id_aa64mmfr1_el1) 352AARCH64REG_READ_INLINE(id_aa64mmfr1_el1)
353 353
354#define ID_AA64MMFR1_EL1_XNX __BITS(31,28) 354#define ID_AA64MMFR1_EL1_XNX __BITS(31,28)
355#define ID_AA64MMFR1_EL1_XNX_NONE 0 355#define ID_AA64MMFR1_EL1_XNX_NONE 0
356#define ID_AA64MMFR1_EL1_XNX_SUPPORTED 1 356#define ID_AA64MMFR1_EL1_XNX_SUPPORTED 1
357#define ID_AA64MMFR1_EL1_SPECSEI __BITS(27,24) 357#define ID_AA64MMFR1_EL1_SPECSEI __BITS(27,24)
358#define ID_AA64MMFR1_EL1_SPECSEI_NONE 0 358#define ID_AA64MMFR1_EL1_SPECSEI_NONE 0
359#define ID_AA64MMFR1_EL1_SPECSEI_EXTINT 1 359#define ID_AA64MMFR1_EL1_SPECSEI_EXTINT 1
360#define ID_AA64MMFR1_EL1_PAN __BITS(23,20) 360#define ID_AA64MMFR1_EL1_PAN __BITS(23,20)
361#define ID_AA64MMFR1_EL1_PAN_NONE 0 361#define ID_AA64MMFR1_EL1_PAN_NONE 0
362#define ID_AA64MMFR1_EL1_PAN_SUPPORTED 1 362#define ID_AA64MMFR1_EL1_PAN_SUPPORTED 1
363#define ID_AA64MMFR1_EL1_PAN_S1E1 2 363#define ID_AA64MMFR1_EL1_PAN_S1E1 2
364#define ID_AA64MMFR1_EL1_LO __BITS(19,16) 364#define ID_AA64MMFR1_EL1_LO __BITS(19,16)
365#define ID_AA64MMFR1_EL1_LO_NONE 0 365#define ID_AA64MMFR1_EL1_LO_NONE 0
366#define ID_AA64MMFR1_EL1_LO_SUPPORTED 1 366#define ID_AA64MMFR1_EL1_LO_SUPPORTED 1
367#define ID_AA64MMFR1_EL1_HPDS __BITS(15,12) 367#define ID_AA64MMFR1_EL1_HPDS __BITS(15,12)
368#define ID_AA64MMFR1_EL1_HPDS_NONE 0 368#define ID_AA64MMFR1_EL1_HPDS_NONE 0
369#define ID_AA64MMFR1_EL1_HPDS_SUPPORTED 1 369#define ID_AA64MMFR1_EL1_HPDS_SUPPORTED 1
370#define ID_AA64MMFR1_EL1_HPDS_EXTRA_PTD 2 370#define ID_AA64MMFR1_EL1_HPDS_EXTRA_PTD 2
371#define ID_AA64MMFR1_EL1_VH __BITS(11,8) 371#define ID_AA64MMFR1_EL1_VH __BITS(11,8)
372#define ID_AA64MMFR1_EL1_VH_NONE 0 372#define ID_AA64MMFR1_EL1_VH_NONE 0
373#define ID_AA64MMFR1_EL1_VH_SUPPORTED 1 373#define ID_AA64MMFR1_EL1_VH_SUPPORTED 1
374#define ID_AA64MMFR1_EL1_VMIDBITS __BITS(7,4) 374#define ID_AA64MMFR1_EL1_VMIDBITS __BITS(7,4)
375#define ID_AA64MMFR1_EL1_VMIDBITS_8BIT 0 375#define ID_AA64MMFR1_EL1_VMIDBITS_8BIT 0
376#define ID_AA64MMFR1_EL1_VMIDBITS_16BIT 2 376#define ID_AA64MMFR1_EL1_VMIDBITS_16BIT 2
377#define ID_AA64MMFR1_EL1_HAFDBS __BITS(3,0) 377#define ID_AA64MMFR1_EL1_HAFDBS __BITS(3,0)
378#define ID_AA64MMFR1_EL1_HAFDBS_NONE 0 378#define ID_AA64MMFR1_EL1_HAFDBS_NONE 0
379#define ID_AA64MMFR1_EL1_HAFDBS_A 1 379#define ID_AA64MMFR1_EL1_HAFDBS_A 1
380#define ID_AA64MMFR1_EL1_HAFDBS_AD 2 380#define ID_AA64MMFR1_EL1_HAFDBS_AD 2
381 381
382AARCH64REG_READ_INLINE3(id_aa64mmfr2_el1, id_aa64mmfr2_el1, 382AARCH64REG_READ_INLINE3(id_aa64mmfr2_el1, id_aa64mmfr2_el1,
383 __attribute__((target("arch=armv8.2-a")))) 383 __attribute__((target("arch=armv8.2-a"))))
384 384
385#define ID_AA64MMFR2_EL1_E0PD __BITS(63,60) 385#define ID_AA64MMFR2_EL1_E0PD __BITS(63,60)
386#define ID_AA64MMFR2_EL1_E0PD_NONE 0 386#define ID_AA64MMFR2_EL1_E0PD_NONE 0
387#define ID_AA64MMFR2_EL1_E0PD_SUPPORTED 1 387#define ID_AA64MMFR2_EL1_E0PD_SUPPORTED 1
388#define ID_AA64MMFR2_EL1_EVT __BITS(59,56) 388#define ID_AA64MMFR2_EL1_EVT __BITS(59,56)
389#define ID_AA64MMFR2_EL1_EVT_NONE 0 389#define ID_AA64MMFR2_EL1_EVT_NONE 0
390#define ID_AA64MMFR2_EL1_EVT_TO_TI 1 390#define ID_AA64MMFR2_EL1_EVT_TO_TI 1
391#define ID_AA64MMFR2_EL1_EVT_TO_TI_TTL 2 391#define ID_AA64MMFR2_EL1_EVT_TO_TI_TTL 2
392#define ID_AA64MMFR2_EL1_BBM __BITS(55,52) 392#define ID_AA64MMFR2_EL1_BBM __BITS(55,52)
393#define ID_AA64MMFR2_EL1_BBM_L0 0 393#define ID_AA64MMFR2_EL1_BBM_L0 0
394#define ID_AA64MMFR2_EL1_BBM_L1 1 394#define ID_AA64MMFR2_EL1_BBM_L1 1
395#define ID_AA64MMFR2_EL1_BBM_L2 2 395#define ID_AA64MMFR2_EL1_BBM_L2 2
396#define ID_AA64MMFR2_EL1_TTL __BITS(51,48) 396#define ID_AA64MMFR2_EL1_TTL __BITS(51,48)
397#define ID_AA64MMFR2_EL1_TTL_NONE 0 397#define ID_AA64MMFR2_EL1_TTL_NONE 0
398#define ID_AA64MMFR2_EL1_TTL_SUPPORTED 1 398#define ID_AA64MMFR2_EL1_TTL_SUPPORTED 1
399#define ID_AA64MMFR2_EL1_FWB __BITS(43,40) 399#define ID_AA64MMFR2_EL1_FWB __BITS(43,40)
400#define ID_AA64MMFR2_EL1_FWB_NONE 0 400#define ID_AA64MMFR2_EL1_FWB_NONE 0
401#define ID_AA64MMFR2_EL1_FWB_SUPPORTED 1 401#define ID_AA64MMFR2_EL1_FWB_SUPPORTED 1
402#define ID_AA64MMFR2_EL1_IDS __BITS(39,36) 402#define ID_AA64MMFR2_EL1_IDS __BITS(39,36)
403#define ID_AA64MMFR2_EL1_IDS_0X0 0 403#define ID_AA64MMFR2_EL1_IDS_0X0 0
404#define ID_AA64MMFR2_EL1_IDS_0X18 1 404#define ID_AA64MMFR2_EL1_IDS_0X18 1
405#define ID_AA64MMFR2_EL1_AT __BITS(35,32) 405#define ID_AA64MMFR2_EL1_AT __BITS(35,32)
406#define ID_AA64MMFR2_EL1_AT_NONE 0 406#define ID_AA64MMFR2_EL1_AT_NONE 0
407#define ID_AA64MMFR2_EL1_AT_16BIT 1 407#define ID_AA64MMFR2_EL1_AT_16BIT 1
408#define ID_AA64MMFR2_EL1_ST __BITS(31,28) 408#define ID_AA64MMFR2_EL1_ST __BITS(31,28)
409#define ID_AA64MMFR2_EL1_ST_39 0 409#define ID_AA64MMFR2_EL1_ST_39 0
410#define ID_AA64MMFR2_EL1_ST_48 1 410#define ID_AA64MMFR2_EL1_ST_48 1
411#define ID_AA64MMFR2_EL1_NV __BITS(27,24) 411#define ID_AA64MMFR2_EL1_NV __BITS(27,24)
412#define ID_AA64MMFR2_EL1_NV_NONE 0 412#define ID_AA64MMFR2_EL1_NV_NONE 0
413#define ID_AA64MMFR2_EL1_NV_HCR 1 413#define ID_AA64MMFR2_EL1_NV_HCR 1
414#define ID_AA64MMFR2_EL1_NV_HCR_VNCR 2 414#define ID_AA64MMFR2_EL1_NV_HCR_VNCR 2
415#define ID_AA64MMFR2_EL1_CCIDX __BITS(23,20) 415#define ID_AA64MMFR2_EL1_CCIDX __BITS(23,20)
416#define ID_AA64MMFR2_EL1_CCIDX_32BIT 0 416#define ID_AA64MMFR2_EL1_CCIDX_32BIT 0
417#define ID_AA64MMFR2_EL1_CCIDX_64BIT 1 417#define ID_AA64MMFR2_EL1_CCIDX_64BIT 1
418#define ID_AA64MMFR2_EL1_VARANGE __BITS(19,16) 418#define ID_AA64MMFR2_EL1_VARANGE __BITS(19,16)
419#define ID_AA64MMFR2_EL1_VARANGE_48BIT 0 419#define ID_AA64MMFR2_EL1_VARANGE_48BIT 0
420#define ID_AA64MMFR2_EL1_VARANGE_52BIT 1 420#define ID_AA64MMFR2_EL1_VARANGE_52BIT 1
421#define ID_AA64MMFR2_EL1_IESB __BITS(15,12) 421#define ID_AA64MMFR2_EL1_IESB __BITS(15,12)
422#define ID_AA64MMFR2_EL1_IESB_NONE 0 422#define ID_AA64MMFR2_EL1_IESB_NONE 0
423#define ID_AA64MMFR2_EL1_IESB_SUPPORTED 1 423#define ID_AA64MMFR2_EL1_IESB_SUPPORTED 1
424#define ID_AA64MMFR2_EL1_LSM __BITS(11,8) 424#define ID_AA64MMFR2_EL1_LSM __BITS(11,8)
425#define ID_AA64MMFR2_EL1_LSM_NONE 0 425#define ID_AA64MMFR2_EL1_LSM_NONE 0
426#define ID_AA64MMFR2_EL1_LSM_SUPPORTED 1 426#define ID_AA64MMFR2_EL1_LSM_SUPPORTED 1
427#define ID_AA64MMFR2_EL1_UAO __BITS(7,4) 427#define ID_AA64MMFR2_EL1_UAO __BITS(7,4)
428#define ID_AA64MMFR2_EL1_UAO_NONE 0 428#define ID_AA64MMFR2_EL1_UAO_NONE 0
429#define ID_AA64MMFR2_EL1_UAO_SUPPORTED 1 429#define ID_AA64MMFR2_EL1_UAO_SUPPORTED 1
430#define ID_AA64MMFR2_EL1_CNP __BITS(3,0) 430#define ID_AA64MMFR2_EL1_CNP __BITS(3,0)
431#define ID_AA64MMFR2_EL1_CNP_NONE 0 431#define ID_AA64MMFR2_EL1_CNP_NONE 0
432#define ID_AA64MMFR2_EL1_CNP_SUPPORTED 1 432#define ID_AA64MMFR2_EL1_CNP_SUPPORTED 1
433 433
434AARCH64REG_READ_INLINE2(a72_cpuactlr_el1, s3_1_c15_c2_0) 434AARCH64REG_READ_INLINE2(a72_cpuactlr_el1, s3_1_c15_c2_0)
435AARCH64REG_READ_INLINE(id_aa64pfr0_el1) 435AARCH64REG_READ_INLINE(id_aa64pfr0_el1)
436AARCH64REG_READ_INLINE(id_aa64pfr1_el1) 436AARCH64REG_READ_INLINE(id_aa64pfr1_el1)
437 437
438#define ID_AA64PFR1_EL1_RASFRAC __BITS(15,12) 438#define ID_AA64PFR1_EL1_RASFRAC __BITS(15,12)
439#define ID_AA64PFR1_EL1_RASFRAC_NORMAL 0 439#define ID_AA64PFR1_EL1_RASFRAC_NORMAL 0
440#define ID_AA64PFR1_EL1_RASFRAC_EXTRA 1 440#define ID_AA64PFR1_EL1_RASFRAC_EXTRA 1
441#define ID_AA64PFR1_EL1_MTE __BITS(11,8) 441#define ID_AA64PFR1_EL1_MTE __BITS(11,8)
442#define ID_AA64PFR1_EL1_MTE_NONE 0 442#define ID_AA64PFR1_EL1_MTE_NONE 0
443#define ID_AA64PFR1_EL1_MTE_PARTIAL 1 443#define ID_AA64PFR1_EL1_MTE_PARTIAL 1
444#define ID_AA64PFR1_EL1_MTE_SUPPORTED 2 444#define ID_AA64PFR1_EL1_MTE_SUPPORTED 2
445#define ID_AA64PFR1_EL1_SSBS __BITS(7,4) 445#define ID_AA64PFR1_EL1_SSBS __BITS(7,4)
446#define ID_AA64PFR1_EL1_SSBS_NONE 0 446#define ID_AA64PFR1_EL1_SSBS_NONE 0
447#define ID_AA64PFR1_EL1_SSBS_SUPPORTED 1 447#define ID_AA64PFR1_EL1_SSBS_SUPPORTED 1
448#define ID_AA64PFR1_EL1_SSBS_MSR_MRS 2 448#define ID_AA64PFR1_EL1_SSBS_MSR_MRS 2
449#define ID_AA64PFR1_EL1_BT __BITS(3,0) 449#define ID_AA64PFR1_EL1_BT __BITS(3,0)
450#define ID_AA64PFR1_EL1_BT_NONE 0 450#define ID_AA64PFR1_EL1_BT_NONE 0
451#define ID_AA64PFR1_EL1_BT_SUPPORTED 1 451#define ID_AA64PFR1_EL1_BT_SUPPORTED 1
452 452
453AARCH64REG_READ_INLINE(id_aa64zfr0_el1) 453AARCH64REG_READ_INLINE(id_aa64zfr0_el1)
454AARCH64REG_READ_INLINE(id_pfr1_el1) 454AARCH64REG_READ_INLINE(id_pfr1_el1)
455AARCH64REG_READ_INLINE(isr_el1) 455AARCH64REG_READ_INLINE(isr_el1)
456AARCH64REG_READ_INLINE(midr_el1) 456AARCH64REG_READ_INLINE(midr_el1)
457AARCH64REG_READ_INLINE(mpidr_el1) 457AARCH64REG_READ_INLINE(mpidr_el1)
458 458
459#define MIDR_EL1_IMPL __BITS(31,24) // Implementor 459#define MIDR_EL1_IMPL __BITS(31,24) // Implementor
460#define MIDR_EL1_VARIANT __BITS(23,20) // CPU Variant 460#define MIDR_EL1_VARIANT __BITS(23,20) // CPU Variant
461#define MIDR_EL1_ARCH __BITS(19,16) // Architecture 461#define MIDR_EL1_ARCH __BITS(19,16) // Architecture
462#define MIDR_EL1_PARTNUM __BITS(15,4) // PartNum 462#define MIDR_EL1_PARTNUM __BITS(15,4) // PartNum
463#define MIDR_EL1_REVISION __BITS(3,0) // Revision 463#define MIDR_EL1_REVISION __BITS(3,0) // Revision
464 464
465#define MPIDR_AFF3 __BITS(32,39) 465#define MPIDR_AFF3 __BITS(32,39)
466#define MPIDR_U __BIT(30) // 1 = Uni-Processor System 466#define MPIDR_U __BIT(30) // 1 = Uni-Processor System
467#define MPIDR_MT __BIT(24) // 1 = SMT(AFF0 is logical) 467#define MPIDR_MT __BIT(24) // 1 = SMT(AFF0 is logical)
468#define MPIDR_AFF2 __BITS(16,23) 468#define MPIDR_AFF2 __BITS(16,23)
469#define MPIDR_AFF1 __BITS(8,15) 469#define MPIDR_AFF1 __BITS(8,15)
470#define MPIDR_AFF0 __BITS(0,7) 470#define MPIDR_AFF0 __BITS(0,7)
471 471
472AARCH64REG_READ_INLINE(mvfr0_el1) 472AARCH64REG_READ_INLINE(mvfr0_el1)
473 473
474#define MVFR0_FPROUND __BITS(31,28) 474#define MVFR0_FPROUND __BITS(31,28)
475#define MVFR0_FPROUND_NEAREST 0 475#define MVFR0_FPROUND_NEAREST 0
476#define MVFR0_FPROUND_ALL 1 476#define MVFR0_FPROUND_ALL 1
477#define MVFR0_FPSHVEC __BITS(27,24) 477#define MVFR0_FPSHVEC __BITS(27,24)
478#define MVFR0_FPSHVEC_NONE 0 478#define MVFR0_FPSHVEC_NONE 0
479#define MVFR0_FPSHVEC_SHVEC 1 479#define MVFR0_FPSHVEC_SHVEC 1
480#define MVFR0_FPSQRT __BITS(23,20) 480#define MVFR0_FPSQRT __BITS(23,20)
481#define MVFR0_FPSQRT_NONE 0 481#define MVFR0_FPSQRT_NONE 0
482#define MVFR0_FPSQRT_VSQRT 1 482#define MVFR0_FPSQRT_VSQRT 1
483#define MVFR0_FPDIVIDE __BITS(19,16) 483#define MVFR0_FPDIVIDE __BITS(19,16)
484#define MVFR0_FPDIVIDE_NONE 0 484#define MVFR0_FPDIVIDE_NONE 0
485#define MVFR0_FPDIVIDE_VDIV 1 485#define MVFR0_FPDIVIDE_VDIV 1
486#define MVFR0_FPTRAP __BITS(15,12) 486#define MVFR0_FPTRAP __BITS(15,12)
487#define MVFR0_FPTRAP_NONE 0 487#define MVFR0_FPTRAP_NONE 0
488#define MVFR0_FPTRAP_TRAP 1 488#define MVFR0_FPTRAP_TRAP 1
489#define MVFR0_FPDP __BITS(11,8) 489#define MVFR0_FPDP __BITS(11,8)
490#define MVFR0_FPDP_NONE 0 490#define MVFR0_FPDP_NONE 0
491#define MVFR0_FPDP_VFPV2 1 491#define MVFR0_FPDP_VFPV2 1
492#define MVFR0_FPDP_VFPV3 2 492#define MVFR0_FPDP_VFPV3 2
493#define MVFR0_FPSP __BITS(7,4) 493#define MVFR0_FPSP __BITS(7,4)
494#define MVFR0_FPSP_NONE 0 494#define MVFR0_FPSP_NONE 0
495#define MVFR0_FPSP_VFPV2 1 495#define MVFR0_FPSP_VFPV2 1
496#define MVFR0_FPSP_VFPV3 2 496#define MVFR0_FPSP_VFPV3 2
497#define MVFR0_SIMDREG __BITS(3,0) 497#define MVFR0_SIMDREG __BITS(3,0)
498#define MVFR0_SIMDREG_NONE 0 498#define MVFR0_SIMDREG_NONE 0
499#define MVFR0_SIMDREG_16x64 1 499#define MVFR0_SIMDREG_16x64 1
500#define MVFR0_SIMDREG_32x64 2 500#define MVFR0_SIMDREG_32x64 2
501 501
502AARCH64REG_READ_INLINE(mvfr1_el1) 502AARCH64REG_READ_INLINE(mvfr1_el1)
503 503
504#define MVFR1_SIMDFMAC __BITS(31,28) 504#define MVFR1_SIMDFMAC __BITS(31,28)
505#define MVFR1_SIMDFMAC_NONE 0 505#define MVFR1_SIMDFMAC_NONE 0
506#define MVFR1_SIMDFMAC_FMAC 1 506#define MVFR1_SIMDFMAC_FMAC 1
507#define MVFR1_FPHP __BITS(27,24) 507#define MVFR1_FPHP __BITS(27,24)
508#define MVFR1_FPHP_NONE 0 508#define MVFR1_FPHP_NONE 0
509#define MVFR1_FPHP_HALF_SINGLE 1 509#define MVFR1_FPHP_HALF_SINGLE 1
510#define MVFR1_FPHP_HALF_DOUBLE 2 510#define MVFR1_FPHP_HALF_DOUBLE 2
511#define MVFR1_FPHP_HALF_ARITH 3 511#define MVFR1_FPHP_HALF_ARITH 3
512#define MVFR1_SIMDHP __BITS(23,20) 512#define MVFR1_SIMDHP __BITS(23,20)
513#define MVFR1_SIMDHP_NONE 0 513#define MVFR1_SIMDHP_NONE 0
514#define MVFR1_SIMDHP_HALF 1 514#define MVFR1_SIMDHP_HALF 1
515#define MVFR1_SIMDHP_HALF_ARITH 3 515#define MVFR1_SIMDHP_HALF_ARITH 3
516#define MVFR1_SIMDSP __BITS(19,16) 516#define MVFR1_SIMDSP __BITS(19,16)
517#define MVFR1_SIMDSP_NONE 0 517#define MVFR1_SIMDSP_NONE 0
518#define MVFR1_SIMDSP_SINGLE 1 518#define MVFR1_SIMDSP_SINGLE 1
519#define MVFR1_SIMDINT __BITS(15,12) 519#define MVFR1_SIMDINT __BITS(15,12)
520#define MVFR1_SIMDINT_NONE 0 520#define MVFR1_SIMDINT_NONE 0
521#define MVFR1_SIMDINT_INTEGER 1 521#define MVFR1_SIMDINT_INTEGER 1
522#define MVFR1_SIMDLS __BITS(11,8) 522#define MVFR1_SIMDLS __BITS(11,8)
523#define MVFR1_SIMDLS_NONE 0 523#define MVFR1_SIMDLS_NONE 0
524#define MVFR1_SIMDLS_LOADSTORE 1 524#define MVFR1_SIMDLS_LOADSTORE 1
525#define MVFR1_FPDNAN __BITS(7,4) 525#define MVFR1_FPDNAN __BITS(7,4)
526#define MVFR1_FPDNAN_NONE 0 526#define MVFR1_FPDNAN_NONE 0
527#define MVFR1_FPDNAN_NAN 1 527#define MVFR1_FPDNAN_NAN 1
528#define MVFR1_FPFTZ __BITS(3,0) 528#define MVFR1_FPFTZ __BITS(3,0)
529#define MVFR1_FPFTZ_NONE 0 529#define MVFR1_FPFTZ_NONE 0
530#define MVFR1_FPFTZ_DENORMAL 1 530#define MVFR1_FPFTZ_DENORMAL 1
531 531
532AARCH64REG_READ_INLINE(mvfr2_el1) 532AARCH64REG_READ_INLINE(mvfr2_el1)
533 533
534#define MVFR2_FPMISC __BITS(7,4) 534#define MVFR2_FPMISC __BITS(7,4)
535#define MVFR2_FPMISC_NONE 0 535#define MVFR2_FPMISC_NONE 0
536#define MVFR2_FPMISC_SEL 1 536#define MVFR2_FPMISC_SEL 1
537#define MVFR2_FPMISC_DROUND 2 537#define MVFR2_FPMISC_DROUND 2
538#define MVFR2_FPMISC_ROUNDINT 3 538#define MVFR2_FPMISC_ROUNDINT 3
539#define MVFR2_FPMISC_MAXMIN 4 539#define MVFR2_FPMISC_MAXMIN 4
540#define MVFR2_SIMDMISC __BITS(3,0) 540#define MVFR2_SIMDMISC __BITS(3,0)
541#define MVFR2_SIMDMISC_NONE 0 541#define MVFR2_SIMDMISC_NONE 0
542#define MVFR2_SIMDMISC_DROUND 1 542#define MVFR2_SIMDMISC_DROUND 1
543#define MVFR2_SIMDMISC_ROUNDINT 2 543#define MVFR2_SIMDMISC_ROUNDINT 2
544#define MVFR2_SIMDMISC_MAXMIN 3 544#define MVFR2_SIMDMISC_MAXMIN 3
545 545
546AARCH64REG_READ_INLINE(revidr_el1) 546AARCH64REG_READ_INLINE(revidr_el1)
547 547
548/* 548/*
549 * These are read/write registers 549 * These are read/write registers
550 */ 550 */
551AARCH64REG_READ_INLINE(cpacr_el1) // Coprocessor Access Control Regiser 551AARCH64REG_READ_INLINE(cpacr_el1) // Coprocessor Access Control Regiser
552AARCH64REG_WRITE_INLINE(cpacr_el1) 552AARCH64REG_WRITE_INLINE(cpacr_el1)
553 553
554#define CPACR_TTA __BIT(28) // System Register Access Traps 554#define CPACR_TTA __BIT(28) // System Register Access Traps
555#define CPACR_FPEN __BITS(21,20) 555#define CPACR_FPEN __BITS(21,20)
556#define CPACR_FPEN_NONE __SHIFTIN(0, CPACR_FPEN) 556#define CPACR_FPEN_NONE __SHIFTIN(0, CPACR_FPEN)
557#define CPACR_FPEN_EL1 __SHIFTIN(1, CPACR_FPEN) 557#define CPACR_FPEN_EL1 __SHIFTIN(1, CPACR_FPEN)
558#define CPACR_FPEN_NONE_2 __SHIFTIN(2, CPACR_FPEN) 558#define CPACR_FPEN_NONE_2 __SHIFTIN(2, CPACR_FPEN)
559#define CPACR_FPEN_ALL __SHIFTIN(3, CPACR_FPEN) 559#define CPACR_FPEN_ALL __SHIFTIN(3, CPACR_FPEN)
560 560
561AARCH64REG_READ_INLINE(csselr_el1) // Cache Size Selection Register 561AARCH64REG_READ_INLINE(csselr_el1) // Cache Size Selection Register
562AARCH64REG_WRITE_INLINE(csselr_el1) 562AARCH64REG_WRITE_INLINE(csselr_el1)
563 563
564#define CSSELR_LEVEL __BITS(3,1) // Cache level of required cache 564#define CSSELR_LEVEL __BITS(3,1) // Cache level of required cache
565#define CSSELR_IND __BIT(0) // Instruction not Data bit 565#define CSSELR_IND __BIT(0) // Instruction not Data bit
566 566
567AARCH64REG_READ_INLINE(daif) // Debug Async Irq Fiq mask register 567AARCH64REG_READ_INLINE(daif) // Debug Async Irq Fiq mask register
568AARCH64REG_WRITE_INLINE(daif) 568AARCH64REG_WRITE_INLINE(daif)
569AARCH64REG_WRITEIMM_INLINE(daifclr) 569AARCH64REG_WRITEIMM_INLINE(daifclr)
570AARCH64REG_WRITEIMM_INLINE(daifset) 570AARCH64REG_WRITEIMM_INLINE(daifset)
571 571
572#define DAIF_D __BIT(9) // Debug Exception Mask 572#define DAIF_D __BIT(9) // Debug Exception Mask
573#define DAIF_A __BIT(8) // SError Abort Mask 573#define DAIF_A __BIT(8) // SError Abort Mask
574#define DAIF_I __BIT(7) // IRQ Mask 574#define DAIF_I __BIT(7) // IRQ Mask
575#define DAIF_F __BIT(6) // FIQ Mask 575#define DAIF_F __BIT(6) // FIQ Mask
576#define DAIF_SETCLR_SHIFT 6 // for daifset/daifclr #imm shift 576#define DAIF_SETCLR_SHIFT 6 // for daifset/daifclr #imm shift
577 577
578AARCH64REG_READ_INLINE(elr_el1) // Exception Link Register 578AARCH64REG_READ_INLINE(elr_el1) // Exception Link Register
579AARCH64REG_WRITE_INLINE(elr_el1) 579AARCH64REG_WRITE_INLINE(elr_el1)
580 580
581AARCH64REG_READ_INLINE(esr_el1) // Exception Symdrone Register 581AARCH64REG_READ_INLINE(esr_el1) // Exception Symdrone Register
582AARCH64REG_WRITE_INLINE(esr_el1) 582AARCH64REG_WRITE_INLINE(esr_el1)
583 583
584#define ESR_EC __BITS(31,26) // Exception Cause 584#define ESR_EC __BITS(31,26) // Exception Cause
585#define ESR_EC_UNKNOWN 0x00 // AXX: Unknown Reason 585#define ESR_EC_UNKNOWN 0x00 // AXX: Unknown Reason
586#define ESR_EC_WFX 0x01 // AXX: WFI or WFE instruction execution 586#define ESR_EC_WFX 0x01 // AXX: WFI or WFE instruction execution
587#define ESR_EC_CP15_RT 0x03 // A32: MCR/MRC access to CP15 !EC=0 587#define ESR_EC_CP15_RT 0x03 // A32: MCR/MRC access to CP15 !EC=0
588#define ESR_EC_CP15_RRT 0x04 // A32: MCRR/MRRC access to CP15 !EC=0 588#define ESR_EC_CP15_RRT 0x04 // A32: MCRR/MRRC access to CP15 !EC=0
589#define ESR_EC_CP14_RT 0x05 // A32: MCR/MRC access to CP14 589#define ESR_EC_CP14_RT 0x05 // A32: MCR/MRC access to CP14
590#define ESR_EC_CP14_DT 0x06 // A32: LDC/STC access to CP14 590#define ESR_EC_CP14_DT 0x06 // A32: LDC/STC access to CP14
591#define ESR_EC_FP_ACCESS 0x07 // AXX: Access to SIMD/FP Registers 591#define ESR_EC_FP_ACCESS 0x07 // AXX: Access to SIMD/FP Registers
592#define ESR_EC_FPID 0x08 // A32: MCR/MRC access to CP10 !EC=7 592#define ESR_EC_FPID 0x08 // A32: MCR/MRC access to CP10 !EC=7
593#define ESR_EC_CP14_RRT 0x0c // A32: MRRC access to CP14 593#define ESR_EC_CP14_RRT 0x0c // A32: MRRC access to CP14
594#define ESR_EC_BTE_A64 0x0d // A64: Branch Target Exception (V8.5) 594#define ESR_EC_BTE_A64 0x0d // A64: Branch Target Exception (V8.5)
595#define ESR_EC_ILL_STATE 0x0e // AXX: Illegal Execution State 595#define ESR_EC_ILL_STATE 0x0e // AXX: Illegal Execution State
596#define ESR_EC_SVC_A32 0x11 // A32: SVC Instruction Execution 596#define ESR_EC_SVC_A32 0x11 // A32: SVC Instruction Execution
597#define ESR_EC_HVC_A32 0x12 // A32: HVC Instruction Execution 597#define ESR_EC_HVC_A32 0x12 // A32: HVC Instruction Execution
598#define ESR_EC_SMC_A32 0x13 // A32: SMC Instruction Execution 598#define ESR_EC_SMC_A32 0x13 // A32: SMC Instruction Execution
599#define ESR_EC_SVC_A64 0x15 // A64: SVC Instruction Execution 599#define ESR_EC_SVC_A64 0x15 // A64: SVC Instruction Execution
600#define ESR_EC_HVC_A64 0x16 // A64: HVC Instruction Execution 600#define ESR_EC_HVC_A64 0x16 // A64: HVC Instruction Execution
601#define ESR_EC_SMC_A64 0x17 // A64: SMC Instruction Execution 601#define ESR_EC_SMC_A64 0x17 // A64: SMC Instruction Execution
602#define ESR_EC_SYS_REG 0x18 // A64: MSR/MRS/SYS instruction (!EC0/1/7) 602#define ESR_EC_SYS_REG 0x18 // A64: MSR/MRS/SYS instruction (!EC0/1/7)
603#define ESR_EC_INSN_ABT_EL0 0x20 // AXX: Instruction Abort (EL0) 603#define ESR_EC_INSN_ABT_EL0 0x20 // AXX: Instruction Abort (EL0)
604#define ESR_EC_INSN_ABT_EL1 0x21 // AXX: Instruction Abort (EL1) 604#define ESR_EC_INSN_ABT_EL1 0x21 // AXX: Instruction Abort (EL1)
605#define ESR_EC_PC_ALIGNMENT 0x22 // AXX: Misaligned PC 605#define ESR_EC_PC_ALIGNMENT 0x22 // AXX: Misaligned PC
606#define ESR_EC_DATA_ABT_EL0 0x24 // AXX: Data Abort (EL0) 606#define ESR_EC_DATA_ABT_EL0 0x24 // AXX: Data Abort (EL0)
607#define ESR_EC_DATA_ABT_EL1 0x25 // AXX: Data Abort (EL1) 607#define ESR_EC_DATA_ABT_EL1 0x25 // AXX: Data Abort (EL1)
608#define ESR_EC_SP_ALIGNMENT 0x26 // AXX: Misaligned SP 608#define ESR_EC_SP_ALIGNMENT 0x26 // AXX: Misaligned SP
609#define ESR_EC_FP_TRAP_A32 0x28 // A32: FP Exception 609#define ESR_EC_FP_TRAP_A32 0x28 // A32: FP Exception
610#define ESR_EC_FP_TRAP_A64 0x2c // A64: FP Exception 610#define ESR_EC_FP_TRAP_A64 0x2c // A64: FP Exception
611#define ESR_EC_SERROR 0x2f // AXX: SError Interrupt 611#define ESR_EC_SERROR 0x2f // AXX: SError Interrupt
612#define ESR_EC_BRKPNT_EL0 0x30 // AXX: Breakpoint Exception (EL0) 612#define ESR_EC_BRKPNT_EL0 0x30 // AXX: Breakpoint Exception (EL0)
613#define ESR_EC_BRKPNT_EL1 0x31 // AXX: Breakpoint Exception (EL1) 613#define ESR_EC_BRKPNT_EL1 0x31 // AXX: Breakpoint Exception (EL1)
614#define ESR_EC_SW_STEP_EL0 0x32 // AXX: Software Step (EL0) 614#define ESR_EC_SW_STEP_EL0 0x32 // AXX: Software Step (EL0)
615#define ESR_EC_SW_STEP_EL1 0x33 // AXX: Software Step (EL1) 615#define ESR_EC_SW_STEP_EL1 0x33 // AXX: Software Step (EL1)
616#define ESR_EC_WTCHPNT_EL0 0x34 // AXX: Watchpoint (EL0) 616#define ESR_EC_WTCHPNT_EL0 0x34 // AXX: Watchpoint (EL0)
617#define ESR_EC_WTCHPNT_EL1 0x35 // AXX: Watchpoint (EL1) 617#define ESR_EC_WTCHPNT_EL1 0x35 // AXX: Watchpoint (EL1)
618#define ESR_EC_BKPT_INSN_A32 0x38 // A32: BKPT Instruction Execution 618#define ESR_EC_BKPT_INSN_A32 0x38 // A32: BKPT Instruction Execution
619#define ESR_EC_VECTOR_CATCH 0x3a // A32: Vector Catch Exception 619#define ESR_EC_VECTOR_CATCH 0x3a // A32: Vector Catch Exception
620#define ESR_EC_BKPT_INSN_A64 0x3c // A64: BKPT Instruction Execution 620#define ESR_EC_BKPT_INSN_A64 0x3c // A64: BKPT Instruction Execution
621#define ESR_IL __BIT(25) // Instruction Length (1=32-bit) 621#define ESR_IL __BIT(25) // Instruction Length (1=32-bit)
622#define ESR_ISS __BITS(24,0) // Instruction Specific Syndrome 622#define ESR_ISS __BITS(24,0) // Instruction Specific Syndrome
623#define ESR_ISS_CV __BIT(24) // common 623#define ESR_ISS_CV __BIT(24) // common
624#define ESR_ISS_COND __BITS(23,20) // common 624#define ESR_ISS_COND __BITS(23,20) // common
625#define ESR_ISS_WFX_TRAP_INSN __BIT(0) // for ESR_EC_WFX 625#define ESR_ISS_WFX_TRAP_INSN __BIT(0) // for ESR_EC_WFX
626#define ESR_ISS_MRC_OPC2 __BITS(19,17) // for ESR_EC_CP15_RT 626#define ESR_ISS_MRC_OPC2 __BITS(19,17) // for ESR_EC_CP15_RT
627#define ESR_ISS_MRC_OPC1 __BITS(16,14) // for ESR_EC_CP15_RT 627#define ESR_ISS_MRC_OPC1 __BITS(16,14) // for ESR_EC_CP15_RT
628#define ESR_ISS_MRC_CRN __BITS(13,10) // for ESR_EC_CP15_RT 628#define ESR_ISS_MRC_CRN __BITS(13,10) // for ESR_EC_CP15_RT
629#define ESR_ISS_MRC_RT __BITS(9,5) // for ESR_EC_CP15_RT 629#define ESR_ISS_MRC_RT __BITS(9,5) // for ESR_EC_CP15_RT
630#define ESR_ISS_MRC_CRM __BITS(4,1) // for ESR_EC_CP15_RT 630#define ESR_ISS_MRC_CRM __BITS(4,1) // for ESR_EC_CP15_RT
631#define ESR_ISS_MRC_DIRECTION __BIT(0) // for ESR_EC_CP15_RT 631#define ESR_ISS_MRC_DIRECTION __BIT(0) // for ESR_EC_CP15_RT
632#define ESR_ISS_MCRR_OPC1 __BITS(19,16) // for ESR_EC_CP15_RRT 632#define ESR_ISS_MCRR_OPC1 __BITS(19,16) // for ESR_EC_CP15_RRT
633#define ESR_ISS_MCRR_RT2 __BITS(14,10) // for ESR_EC_CP15_RRT 633#define ESR_ISS_MCRR_RT2 __BITS(14,10) // for ESR_EC_CP15_RRT
634#define ESR_ISS_MCRR_RT __BITS(9,5) // for ESR_EC_CP15_RRT 634#define ESR_ISS_MCRR_RT __BITS(9,5) // for ESR_EC_CP15_RRT
635#define ESR_ISS_MCRR_CRM __BITS(4,1) // for ESR_EC_CP15_RRT 635#define ESR_ISS_MCRR_CRM __BITS(4,1) // for ESR_EC_CP15_RRT
636#define ESR_ISS_MCRR_DIRECTION __BIT(0) // for ESR_EC_CP15_RRT 636#define ESR_ISS_MCRR_DIRECTION __BIT(0) // for ESR_EC_CP15_RRT
637#define ESR_ISS_HVC_IMM16 __BITS(15,0) // for ESR_EC_{SVC,HVC} 637#define ESR_ISS_HVC_IMM16 __BITS(15,0) // for ESR_EC_{SVC,HVC}
638// ... 638// ...
639#define ESR_ISS_INSNABORT_EA __BIT(9) // for ESC_RC_INSN_ABT_EL[01] 639#define ESR_ISS_INSNABORT_EA __BIT(9) // for ESC_RC_INSN_ABT_EL[01]
640#define ESR_ISS_INSNABORT_S1PTW __BIT(7) // for ESC_RC_INSN_ABT_EL[01] 640#define ESR_ISS_INSNABORT_S1PTW __BIT(7) // for ESC_RC_INSN_ABT_EL[01]
641#define ESR_ISS_INSNABORT_IFSC __BITS(0,5) // for ESC_RC_INSN_ABT_EL[01] 641#define ESR_ISS_INSNABORT_IFSC __BITS(0,5) // for ESC_RC_INSN_ABT_EL[01]
642#define ESR_ISS_DATAABORT_ISV __BIT(24) // for ESC_RC_DATA_ABT_EL[01] 642#define ESR_ISS_DATAABORT_ISV __BIT(24) // for ESC_RC_DATA_ABT_EL[01]
643#define ESR_ISS_DATAABORT_SAS __BITS(23,22) // for ESC_RC_DATA_ABT_EL[01] 643#define ESR_ISS_DATAABORT_SAS __BITS(23,22) // for ESC_RC_DATA_ABT_EL[01]
644#define ESR_ISS_DATAABORT_SSE __BIT(21) // for ESC_RC_DATA_ABT_EL[01] 644#define ESR_ISS_DATAABORT_SSE __BIT(21) // for ESC_RC_DATA_ABT_EL[01]
645#define ESR_ISS_DATAABORT_SRT __BITS(19,16) // for ESC_RC_DATA_ABT_EL[01] 645#define ESR_ISS_DATAABORT_SRT __BITS(19,16) // for ESC_RC_DATA_ABT_EL[01]
646#define ESR_ISS_DATAABORT_SF __BIT(15) // for ESC_RC_DATA_ABT_EL[01] 646#define ESR_ISS_DATAABORT_SF __BIT(15) // for ESC_RC_DATA_ABT_EL[01]
647#define ESR_ISS_DATAABORT_AR __BIT(14) // for ESC_RC_DATA_ABT_EL[01] 647#define ESR_ISS_DATAABORT_AR __BIT(14) // for ESC_RC_DATA_ABT_EL[01]
648#define ESR_ISS_DATAABORT_EA __BIT(9) // for ESC_RC_DATA_ABT_EL[01] 648#define ESR_ISS_DATAABORT_EA __BIT(9) // for ESC_RC_DATA_ABT_EL[01]
649#define ESR_ISS_DATAABORT_CM __BIT(8) // for ESC_RC_DATA_ABT_EL[01] 649#define ESR_ISS_DATAABORT_CM __BIT(8) // for ESC_RC_DATA_ABT_EL[01]
650#define ESR_ISS_DATAABORT_S1PTW __BIT(7) // for ESC_RC_DATA_ABT_EL[01] 650#define ESR_ISS_DATAABORT_S1PTW __BIT(7) // for ESC_RC_DATA_ABT_EL[01]
651#define ESR_ISS_DATAABORT_WnR __BIT(6) // for ESC_RC_DATA_ABT_EL[01] 651#define ESR_ISS_DATAABORT_WnR __BIT(6) // for ESC_RC_DATA_ABT_EL[01]
652#define ESR_ISS_DATAABORT_DFSC __BITS(0,5) // for ESC_RC_DATA_ABT_EL[01] 652#define ESR_ISS_DATAABORT_DFSC __BITS(0,5) // for ESC_RC_DATA_ABT_EL[01]
653 653
654#define ESR_ISS_FSC_ADDRESS_SIZE_FAULT_0 0x00 654#define ESR_ISS_FSC_ADDRESS_SIZE_FAULT_0 0x00
655#define ESR_ISS_FSC_ADDRESS_SIZE_FAULT_1 0x01 655#define ESR_ISS_FSC_ADDRESS_SIZE_FAULT_1 0x01
656#define ESR_ISS_FSC_ADDRESS_SIZE_FAULT_2 0x02 656#define ESR_ISS_FSC_ADDRESS_SIZE_FAULT_2 0x02
657#define ESR_ISS_FSC_ADDRESS_SIZE_FAULT_3 0x03 657#define ESR_ISS_FSC_ADDRESS_SIZE_FAULT_3 0x03
658#define ESR_ISS_FSC_TRANSLATION_FAULT_0 0x04 658#define ESR_ISS_FSC_TRANSLATION_FAULT_0 0x04
659#define ESR_ISS_FSC_TRANSLATION_FAULT_1 0x05 659#define ESR_ISS_FSC_TRANSLATION_FAULT_1 0x05
660#define ESR_ISS_FSC_TRANSLATION_FAULT_2 0x06 660#define ESR_ISS_FSC_TRANSLATION_FAULT_2 0x06
661#define ESR_ISS_FSC_TRANSLATION_FAULT_3 0x07 661#define ESR_ISS_FSC_TRANSLATION_FAULT_3 0x07
662#define ESR_ISS_FSC_ACCESS_FAULT_0 0x08 662#define ESR_ISS_FSC_ACCESS_FAULT_0 0x08
663#define ESR_ISS_FSC_ACCESS_FAULT_1 0x09 663#define ESR_ISS_FSC_ACCESS_FAULT_1 0x09
664#define ESR_ISS_FSC_ACCESS_FAULT_2 0x0a 664#define ESR_ISS_FSC_ACCESS_FAULT_2 0x0a
665#define ESR_ISS_FSC_ACCESS_FAULT_3 0x0b 665#define ESR_ISS_FSC_ACCESS_FAULT_3 0x0b
666#define ESR_ISS_FSC_PERM_FAULT_0 0x0c 666#define ESR_ISS_FSC_PERM_FAULT_0 0x0c
667#define ESR_ISS_FSC_PERM_FAULT_1 0x0d 667#define ESR_ISS_FSC_PERM_FAULT_1 0x0d
668#define ESR_ISS_FSC_PERM_FAULT_2 0x0e 668#define ESR_ISS_FSC_PERM_FAULT_2 0x0e
669#define ESR_ISS_FSC_PERM_FAULT_3 0x0f 669#define ESR_ISS_FSC_PERM_FAULT_3 0x0f
670#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT 0x10 670#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT 0x10
671#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_0 0x14 671#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_0 0x14
672#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_1 0x15 672#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_1 0x15
673#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_2 0x16 673#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_2 0x16
674#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_3 0x17 674#define ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_3 0x17
675#define ESR_ISS_FSC_SYNC_PARITY_ERROR 0x18 675#define ESR_ISS_FSC_SYNC_PARITY_ERROR 0x18
676#define ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_0 0x1c 676#define ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_0 0x1c
677#define ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_1 0x1d 677#define ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_1 0x1d
678#define ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_2 0x1e 678#define ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_2 0x1e
679#define ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_3 0x1f 679#define ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_3 0x1f
680#define ESR_ISS_FSC_ALIGNMENT_FAULT 0x21 680#define ESR_ISS_FSC_ALIGNMENT_FAULT 0x21
681#define ESR_ISS_FSC_TLB_CONFLICT_FAULT 0x30 681#define ESR_ISS_FSC_TLB_CONFLICT_FAULT 0x30
682#define ESR_ISS_FSC_LOCKDOWN_ABORT 0x34 682#define ESR_ISS_FSC_LOCKDOWN_ABORT 0x34
683#define ESR_ISS_FSC_UNSUPPORTED_EXCLUSIVE 0x35 683#define ESR_ISS_FSC_UNSUPPORTED_EXCLUSIVE 0x35
684#define ESR_ISS_FSC_FIRST_LEVEL_DOMAIN_FAULT 0x3d 684#define ESR_ISS_FSC_FIRST_LEVEL_DOMAIN_FAULT 0x3d
685#define ESR_ISS_FSC_SECOND_LEVEL_DOMAIN_FAULT 0x3e 685#define ESR_ISS_FSC_SECOND_LEVEL_DOMAIN_FAULT 0x3e
686 686
687 687
688AARCH64REG_READ_INLINE(far_el1) // Fault Address Register 688AARCH64REG_READ_INLINE(far_el1) // Fault Address Register
689AARCH64REG_WRITE_INLINE(far_el1) 689AARCH64REG_WRITE_INLINE(far_el1)
690 690
691AARCH64REG_READ_INLINE2(l2ctlr_el1, s3_1_c11_c0_2) // Cortex-A53,57,72,73 691AARCH64REG_READ_INLINE2(l2ctlr_el1, s3_1_c11_c0_2) // Cortex-A53,57,72,73
692AARCH64REG_WRITE_INLINE2(l2ctlr_el1, s3_1_c11_c0_2) // Cortex-A53,57,72,73 692AARCH64REG_WRITE_INLINE2(l2ctlr_el1, s3_1_c11_c0_2) // Cortex-A53,57,72,73
693 693
694#define L2CTLR_NUMOFCORE __BITS(25,24) // Number of cores 694#define L2CTLR_NUMOFCORE __BITS(25,24) // Number of cores
695#define L2CTLR_CPUCACHEPROT __BIT(22) // CPU Cache Protection 695#define L2CTLR_CPUCACHEPROT __BIT(22) // CPU Cache Protection
696#define L2CTLR_SCUL2CACHEPROT __BIT(21) // SCU-L2 Cache Protection 696#define L2CTLR_SCUL2CACHEPROT __BIT(21) // SCU-L2 Cache Protection
697#define L2CTLR_L2_INPUT_LATENCY __BIT(5) // L2 Data RAM input latency 697#define L2CTLR_L2_INPUT_LATENCY __BIT(5) // L2 Data RAM input latency
698#define L2CTLR_L2_OUTPUT_LATENCY __BIT(0) // L2 Data RAM output latency 698#define L2CTLR_L2_OUTPUT_LATENCY __BIT(0) // L2 Data RAM output latency
699 699
700AARCH64REG_READ_INLINE(mair_el1) // Memory Attribute Indirection Register 700AARCH64REG_READ_INLINE(mair_el1) // Memory Attribute Indirection Register
701AARCH64REG_WRITE_INLINE(mair_el1) 701AARCH64REG_WRITE_INLINE(mair_el1)
702 702
703#define MAIR_ATTR0 __BITS(7,0) 703#define MAIR_ATTR0 __BITS(7,0)
704#define MAIR_ATTR1 __BITS(15,8) 704#define MAIR_ATTR1 __BITS(15,8)
705#define MAIR_ATTR2 __BITS(23,16) 705#define MAIR_ATTR2 __BITS(23,16)
706#define MAIR_ATTR3 __BITS(31,24) 706#define MAIR_ATTR3 __BITS(31,24)
707#define MAIR_ATTR4 __BITS(39,32) 707#define MAIR_ATTR4 __BITS(39,32)
708#define MAIR_ATTR5 __BITS(47,40) 708#define MAIR_ATTR5 __BITS(47,40)
709#define MAIR_ATTR6 __BITS(55,48) 709#define MAIR_ATTR6 __BITS(55,48)
710#define MAIR_ATTR7 __BITS(63,56) 710#define MAIR_ATTR7 __BITS(63,56)
711#define MAIR_DEVICE_nGnRnE 0x00 // NoGathering,NoReordering,NoEarlyWriteAck. 711#define MAIR_DEVICE_nGnRnE 0x00 // NoGathering,NoReordering,NoEarlyWriteAck.
712#define MAIR_DEVICE_nGnRE 0x04 // NoGathering,NoReordering,EarlyWriteAck. 712#define MAIR_DEVICE_nGnRE 0x04 // NoGathering,NoReordering,EarlyWriteAck.
713#define MAIR_NORMAL_NC 0x44 713#define MAIR_NORMAL_NC 0x44
714#define MAIR_NORMAL_WT 0xbb 714#define MAIR_NORMAL_WT 0xbb
715#define MAIR_NORMAL_WB 0xff 715#define MAIR_NORMAL_WB 0xff
716 716
717AARCH64REG_READ_INLINE(par_el1) // Physical Address Register 717AARCH64REG_READ_INLINE(par_el1) // Physical Address Register
718AARCH64REG_WRITE_INLINE(par_el1) 718AARCH64REG_WRITE_INLINE(par_el1)
719 719
720#define PAR_ATTR __BITS(63,56) // F=0 memory attributes 720#define PAR_ATTR __BITS(63,56) // F=0 memory attributes
721#define PAR_PA __BITS(51,12) // F=0 physical address 721#define PAR_PA __BITS(51,12) // F=0 physical address
722#define PAR_PA_SHIFT 12 722#define PAR_PA_SHIFT 12
723#define PAR_NS __BIT(9) // F=0 non-secure 723#define PAR_NS __BIT(9) // F=0 non-secure
724#define PAR_S __BIT(9) // F=1 failure stage 724#define PAR_S __BIT(9) // F=1 failure stage
725#define PAR_SHA __BITS(8,7) // F=0 shareability attribute 725#define PAR_SHA __BITS(8,7) // F=0 shareability attribute
726#define PAR_SHA_NONE 0 726#define PAR_SHA_NONE 0
727#define PAR_SHA_OUTER 2 727#define PAR_SHA_OUTER 2
728#define PAR_SHA_INNER 3 728#define PAR_SHA_INNER 3
729#define PAR_PTW __BIT(8) // F=1 partial table walk 729#define PAR_PTW __BIT(8) // F=1 partial table walk
730#define PAR_FST __BITS(6,1) // F=1 fault status code 730#define PAR_FST __BITS(6,1) // F=1 fault status code
731#define PAR_F __BIT(0) // translation failed 731#define PAR_F __BIT(0) // translation failed
732 732
733AARCH64REG_READ_INLINE(rmr_el1) // Reset Management Register 733AARCH64REG_READ_INLINE(rmr_el1) // Reset Management Register
734AARCH64REG_WRITE_INLINE(rmr_el1) 734AARCH64REG_WRITE_INLINE(rmr_el1)
735 735
736AARCH64REG_READ_INLINE(rvbar_el1) // Reset Vector Base Address Register 736AARCH64REG_READ_INLINE(rvbar_el1) // Reset Vector Base Address Register
737AARCH64REG_WRITE_INLINE(rvbar_el1) 737AARCH64REG_WRITE_INLINE(rvbar_el1)
738 738
739AARCH64REG_ATWRITE_INLINE(s1e0r); // Address Translate Stages 1 739AARCH64REG_ATWRITE_INLINE(s1e0r); // Address Translate Stages 1
740AARCH64REG_ATWRITE_INLINE(s1e0w); 740AARCH64REG_ATWRITE_INLINE(s1e0w);
741AARCH64REG_ATWRITE_INLINE(s1e1r); 741AARCH64REG_ATWRITE_INLINE(s1e1r);
742AARCH64REG_ATWRITE_INLINE(s1e1w); 742AARCH64REG_ATWRITE_INLINE(s1e1w);
743 743
744AARCH64REG_READ_INLINE(sctlr_el1) // System Control Register 744AARCH64REG_READ_INLINE(sctlr_el1) // System Control Register
745AARCH64REG_WRITE_INLINE(sctlr_el1) 745AARCH64REG_WRITE_INLINE(sctlr_el1)
746 746
747#define SCTLR_RES0 0xc8222400 // Reserved ARMv8.0, write 0 747#define SCTLR_RES0 0xc8222400 // Reserved ARMv8.0, write 0
748#define SCTLR_RES1 0x30d00800 // Reserved ARMv8.0, write 1 748#define SCTLR_RES1 0x30d00800 // Reserved ARMv8.0, write 1
749#define SCTLR_M __BIT(0) 749#define SCTLR_M __BIT(0)
750#define SCTLR_A __BIT(1) 750#define SCTLR_A __BIT(1)
751#define SCTLR_C __BIT(2) 751#define SCTLR_C __BIT(2)
752#define SCTLR_SA __BIT(3) 752#define SCTLR_SA __BIT(3)
753#define SCTLR_SA0 __BIT(4) 753#define SCTLR_SA0 __BIT(4)
754#define SCTLR_CP15BEN __BIT(5) 754#define SCTLR_CP15BEN __BIT(5)
755#define SCTLR_nAA __BIT(6) 755#define SCTLR_nAA __BIT(6)
756#define SCTLR_ITD __BIT(7) 756#define SCTLR_ITD __BIT(7)
757#define SCTLR_SED __BIT(8) 757#define SCTLR_SED __BIT(8)
758#define SCTLR_UMA __BIT(9) 758#define SCTLR_UMA __BIT(9)
759#define SCTLR_EnRCTX __BIT(10) 759#define SCTLR_EnRCTX __BIT(10)
760#define SCTLR_EOS __BIT(11) 760#define SCTLR_EOS __BIT(11)
761#define SCTLR_I __BIT(12) 761#define SCTLR_I __BIT(12)
762#define SCTLR_EnDB __BIT(13) 762#define SCTLR_EnDB __BIT(13)
763#define SCTLR_DZE __BIT(14) 763#define SCTLR_DZE __BIT(14)
764#define SCTLR_UCT __BIT(15) 764#define SCTLR_UCT __BIT(15)
765#define SCTLR_nTWI __BIT(16) 765#define SCTLR_nTWI __BIT(16)
766#define SCTLR_nTWE __BIT(18) 766#define SCTLR_nTWE __BIT(18)
767#define SCTLR_WXN __BIT(19) 767#define SCTLR_WXN __BIT(19)
768#define SCTLR_TSCXT __BIT(20) 768#define SCTLR_TSCXT __BIT(20)
769#define SCTLR_IESB __BIT(21) 769#define SCTLR_IESB __BIT(21)
770#define SCTLR_EIS __BIT(22) 770#define SCTLR_EIS __BIT(22)
771#define SCTLR_SPAN __BIT(23) 771#define SCTLR_SPAN __BIT(23)
772#define SCTLR_EOE __BIT(24) 772#define SCTLR_EOE __BIT(24)
773#define SCTLR_EE __BIT(25) 773#define SCTLR_EE __BIT(25)
774#define SCTLR_UCI __BIT(26) 774#define SCTLR_UCI __BIT(26)
775#define SCTLR_EnDA __BIT(27) 775#define SCTLR_EnDA __BIT(27)
776#define SCTLR_nTLSMD __BIT(28) 776#define SCTLR_nTLSMD __BIT(28)
777#define SCTLR_LSMAOE __BIT(29) 777#define SCTLR_LSMAOE __BIT(29)
778#define SCTLR_EnIB __BIT(30) 778#define SCTLR_EnIB __BIT(30)
779#define SCTLR_EnIA __BIT(31) 779#define SCTLR_EnIA __BIT(31)
780#define SCTLR_BT0 __BIT(35) 780#define SCTLR_BT0 __BIT(35)
781#define SCTLR_BT1 __BIT(36) 781#define SCTLR_BT1 __BIT(36)
782#define SCTLR_ITFSB __BIT(37) 782#define SCTLR_ITFSB __BIT(37)
783#define SCTLR_TCF0 __BITS(39,38) 783#define SCTLR_TCF0 __BITS(39,38)
784#define SCTLR_TCF __BITS(41,40) 784#define SCTLR_TCF __BITS(41,40)
785#define SCTLR_ATA0 __BIT(42) 785#define SCTLR_ATA0 __BIT(42)
786#define SCTLR_ATA __BIT(43) 786#define SCTLR_ATA __BIT(43)
787#define SCTLR_DSSBS __BIT(44) 787#define SCTLR_DSSBS __BIT(44)
788 788
789// current EL stack pointer 789// current EL stack pointer
790static __inline uint64_t 790static __inline uint64_t
791reg_sp_read(void) 791reg_sp_read(void)
792{ 792{
793 uint64_t __rv; 793 uint64_t __rv;
794 __asm __volatile ("mov %0, sp" : "=r"(__rv)); 794 __asm __volatile ("mov %0, sp" : "=r"(__rv));
795 return __rv; 795 return __rv;
796} 796}
797 797
798AARCH64REG_READ_INLINE(sp_el0) // EL0 Stack Pointer 798AARCH64REG_READ_INLINE(sp_el0) // EL0 Stack Pointer
799AARCH64REG_WRITE_INLINE(sp_el0) 799AARCH64REG_WRITE_INLINE(sp_el0)
800 800
801AARCH64REG_READ_INLINE(spsel) // Stack Pointer Select 801AARCH64REG_READ_INLINE(spsel) // Stack Pointer Select
802AARCH64REG_WRITE_INLINE(spsel) 802AARCH64REG_WRITE_INLINE(spsel)
803 803
804#define SPSEL_SP __BIT(0); // use SP_EL0 at all exception levels 804#define SPSEL_SP __BIT(0); // use SP_EL0 at all exception levels
805 805
806AARCH64REG_READ_INLINE(spsr_el1) // Saved Program Status Register 806AARCH64REG_READ_INLINE(spsr_el1) // Saved Program Status Register
807AARCH64REG_WRITE_INLINE(spsr_el1) 807AARCH64REG_WRITE_INLINE(spsr_el1)
808 808
809#define SPSR_NZCV __BITS(31,28) // mask of N Z C V 809#define SPSR_NZCV __BITS(31,28) // mask of N Z C V
810#define SPSR_N __BIT(31) // Negative 810#define SPSR_N __BIT(31) // Negative
811#define SPSR_Z __BIT(30) // Zero 811#define SPSR_Z __BIT(30) // Zero
812#define SPSR_C __BIT(29) // Carry 812#define SPSR_C __BIT(29) // Carry
813#define SPSR_V __BIT(28) // oVerflow 813#define SPSR_V __BIT(28) // oVerflow
814#define SPSR_A32_Q __BIT(27) // A32: Overflow 814#define SPSR_A32_Q __BIT(27) // A32: Overflow
815#define SPSR_A32_IT1 __BIT(26) // A32: IT[1] 815#define SPSR_A32_IT1 __BIT(26) // A32: IT[1]
816#define SPSR_A32_IT0 __BIT(25) // A32: IT[0] 816#define SPSR_A32_IT0 __BIT(25) // A32: IT[0]
817#define SPSR_SS __BIT(21) // Software Step 817#define SPSR_SS __BIT(21) // Software Step
818#define SPSR_SS_SHIFT 21 818#define SPSR_SS_SHIFT 21
819#define SPSR_IL __BIT(20) // Instruction Length 819#define SPSR_IL __BIT(20) // Instruction Length
820#define SPSR_GE __BITS(19,16) // A32: SIMD GE 820#define SPSR_GE __BITS(19,16) // A32: SIMD GE
821#define SPSR_IT7 __BIT(15) // A32: IT[7] 821#define SPSR_IT7 __BIT(15) // A32: IT[7]
822#define SPSR_IT6 __BIT(14) // A32: IT[6] 822#define SPSR_IT6 __BIT(14) // A32: IT[6]
823#define SPSR_IT5 __BIT(13) // A32: IT[5] 823#define SPSR_IT5 __BIT(13) // A32: IT[5]
824#define SPSR_IT4 __BIT(12) // A32: IT[4] 824#define SPSR_IT4 __BIT(12) // A32: IT[4]
825#define SPSR_IT3 __BIT(11) // A32: IT[3] 825#define SPSR_IT3 __BIT(11) // A32: IT[3]
826#define SPSR_IT2 __BIT(10) // A32: IT[2] 826#define SPSR_IT2 __BIT(10) // A32: IT[2]
827#define SPSR_A64_BTYPE __BIT(11,10) // A64: BTYPE 827#define SPSR_A64_BTYPE __BIT(11,10) // A64: BTYPE
828#define SPSR_A64_D __BIT(9) // A64: Debug Exception Mask 828#define SPSR_A64_D __BIT(9) // A64: Debug Exception Mask
829#define SPSR_A32_E __BIT(9) // A32: BE Endian Mode 829#define SPSR_A32_E __BIT(9) // A32: BE Endian Mode
830#define SPSR_A __BIT(8) // Async abort (SError) Mask 830#define SPSR_A __BIT(8) // Async abort (SError) Mask
831#define SPSR_I __BIT(7) // IRQ Mask 831#define SPSR_I __BIT(7) // IRQ Mask
832#define SPSR_F __BIT(6) // FIQ Mask 832#define SPSR_F __BIT(6) // FIQ Mask
833#define SPSR_A32_T __BIT(5) // A32 Thumb Mode 833#define SPSR_A32_T __BIT(5) // A32 Thumb Mode
834#define SPSR_A32 __BIT(4) // A32 Mode (a part of SPSR_M) 834#define SPSR_A32 __BIT(4) // A32 Mode (a part of SPSR_M)
835#define SPSR_M __BITS(4,0) // Execution State 835#define SPSR_M __BITS(4,0) // Execution State
836#define SPSR_M_EL3H 0x0d 836#define SPSR_M_EL3H 0x0d
837#define SPSR_M_EL3T 0x0c 837#define SPSR_M_EL3T 0x0c
838#define SPSR_M_EL2H 0x09 838#define SPSR_M_EL2H 0x09
839#define SPSR_M_EL2T 0x08 839#define SPSR_M_EL2T 0x08
840#define SPSR_M_EL1H 0x05 840#define SPSR_M_EL1H 0x05
841#define SPSR_M_EL1T 0x04 841#define SPSR_M_EL1T 0x04
842#define SPSR_M_EL0T 0x00 842#define SPSR_M_EL0T 0x00
843#define SPSR_M_SYS32 0x1f 843#define SPSR_M_SYS32 0x1f
844#define SPSR_M_UND32 0x1b 844#define SPSR_M_UND32 0x1b
845#define SPSR_M_ABT32 0x17 845#define SPSR_M_ABT32 0x17
846#define SPSR_M_SVC32 0x13 846#define SPSR_M_SVC32 0x13
847#define SPSR_M_IRQ32 0x12 847#define SPSR_M_IRQ32 0x12
848#define SPSR_M_FIQ32 0x11 848#define SPSR_M_FIQ32 0x11
849#define SPSR_M_USR32 0x10 849#define SPSR_M_USR32 0x10
850 850
851AARCH64REG_READ_INLINE(tcr_el1) // Translation Control Register 851AARCH64REG_READ_INLINE(tcr_el1) // Translation Control Register
852AARCH64REG_WRITE_INLINE(tcr_el1) 852AARCH64REG_WRITE_INLINE(tcr_el1)
853 853
854 854
855/* TCR_EL1 - Translation Control Register */ 855/* TCR_EL1 - Translation Control Register */
856#define TCR_TBI1 __BIT(38) /* ignore Top Byte TTBR1_EL1 */ 856#define TCR_TBI1 __BIT(38) /* ignore Top Byte TTBR1_EL1 */
857#define TCR_TBI0 __BIT(37) /* ignore Top Byte TTBR0_EL1 */ 857#define TCR_TBI0 __BIT(37) /* ignore Top Byte TTBR0_EL1 */
858#define TCR_AS64K __BIT(36) /* Use 64K ASIDs */ 858#define TCR_AS64K __BIT(36) /* Use 64K ASIDs */
859#define TCR_IPS __BITS(34,32) /* Intermediate PhysAdr Size */ 859#define TCR_IPS __BITS(34,32) /* Intermediate PhysAdr Size */
860#define TCR_IPS_4PB __SHIFTIN(6,TCR_IPS) /* 52 bits ( 4 PB) */ 860#define TCR_IPS_4PB __SHIFTIN(6,TCR_IPS) /* 52 bits ( 4 PB) */
861#define TCR_IPS_256TB __SHIFTIN(5,TCR_IPS) /* 48 bits (256 TB) */ 861#define TCR_IPS_256TB __SHIFTIN(5,TCR_IPS) /* 48 bits (256 TB) */
862#define TCR_IPS_16TB __SHIFTIN(4,TCR_IPS) /* 44 bits (16 TB) */ 862#define TCR_IPS_16TB __SHIFTIN(4,TCR_IPS) /* 44 bits (16 TB) */
863#define TCR_IPS_4TB __SHIFTIN(3,TCR_IPS) /* 42 bits ( 4 TB) */ 863#define TCR_IPS_4TB __SHIFTIN(3,TCR_IPS) /* 42 bits ( 4 TB) */
864#define TCR_IPS_1TB __SHIFTIN(2,TCR_IPS) /* 40 bits ( 1 TB) */ 864#define TCR_IPS_1TB __SHIFTIN(2,TCR_IPS) /* 40 bits ( 1 TB) */
865#define TCR_IPS_64GB __SHIFTIN(1,TCR_IPS) /* 36 bits (64 GB) */ 865#define TCR_IPS_64GB __SHIFTIN(1,TCR_IPS) /* 36 bits (64 GB) */
866#define TCR_IPS_4GB __SHIFTIN(0,TCR_IPS) /* 32 bits (4 GB) */ 866#define TCR_IPS_4GB __SHIFTIN(0,TCR_IPS) /* 32 bits (4 GB) */
867#define TCR_TG1 __BITS(31,30) /* TTBR1 Page Granule Size */ 867#define TCR_TG1 __BITS(31,30) /* TTBR1 Page Granule Size */
868#define TCR_TG1_16KB __SHIFTIN(1,TCR_TG1) /* 16KB page size */ 868#define TCR_TG1_16KB __SHIFTIN(1,TCR_TG1) /* 16KB page size */
869#define TCR_TG1_4KB __SHIFTIN(2,TCR_TG1) /* 4KB page size */ 869#define TCR_TG1_4KB __SHIFTIN(2,TCR_TG1) /* 4KB page size */
870#define TCR_TG1_64KB __SHIFTIN(3,TCR_TG1) /* 64KB page size */ 870#define TCR_TG1_64KB __SHIFTIN(3,TCR_TG1) /* 64KB page size */
871#define TCR_SH1 __BITS(29,28) 871#define TCR_SH1 __BITS(29,28)
872#define TCR_SH1_NONE __SHIFTIN(0,TCR_SH1) 872#define TCR_SH1_NONE __SHIFTIN(0,TCR_SH1)
873#define TCR_SH1_OUTER __SHIFTIN(2,TCR_SH1) 873#define TCR_SH1_OUTER __SHIFTIN(2,TCR_SH1)
874#define TCR_SH1_INNER __SHIFTIN(3,TCR_SH1) 874#define TCR_SH1_INNER __SHIFTIN(3,TCR_SH1)
875#define TCR_ORGN1 __BITS(27,26) /* TTBR1 Outer cacheability */ 875#define TCR_ORGN1 __BITS(27,26) /* TTBR1 Outer cacheability */
876#define TCR_ORGN1_NC __SHIFTIN(0,TCR_ORGN1) /* Non Cacheable */ 876#define TCR_ORGN1_NC __SHIFTIN(0,TCR_ORGN1) /* Non Cacheable */
877#define TCR_ORGN1_WB_WA __SHIFTIN(1,TCR_ORGN1) /* WriteBack WriteAllocate */ 877#define TCR_ORGN1_WB_WA __SHIFTIN(1,TCR_ORGN1) /* WriteBack WriteAllocate */
878#define TCR_ORGN1_WT __SHIFTIN(2,TCR_ORGN1) /* WriteThrough */ 878#define TCR_ORGN1_WT __SHIFTIN(2,TCR_ORGN1) /* WriteThrough */
879#define TCR_ORGN1_WB __SHIFTIN(3,TCR_ORGN1) /* WriteBack */ 879#define TCR_ORGN1_WB __SHIFTIN(3,TCR_ORGN1) /* WriteBack */
880#define TCR_IRGN1 __BITS(25,24) /* TTBR1 Inner cacheability */ 880#define TCR_IRGN1 __BITS(25,24) /* TTBR1 Inner cacheability */
881#define TCR_IRGN1_NC __SHIFTIN(0,TCR_IRGN1) /* Non Cacheable */ 881#define TCR_IRGN1_NC __SHIFTIN(0,TCR_IRGN1) /* Non Cacheable */
882#define TCR_IRGN1_WB_WA __SHIFTIN(1,TCR_IRGN1) /* WriteBack WriteAllocate */ 882#define TCR_IRGN1_WB_WA __SHIFTIN(1,TCR_IRGN1) /* WriteBack WriteAllocate */
883#define TCR_IRGN1_WT __SHIFTIN(2,TCR_IRGN1) /* WriteThrough */ 883#define TCR_IRGN1_WT __SHIFTIN(2,TCR_IRGN1) /* WriteThrough */
884#define TCR_IRGN1_WB __SHIFTIN(3,TCR_IRGN1) /* WriteBack */ 884#define TCR_IRGN1_WB __SHIFTIN(3,TCR_IRGN1) /* WriteBack */
885#define TCR_EPD1 __BIT(23) /* Walk Disable for TTBR1_EL1 */ 885#define TCR_EPD1 __BIT(23) /* Walk Disable for TTBR1_EL1 */
886#define TCR_A1 __BIT(22) /* ASID is in TTBR1_EL1 */ 886#define TCR_A1 __BIT(22) /* ASID is in TTBR1_EL1 */
887#define TCR_T1SZ __BITS(21,16) /* Size offset for TTBR1_EL1 */ 887#define TCR_T1SZ __BITS(21,16) /* Size offset for TTBR1_EL1 */
888#define TCR_TG0 __BITS(15,14) /* TTBR0 Page Granule Size */ 888#define TCR_TG0 __BITS(15,14) /* TTBR0 Page Granule Size */
889#define TCR_TG0_4KB __SHIFTIN(0,TCR_TG0) /* 4KB page size */ 889#define TCR_TG0_4KB __SHIFTIN(0,TCR_TG0) /* 4KB page size */
890#define TCR_TG0_64KB __SHIFTIN(1,TCR_TG0) /* 64KB page size */ 890#define TCR_TG0_64KB __SHIFTIN(1,TCR_TG0) /* 64KB page size */
891#define TCR_TG0_16KB __SHIFTIN(2,TCR_TG0) /* 16KB page size */ 891#define TCR_TG0_16KB __SHIFTIN(2,TCR_TG0) /* 16KB page size */
892#define TCR_SH0 __BITS(13,12) 892#define TCR_SH0 __BITS(13,12)
893#define TCR_SH0_NONE __SHIFTIN(0,TCR_SH0) 893#define TCR_SH0_NONE __SHIFTIN(0,TCR_SH0)
894#define TCR_SH0_OUTER __SHIFTIN(2,TCR_SH0) 894#define TCR_SH0_OUTER __SHIFTIN(2,TCR_SH0)
895#define TCR_SH0_INNER __SHIFTIN(3,TCR_SH0) 895#define TCR_SH0_INNER __SHIFTIN(3,TCR_SH0)
896#define TCR_ORGN0 __BITS(11,10) /* TTBR0 Outer cacheability */ 896#define TCR_ORGN0 __BITS(11,10) /* TTBR0 Outer cacheability */
897#define TCR_ORGN0_NC __SHIFTIN(0,TCR_ORGN0) /* Non Cacheable */ 897#define TCR_ORGN0_NC __SHIFTIN(0,TCR_ORGN0) /* Non Cacheable */
898#define TCR_ORGN0_WB_WA __SHIFTIN(1,TCR_ORGN0) /* WriteBack WriteAllocate */ 898#define TCR_ORGN0_WB_WA __SHIFTIN(1,TCR_ORGN0) /* WriteBack WriteAllocate */
899#define TCR_ORGN0_WT __SHIFTIN(2,TCR_ORGN0) /* WriteThrough */ 899#define TCR_ORGN0_WT __SHIFTIN(2,TCR_ORGN0) /* WriteThrough */
900#define TCR_ORGN0_WB __SHIFTIN(3,TCR_ORGN0) /* WriteBack */ 900#define TCR_ORGN0_WB __SHIFTIN(3,TCR_ORGN0) /* WriteBack */
901#define TCR_IRGN0 __BITS(9,8) /* TTBR0 Inner cacheability */ 901#define TCR_IRGN0 __BITS(9,8) /* TTBR0 Inner cacheability */
902#define TCR_IRGN0_NC __SHIFTIN(0,TCR_IRGN0) /* Non Cacheable */ 902#define TCR_IRGN0_NC __SHIFTIN(0,TCR_IRGN0) /* Non Cacheable */
903#define TCR_IRGN0_WB_WA __SHIFTIN(1,TCR_IRGN0) /* WriteBack WriteAllocate */ 903#define TCR_IRGN0_WB_WA __SHIFTIN(1,TCR_IRGN0) /* WriteBack WriteAllocate */
904#define TCR_IRGN0_WT __SHIFTIN(2,TCR_IRGN0) /* WriteThrough */ 904#define TCR_IRGN0_WT __SHIFTIN(2,TCR_IRGN0) /* WriteThrough */
905#define TCR_IRGN0_WB __SHIFTIN(3,TCR_IRGN0) /* WriteBack */ 905#define TCR_IRGN0_WB __SHIFTIN(3,TCR_IRGN0) /* WriteBack */
906#define TCR_EPD0 __BIT(7) /* Walk Disable for TTBR0 */ 906#define TCR_EPD0 __BIT(7) /* Walk Disable for TTBR0 */
907#define TCR_T0SZ __BITS(5,0) /* Size offset for TTBR0_EL1 */ 907#define TCR_T0SZ __BITS(5,0) /* Size offset for TTBR0_EL1 */
908 908
909AARCH64REG_READ_INLINE(tpidr_el1) // Thread ID Register (EL1) 909AARCH64REG_READ_INLINE(tpidr_el1) // Thread ID Register (EL1)
910AARCH64REG_WRITE_INLINE(tpidr_el1) 910AARCH64REG_WRITE_INLINE(tpidr_el1)
911 911
912AARCH64REG_WRITE_INLINE(tpidrro_el0) // Thread ID Register (RO for EL0) 912AARCH64REG_WRITE_INLINE(tpidrro_el0) // Thread ID Register (RO for EL0)
913 913
914AARCH64REG_READ_INLINE(ttbr0_el1) // Translation Table Base Register 0 EL1 914AARCH64REG_READ_INLINE(ttbr0_el1) // Translation Table Base Register 0 EL1
915AARCH64REG_WRITE_INLINE(ttbr0_el1) 915AARCH64REG_WRITE_INLINE(ttbr0_el1)
916 916
917AARCH64REG_READ_INLINE(ttbr1_el1) // Translation Table Base Register 1 EL1 917AARCH64REG_READ_INLINE(ttbr1_el1) // Translation Table Base Register 1 EL1
918AARCH64REG_WRITE_INLINE(ttbr1_el1) 918AARCH64REG_WRITE_INLINE(ttbr1_el1)
919 919
920#define TTBR_ASID __BITS(63,48) 920#define TTBR_ASID __BITS(63,48)
921#define TTBR_BADDR __BITS(47,0) 921#define TTBR_BADDR __BITS(47,0)
922 922
923AARCH64REG_READ_INLINE(vbar_el1) // Vector Base Address Register 923AARCH64REG_READ_INLINE(vbar_el1) // Vector Base Address Register
924AARCH64REG_WRITE_INLINE(vbar_el1) 924AARCH64REG_WRITE_INLINE(vbar_el1)
925 925
926/* 926/*
927 * From here on, these are DEBUG registers 927 * From here on, these are DEBUG registers
928 */ 928 */
929AARCH64REG_READ_INLINE(dbgbcr0_el1) // Debug Breakpoint Control Register 0 929AARCH64REG_READ_INLINE(dbgbcr0_el1) // Debug Breakpoint Control Register 0
930AARCH64REG_WRITE_INLINE(dbgbcr0_el1) 930AARCH64REG_WRITE_INLINE(dbgbcr0_el1)
931AARCH64REG_READ_INLINE(dbgbcr1_el1) // Debug Breakpoint Control Register 1 931AARCH64REG_READ_INLINE(dbgbcr1_el1) // Debug Breakpoint Control Register 1
932AARCH64REG_WRITE_INLINE(dbgbcr1_el1) 932AARCH64REG_WRITE_INLINE(dbgbcr1_el1)
933AARCH64REG_READ_INLINE(dbgbcr2_el1) // Debug Breakpoint Control Register 2 933AARCH64REG_READ_INLINE(dbgbcr2_el1) // Debug Breakpoint Control Register 2
934AARCH64REG_WRITE_INLINE(dbgbcr2_el1) 934AARCH64REG_WRITE_INLINE(dbgbcr2_el1)
935AARCH64REG_READ_INLINE(dbgbcr3_el1) // Debug Breakpoint Control Register 3 935AARCH64REG_READ_INLINE(dbgbcr3_el1) // Debug Breakpoint Control Register 3
936AARCH64REG_WRITE_INLINE(dbgbcr3_el1) 936AARCH64REG_WRITE_INLINE(dbgbcr3_el1)
937AARCH64REG_READ_INLINE(dbgbcr4_el1) // Debug Breakpoint Control Register 4 937AARCH64REG_READ_INLINE(dbgbcr4_el1) // Debug Breakpoint Control Register 4
938AARCH64REG_WRITE_INLINE(dbgbcr4_el1) 938AARCH64REG_WRITE_INLINE(dbgbcr4_el1)
939AARCH64REG_READ_INLINE(dbgbcr5_el1) // Debug Breakpoint Control Register 5 939AARCH64REG_READ_INLINE(dbgbcr5_el1) // Debug Breakpoint Control Register 5
940AARCH64REG_WRITE_INLINE(dbgbcr5_el1) 940AARCH64REG_WRITE_INLINE(dbgbcr5_el1)
941AARCH64REG_READ_INLINE(dbgbcr6_el1) // Debug Breakpoint Control Register 6 941AARCH64REG_READ_INLINE(dbgbcr6_el1) // Debug Breakpoint Control Register 6
942AARCH64REG_WRITE_INLINE(dbgbcr6_el1) 942AARCH64REG_WRITE_INLINE(dbgbcr6_el1)
943AARCH64REG_READ_INLINE(dbgbcr7_el1) // Debug Breakpoint Control Register 7 943AARCH64REG_READ_INLINE(dbgbcr7_el1) // Debug Breakpoint Control Register 7
944AARCH64REG_WRITE_INLINE(dbgbcr7_el1) 944AARCH64REG_WRITE_INLINE(dbgbcr7_el1)
945AARCH64REG_READ_INLINE(dbgbcr8_el1) // Debug Breakpoint Control Register 8 945AARCH64REG_READ_INLINE(dbgbcr8_el1) // Debug Breakpoint Control Register 8
946AARCH64REG_WRITE_INLINE(dbgbcr8_el1) 946AARCH64REG_WRITE_INLINE(dbgbcr8_el1)
947AARCH64REG_READ_INLINE(dbgbcr9_el1) // Debug Breakpoint Control Register 9 947AARCH64REG_READ_INLINE(dbgbcr9_el1) // Debug Breakpoint Control Register 9
948AARCH64REG_WRITE_INLINE(dbgbcr9_el1) 948AARCH64REG_WRITE_INLINE(dbgbcr9_el1)
949AARCH64REG_READ_INLINE(dbgbcr10_el1) // Debug Breakpoint Control Register 10 949AARCH64REG_READ_INLINE(dbgbcr10_el1) // Debug Breakpoint Control Register 10
950AARCH64REG_WRITE_INLINE(dbgbcr10_el1) 950AARCH64REG_WRITE_INLINE(dbgbcr10_el1)
951AARCH64REG_READ_INLINE(dbgbcr11_el1) // Debug Breakpoint Control Register 11 951AARCH64REG_READ_INLINE(dbgbcr11_el1) // Debug Breakpoint Control Register 11
952AARCH64REG_WRITE_INLINE(dbgbcr11_el1) 952AARCH64REG_WRITE_INLINE(dbgbcr11_el1)
953AARCH64REG_READ_INLINE(dbgbcr12_el1) // Debug Breakpoint Control Register 12 953AARCH64REG_READ_INLINE(dbgbcr12_el1) // Debug Breakpoint Control Register 12
954AARCH64REG_WRITE_INLINE(dbgbcr12_el1) 954AARCH64REG_WRITE_INLINE(dbgbcr12_el1)
955AARCH64REG_READ_INLINE(dbgbcr13_el1) // Debug Breakpoint Control Register 13 955AARCH64REG_READ_INLINE(dbgbcr13_el1) // Debug Breakpoint Control Register 13
956AARCH64REG_WRITE_INLINE(dbgbcr13_el1) 956AARCH64REG_WRITE_INLINE(dbgbcr13_el1)
957AARCH64REG_READ_INLINE(dbgbcr14_el1) // Debug Breakpoint Control Register 14 957AARCH64REG_READ_INLINE(dbgbcr14_el1) // Debug Breakpoint Control Register 14
958AARCH64REG_WRITE_INLINE(dbgbcr14_el1) 958AARCH64REG_WRITE_INLINE(dbgbcr14_el1)
959AARCH64REG_READ_INLINE(dbgbcr15_el1) // Debug Breakpoint Control Register 15 959AARCH64REG_READ_INLINE(dbgbcr15_el1) // Debug Breakpoint Control Register 15
960AARCH64REG_WRITE_INLINE(dbgbcr15_el1) 960AARCH64REG_WRITE_INLINE(dbgbcr15_el1)
961 961
962#define DBGBCR_BT __BITS(23,20) 962#define DBGBCR_BT __BITS(23,20)
963#define DBGBCR_LBN __BITS(19,16) 963#define DBGBCR_LBN __BITS(19,16)
964#define DBGBCR_SSC __BITS(15,14) 964#define DBGBCR_SSC __BITS(15,14)
965#define DBGBCR_HMC __BIT(13) 965#define DBGBCR_HMC __BIT(13)
966#define DBGBCR_BAS __BITS(8,5) 966#define DBGBCR_BAS __BITS(8,5)
967#define DBGBCR_PMC __BITS(2,1) 967#define DBGBCR_PMC __BITS(2,1)
968#define DBGBCR_E __BIT(0) 968#define DBGBCR_E __BIT(0)
969 969
970AARCH64REG_READ_INLINE(dbgbvr0_el1) // Debug Breakpoint Value Register 0 970AARCH64REG_READ_INLINE(dbgbvr0_el1) // Debug Breakpoint Value Register 0
971AARCH64REG_WRITE_INLINE(dbgbvr0_el1) 971AARCH64REG_WRITE_INLINE(dbgbvr0_el1)
972AARCH64REG_READ_INLINE(dbgbvr1_el1) // Debug Breakpoint Value Register 1 972AARCH64REG_READ_INLINE(dbgbvr1_el1) // Debug Breakpoint Value Register 1
973AARCH64REG_WRITE_INLINE(dbgbvr1_el1) 973AARCH64REG_WRITE_INLINE(dbgbvr1_el1)
974AARCH64REG_READ_INLINE(dbgbvr2_el1) // Debug Breakpoint Value Register 2 974AARCH64REG_READ_INLINE(dbgbvr2_el1) // Debug Breakpoint Value Register 2
975AARCH64REG_WRITE_INLINE(dbgbvr2_el1) 975AARCH64REG_WRITE_INLINE(dbgbvr2_el1)
976AARCH64REG_READ_INLINE(dbgbvr3_el1) // Debug Breakpoint Value Register 3 976AARCH64REG_READ_INLINE(dbgbvr3_el1) // Debug Breakpoint Value Register 3
977AARCH64REG_WRITE_INLINE(dbgbvr3_el1) 977AARCH64REG_WRITE_INLINE(dbgbvr3_el1)
978AARCH64REG_READ_INLINE(dbgbvr4_el1) // Debug Breakpoint Value Register 4 978AARCH64REG_READ_INLINE(dbgbvr4_el1) // Debug Breakpoint Value Register 4
979AARCH64REG_WRITE_INLINE(dbgbvr4_el1) 979AARCH64REG_WRITE_INLINE(dbgbvr4_el1)
980AARCH64REG_READ_INLINE(dbgbvr5_el1) // Debug Breakpoint Value Register 5 980AARCH64REG_READ_INLINE(dbgbvr5_el1) // Debug Breakpoint Value Register 5
981AARCH64REG_WRITE_INLINE(dbgbvr5_el1) 981AARCH64REG_WRITE_INLINE(dbgbvr5_el1)
982AARCH64REG_READ_INLINE(dbgbvr6_el1) // Debug Breakpoint Value Register 6 982AARCH64REG_READ_INLINE(dbgbvr6_el1) // Debug Breakpoint Value Register 6
983AARCH64REG_WRITE_INLINE(dbgbvr6_el1) 983AARCH64REG_WRITE_INLINE(dbgbvr6_el1)
984AARCH64REG_READ_INLINE(dbgbvr7_el1) // Debug Breakpoint Value Register 7 984AARCH64REG_READ_INLINE(dbgbvr7_el1) // Debug Breakpoint Value Register 7
985AARCH64REG_WRITE_INLINE(dbgbvr7_el1) 985AARCH64REG_WRITE_INLINE(dbgbvr7_el1)
986AARCH64REG_READ_INLINE(dbgbvr8_el1) // Debug Breakpoint Value Register 8 986AARCH64REG_READ_INLINE(dbgbvr8_el1) // Debug Breakpoint Value Register 8
987AARCH64REG_WRITE_INLINE(dbgbvr8_el1) 987AARCH64REG_WRITE_INLINE(dbgbvr8_el1)
988AARCH64REG_READ_INLINE(dbgbvr9_el1) // Debug Breakpoint Value Register 9 988AARCH64REG_READ_INLINE(dbgbvr9_el1) // Debug Breakpoint Value Register 9
989AARCH64REG_WRITE_INLINE(dbgbvr9_el1) 989AARCH64REG_WRITE_INLINE(dbgbvr9_el1)
990AARCH64REG_READ_INLINE(dbgbvr10_el1) // Debug Breakpoint Value Register 10 990AARCH64REG_READ_INLINE(dbgbvr10_el1) // Debug Breakpoint Value Register 10
991AARCH64REG_WRITE_INLINE(dbgbvr10_el1) 991AARCH64REG_WRITE_INLINE(dbgbvr10_el1)
992AARCH64REG_READ_INLINE(dbgbvr11_el1) // Debug Breakpoint Value Register 11 992AARCH64REG_READ_INLINE(dbgbvr11_el1) // Debug Breakpoint Value Register 11
993AARCH64REG_WRITE_INLINE(dbgbvr11_el1) 993AARCH64REG_WRITE_INLINE(dbgbvr11_el1)
994AARCH64REG_READ_INLINE(dbgbvr12_el1) // Debug Breakpoint Value Register 12 994AARCH64REG_READ_INLINE(dbgbvr12_el1) // Debug Breakpoint Value Register 12
995AARCH64REG_WRITE_INLINE(dbgbvr12_el1) 995AARCH64REG_WRITE_INLINE(dbgbvr12_el1)
996AARCH64REG_READ_INLINE(dbgbvr13_el1) // Debug Breakpoint Value Register 13 996AARCH64REG_READ_INLINE(dbgbvr13_el1) // Debug Breakpoint Value Register 13
997AARCH64REG_WRITE_INLINE(dbgbvr13_el1) 997AARCH64REG_WRITE_INLINE(dbgbvr13_el1)
998AARCH64REG_READ_INLINE(dbgbvr14_el1) // Debug Breakpoint Value Register 14 998AARCH64REG_READ_INLINE(dbgbvr14_el1) // Debug Breakpoint Value Register 14
999AARCH64REG_WRITE_INLINE(dbgbvr14_el1) 999AARCH64REG_WRITE_INLINE(dbgbvr14_el1)
1000AARCH64REG_READ_INLINE(dbgbvr15_el1) // Debug Breakpoint Value Register 15 1000AARCH64REG_READ_INLINE(dbgbvr15_el1) // Debug Breakpoint Value Register 15
1001AARCH64REG_WRITE_INLINE(dbgbvr15_el1) 1001AARCH64REG_WRITE_INLINE(dbgbvr15_el1)
1002 1002
1003AARCH64REG_READ_INLINE(dbgwcr0_el1) // Debug Watchpoint Control Register 0 1003AARCH64REG_READ_INLINE(dbgwcr0_el1) // Debug Watchpoint Control Register 0
1004AARCH64REG_WRITE_INLINE(dbgwcr0_el1) 1004AARCH64REG_WRITE_INLINE(dbgwcr0_el1)
1005AARCH64REG_READ_INLINE(dbgwcr1_el1) // Debug Watchpoint Control Register 1 1005AARCH64REG_READ_INLINE(dbgwcr1_el1) // Debug Watchpoint Control Register 1
1006AARCH64REG_WRITE_INLINE(dbgwcr1_el1) 1006AARCH64REG_WRITE_INLINE(dbgwcr1_el1)
1007AARCH64REG_READ_INLINE(dbgwcr2_el1) // Debug Watchpoint Control Register 2 1007AARCH64REG_READ_INLINE(dbgwcr2_el1) // Debug Watchpoint Control Register 2
1008AARCH64REG_WRITE_INLINE(dbgwcr2_el1) 1008AARCH64REG_WRITE_INLINE(dbgwcr2_el1)
1009AARCH64REG_READ_INLINE(dbgwcr3_el1) // Debug Watchpoint Control Register 3 1009AARCH64REG_READ_INLINE(dbgwcr3_el1) // Debug Watchpoint Control Register 3
1010AARCH64REG_WRITE_INLINE(dbgwcr3_el1) 1010AARCH64REG_WRITE_INLINE(dbgwcr3_el1)
1011AARCH64REG_READ_INLINE(dbgwcr4_el1) // Debug Watchpoint Control Register 4 1011AARCH64REG_READ_INLINE(dbgwcr4_el1) // Debug Watchpoint Control Register 4
1012AARCH64REG_WRITE_INLINE(dbgwcr4_el1) 1012AARCH64REG_WRITE_INLINE(dbgwcr4_el1)
1013AARCH64REG_READ_INLINE(dbgwcr5_el1) // Debug Watchpoint Control Register 5 1013AARCH64REG_READ_INLINE(dbgwcr5_el1) // Debug Watchpoint Control Register 5
1014AARCH64REG_WRITE_INLINE(dbgwcr5_el1) 1014AARCH64REG_WRITE_INLINE(dbgwcr5_el1)
1015AARCH64REG_READ_INLINE(dbgwcr6_el1) // Debug Watchpoint Control Register 6 1015AARCH64REG_READ_INLINE(dbgwcr6_el1) // Debug Watchpoint Control Register 6
1016AARCH64REG_WRITE_INLINE(dbgwcr6_el1) 1016AARCH64REG_WRITE_INLINE(dbgwcr6_el1)
1017AARCH64REG_READ_INLINE(dbgwcr7_el1) // Debug Watchpoint Control Register 7 1017AARCH64REG_READ_INLINE(dbgwcr7_el1) // Debug Watchpoint Control Register 7
1018AARCH64REG_WRITE_INLINE(dbgwcr7_el1) 1018AARCH64REG_WRITE_INLINE(dbgwcr7_el1)
1019AARCH64REG_READ_INLINE(dbgwcr8_el1) // Debug Watchpoint Control Register 8 1019AARCH64REG_READ_INLINE(dbgwcr8_el1) // Debug Watchpoint Control Register 8
1020AARCH64REG_WRITE_INLINE(dbgwcr8_el1) 1020AARCH64REG_WRITE_INLINE(dbgwcr8_el1)
1021AARCH64REG_READ_INLINE(dbgwcr9_el1) // Debug Watchpoint Control Register 9 1021AARCH64REG_READ_INLINE(dbgwcr9_el1) // Debug Watchpoint Control Register 9
1022AARCH64REG_WRITE_INLINE(dbgwcr9_el1) 1022AARCH64REG_WRITE_INLINE(dbgwcr9_el1)
1023AARCH64REG_READ_INLINE(dbgwcr10_el1) // Debug Watchpoint Control Register 10 1023AARCH64REG_READ_INLINE(dbgwcr10_el1) // Debug Watchpoint Control Register 10
1024AARCH64REG_WRITE_INLINE(dbgwcr10_el1) 1024AARCH64REG_WRITE_INLINE(dbgwcr10_el1)
1025AARCH64REG_READ_INLINE(dbgwcr11_el1) // Debug Watchpoint Control Register 11 1025AARCH64REG_READ_INLINE(dbgwcr11_el1) // Debug Watchpoint Control Register 11
1026AARCH64REG_WRITE_INLINE(dbgwcr11_el1) 1026AARCH64REG_WRITE_INLINE(dbgwcr11_el1)
1027AARCH64REG_READ_INLINE(dbgwcr12_el1) // Debug Watchpoint Control Register 12 1027AARCH64REG_READ_INLINE(dbgwcr12_el1) // Debug Watchpoint Control Register 12
1028AARCH64REG_WRITE_INLINE(dbgwcr12_el1) 1028AARCH64REG_WRITE_INLINE(dbgwcr12_el1)
1029AARCH64REG_READ_INLINE(dbgwcr13_el1) // Debug Watchpoint Control Register 13 1029AARCH64REG_READ_INLINE(dbgwcr13_el1) // Debug Watchpoint Control Register 13
1030AARCH64REG_WRITE_INLINE(dbgwcr13_el1) 1030AARCH64REG_WRITE_INLINE(dbgwcr13_el1)
1031AARCH64REG_READ_INLINE(dbgwcr14_el1) // Debug Watchpoint Control Register 14 1031AARCH64REG_READ_INLINE(dbgwcr14_el1) // Debug Watchpoint Control Register 14
1032AARCH64REG_WRITE_INLINE(dbgwcr14_el1) 1032AARCH64REG_WRITE_INLINE(dbgwcr14_el1)
1033AARCH64REG_READ_INLINE(dbgwcr15_el1) // Debug Watchpoint Control Register 15 1033AARCH64REG_READ_INLINE(dbgwcr15_el1) // Debug Watchpoint Control Register 15
1034AARCH64REG_WRITE_INLINE(dbgwcr15_el1) 1034AARCH64REG_WRITE_INLINE(dbgwcr15_el1)
1035 1035
1036#define DBGWCR_MASK __BITS(28,24) 1036#define DBGWCR_MASK __BITS(28,24)
1037#define DBGWCR_WT __BIT(20) 1037#define DBGWCR_WT __BIT(20)
1038#define DBGWCR_LBN __BITS(19,16) 1038#define DBGWCR_LBN __BITS(19,16)
1039#define DBGWCR_SSC __BITS(15,14) 1039#define DBGWCR_SSC __BITS(15,14)
1040#define DBGWCR_HMC __BIT(13) 1040#define DBGWCR_HMC __BIT(13)
1041#define DBGWCR_BAS __BITS(12,5) 1041#define DBGWCR_BAS __BITS(12,5)
1042#define DBGWCR_LSC __BITS(4,3) 1042#define DBGWCR_LSC __BITS(4,3)
1043#define DBGWCR_PAC __BITS(2,1) 1043#define DBGWCR_PAC __BITS(2,1)
1044#define DBGWCR_E __BIT(0) 1044#define DBGWCR_E __BIT(0)
1045 1045
1046AARCH64REG_READ_INLINE(dbgwvr0_el1) // Debug Watchpoint Value Register 0 1046AARCH64REG_READ_INLINE(dbgwvr0_el1) // Debug Watchpoint Value Register 0
1047AARCH64REG_WRITE_INLINE(dbgwvr0_el1) 1047AARCH64REG_WRITE_INLINE(dbgwvr0_el1)
1048AARCH64REG_READ_INLINE(dbgwvr1_el1) // Debug Watchpoint Value Register 1 1048AARCH64REG_READ_INLINE(dbgwvr1_el1) // Debug Watchpoint Value Register 1
1049AARCH64REG_WRITE_INLINE(dbgwvr1_el1) 1049AARCH64REG_WRITE_INLINE(dbgwvr1_el1)
1050AARCH64REG_READ_INLINE(dbgwvr2_el1) // Debug Watchpoint Value Register 2 1050AARCH64REG_READ_INLINE(dbgwvr2_el1) // Debug Watchpoint Value Register 2
1051AARCH64REG_WRITE_INLINE(dbgwvr2_el1) 1051AARCH64REG_WRITE_INLINE(dbgwvr2_el1)
1052AARCH64REG_READ_INLINE(dbgwvr3_el1) // Debug Watchpoint Value Register 3 1052AARCH64REG_READ_INLINE(dbgwvr3_el1) // Debug Watchpoint Value Register 3
1053AARCH64REG_WRITE_INLINE(dbgwvr3_el1) 1053AARCH64REG_WRITE_INLINE(dbgwvr3_el1)
1054AARCH64REG_READ_INLINE(dbgwvr4_el1) // Debug Watchpoint Value Register 4 1054AARCH64REG_READ_INLINE(dbgwvr4_el1) // Debug Watchpoint Value Register 4
1055AARCH64REG_WRITE_INLINE(dbgwvr4_el1) 1055AARCH64REG_WRITE_INLINE(dbgwvr4_el1)
1056AARCH64REG_READ_INLINE(dbgwvr5_el1) // Debug Watchpoint Value Register 5 1056AARCH64REG_READ_INLINE(dbgwvr5_el1) // Debug Watchpoint Value Register 5
1057AARCH64REG_WRITE_INLINE(dbgwvr5_el1) 1057AARCH64REG_WRITE_INLINE(dbgwvr5_el1)
1058AARCH64REG_READ_INLINE(dbgwvr6_el1) // Debug Watchpoint Value Register 6 1058AARCH64REG_READ_INLINE(dbgwvr6_el1) // Debug Watchpoint Value Register 6
1059AARCH64REG_WRITE_INLINE(dbgwvr6_el1) 1059AARCH64REG_WRITE_INLINE(dbgwvr6_el1)
1060AARCH64REG_READ_INLINE(dbgwvr7_el1) // Debug Watchpoint Value Register 7 1060AARCH64REG_READ_INLINE(dbgwvr7_el1) // Debug Watchpoint Value Register 7
1061AARCH64REG_WRITE_INLINE(dbgwvr7_el1) 1061AARCH64REG_WRITE_INLINE(dbgwvr7_el1)
1062AARCH64REG_READ_INLINE(dbgwvr8_el1) // Debug Watchpoint Value Register 8 1062AARCH64REG_READ_INLINE(dbgwvr8_el1) // Debug Watchpoint Value Register 8
1063AARCH64REG_WRITE_INLINE(dbgwvr8_el1) 1063AARCH64REG_WRITE_INLINE(dbgwvr8_el1)
1064AARCH64REG_READ_INLINE(dbgwvr9_el1) // Debug Watchpoint Value Register 9 1064AARCH64REG_READ_INLINE(dbgwvr9_el1) // Debug Watchpoint Value Register 9
1065AARCH64REG_WRITE_INLINE(dbgwvr9_el1) 1065AARCH64REG_WRITE_INLINE(dbgwvr9_el1)
1066AARCH64REG_READ_INLINE(dbgwvr10_el1) // Debug Watchpoint Value Register 10 1066AARCH64REG_READ_INLINE(dbgwvr10_el1) // Debug Watchpoint Value Register 10
1067AARCH64REG_WRITE_INLINE(dbgwvr10_el1) 1067AARCH64REG_WRITE_INLINE(dbgwvr10_el1)
1068AARCH64REG_READ_INLINE(dbgwvr11_el1) // Debug Watchpoint Value Register 11 1068AARCH64REG_READ_INLINE(dbgwvr11_el1) // Debug Watchpoint Value Register 11
1069AARCH64REG_WRITE_INLINE(dbgwvr11_el1) 1069AARCH64REG_WRITE_INLINE(dbgwvr11_el1)
1070AARCH64REG_READ_INLINE(dbgwvr12_el1) // Debug Watchpoint Value Register 12 1070AARCH64REG_READ_INLINE(dbgwvr12_el1) // Debug Watchpoint Value Register 12
1071AARCH64REG_WRITE_INLINE(dbgwvr12_el1) 1071AARCH64REG_WRITE_INLINE(dbgwvr12_el1)
1072AARCH64REG_READ_INLINE(dbgwvr13_el1) // Debug Watchpoint Value Register 13 1072AARCH64REG_READ_INLINE(dbgwvr13_el1) // Debug Watchpoint Value Register 13
1073AARCH64REG_WRITE_INLINE(dbgwvr13_el1) 1073AARCH64REG_WRITE_INLINE(dbgwvr13_el1)
1074AARCH64REG_READ_INLINE(dbgwvr14_el1) // Debug Watchpoint Value Register 14 1074AARCH64REG_READ_INLINE(dbgwvr14_el1) // Debug Watchpoint Value Register 14
1075AARCH64REG_WRITE_INLINE(dbgwvr14_el1) 1075AARCH64REG_WRITE_INLINE(dbgwvr14_el1)
1076AARCH64REG_READ_INLINE(dbgwvr15_el1) // Debug Watchpoint Value Register 15 1076AARCH64REG_READ_INLINE(dbgwvr15_el1) // Debug Watchpoint Value Register 15
1077AARCH64REG_WRITE_INLINE(dbgwvr15_el1) 1077AARCH64REG_WRITE_INLINE(dbgwvr15_el1)
1078 1078
1079#define DBGWVR_MASK __BITS(64,3) 1079#define DBGWVR_MASK __BITS(64,3)
1080 1080
1081 1081
1082AARCH64REG_READ_INLINE(mdscr_el1) // Monitor Debug System Control Register 1082AARCH64REG_READ_INLINE(mdscr_el1) // Monitor Debug System Control Register
1083AARCH64REG_WRITE_INLINE(mdscr_el1) 1083AARCH64REG_WRITE_INLINE(mdscr_el1)
1084 1084
1085#define MDSCR_RXFULL __BIT(30) // for EDSCR.RXfull 1085#define MDSCR_RXFULL __BIT(30) // for EDSCR.RXfull
1086#define MDSCR_TXFULL __BIT(29) // for EDSCR.TXfull 1086#define MDSCR_TXFULL __BIT(29) // for EDSCR.TXfull
1087#define MDSCR_RXO __BIT(27) // for EDSCR.RXO 1087#define MDSCR_RXO __BIT(27) // for EDSCR.RXO
1088#define MDSCR_TXU __BIT(26) // for EDSCR.TXU 1088#define MDSCR_TXU __BIT(26) // for EDSCR.TXU
1089#define MDSCR_INTDIS __BITS(32,22) // for EDSCR.INTdis 1089#define MDSCR_INTDIS __BITS(32,22) // for EDSCR.INTdis
1090#define MDSCR_TDA __BIT(21) // for EDSCR.TDA 1090#define MDSCR_TDA __BIT(21) // for EDSCR.TDA
1091#define MDSCR_MDE __BIT(15) // Monitor debug events 1091#define MDSCR_MDE __BIT(15) // Monitor debug events
1092#define MDSCR_HDE __BIT(14) // for EDSCR.HDE 1092#define MDSCR_HDE __BIT(14) // for EDSCR.HDE
1093#define MDSCR_KDE __BIT(13) // Local debug enable 1093#define MDSCR_KDE __BIT(13) // Local debug enable
1094#define MDSCR_TDCC __BIT(12) // Trap Debug CommCh access 1094#define MDSCR_TDCC __BIT(12) // Trap Debug CommCh access
1095#define MDSCR_ERR __BIT(6) // for EDSCR.ERR 1095#define MDSCR_ERR __BIT(6) // for EDSCR.ERR
1096#define MDSCR_SS __BIT(0) // Software step 1096#define MDSCR_SS __BIT(0) // Software step
1097 1097
1098AARCH64REG_WRITE_INLINE(oslar_el1) // OS Lock Access Register 1098AARCH64REG_WRITE_INLINE(oslar_el1) // OS Lock Access Register
1099 1099
1100AARCH64REG_READ_INLINE(oslsr_el1) // OS Lock Status Register 1100AARCH64REG_READ_INLINE(oslsr_el1) // OS Lock Status Register
1101 1101
1102/* 1102/*
1103 * From here on, these are PMC registers 1103 * From here on, these are PMC registers
1104 */ 1104 */
1105 1105
1106AARCH64REG_READ_INLINE(pmccfiltr_el0) 1106AARCH64REG_READ_INLINE(pmccfiltr_el0)
1107AARCH64REG_WRITE_INLINE(pmccfiltr_el0) 1107AARCH64REG_WRITE_INLINE(pmccfiltr_el0)
1108 1108
1109#define PMCCFILTR_P __BIT(31) // Don't count cycles in EL1 1109#define PMCCFILTR_P __BIT(31) // Don't count cycles in EL1
1110#define PMCCFILTR_U __BIT(30) // Don't count cycles in EL0 1110#define PMCCFILTR_U __BIT(30) // Don't count cycles in EL0
1111#define PMCCFILTR_NSK __BIT(29) // Don't count cycles in NS EL1 1111#define PMCCFILTR_NSK __BIT(29) // Don't count cycles in NS EL1
1112#define PMCCFILTR_NSU __BIT(28) // Don't count cycles in NS EL0 1112#define PMCCFILTR_NSU __BIT(28) // Don't count cycles in NS EL0
1113#define PMCCFILTR_NSH __BIT(27) // Don't count cycles in NS EL2 1113#define PMCCFILTR_NSH __BIT(27) // Don't count cycles in NS EL2
1114#define PMCCFILTR_M __BIT(26) // Don't count cycles in EL3 1114#define PMCCFILTR_M __BIT(26) // Don't count cycles in EL3
1115 1115
1116AARCH64REG_READ_INLINE(pmccntr_el0) 1116AARCH64REG_READ_INLINE(pmccntr_el0)
1117 1117
1118AARCH64REG_READ_INLINE(pmceid0_el0) 1118AARCH64REG_READ_INLINE(pmceid0_el0)
1119AARCH64REG_READ_INLINE(pmceid1_el0) 1119AARCH64REG_READ_INLINE(pmceid1_el0)
1120 1120
1121AARCH64REG_WRITE_INLINE(pmcntenclr_el0) 1121AARCH64REG_WRITE_INLINE(pmcntenclr_el0)
1122AARCH64REG_WRITE_INLINE(pmcntenset_el0) 1122AARCH64REG_WRITE_INLINE(pmcntenset_el0)
1123 1123
1124AARCH64REG_READ_INLINE(pmcr_el0) 1124AARCH64REG_READ_INLINE(pmcr_el0)
1125AARCH64REG_WRITE_INLINE(pmcr_el0) 1125AARCH64REG_WRITE_INLINE(pmcr_el0)
1126 1126
1127#define PMCR_IMP __BITS(31,24) // Implementor code 1127#define PMCR_IMP __BITS(31,24) // Implementor code
1128#define PMCR_IDCODE __BITS(23,16) // Identification code 1128#define PMCR_IDCODE __BITS(23,16) // Identification code
1129#define PMCR_N __BITS(15,11) // Number of event counters 1129#define PMCR_N __BITS(15,11) // Number of event counters
1130#define PMCR_LC __BIT(6) // Long cycle counter enable 1130#define PMCR_LC __BIT(6) // Long cycle counter enable
1131#define PMCR_DP __BIT(5) // Disable cycle counter when event 1131#define PMCR_DP __BIT(5) // Disable cycle counter when event
1132 // counting is prohibited 1132 // counting is prohibited
1133#define PMCR_X __BIT(4) // Enable export of events 1133#define PMCR_X __BIT(4) // Enable export of events
1134#define PMCR_D __BIT(3) // Clock divider 1134#define PMCR_D __BIT(3) // Clock divider
1135#define PMCR_C __BIT(2) // Cycle counter reset 1135#define PMCR_C __BIT(2) // Cycle counter reset
1136#define PMCR_P __BIT(1) // Event counter reset 1136#define PMCR_P __BIT(1) // Event counter reset
1137#define PMCR_E __BIT(0) // Enable 1137#define PMCR_E __BIT(0) // Enable
1138 1138
1139 1139
1140AARCH64REG_READ_INLINE(pmevcntr1_el0) 1140AARCH64REG_READ_INLINE(pmevcntr1_el0)
1141AARCH64REG_WRITE_INLINE(pmevcntr1_el0) 1141AARCH64REG_WRITE_INLINE(pmevcntr1_el0)
1142 1142
1143AARCH64REG_READ_INLINE(pmevtyper1_el0) 1143AARCH64REG_READ_INLINE(pmevtyper1_el0)
1144AARCH64REG_WRITE_INLINE(pmevtyper1_el0) 1144AARCH64REG_WRITE_INLINE(pmevtyper1_el0)
1145 1145
1146#define PMEVTYPER_P __BIT(31) // Don't count events in EL1 1146#define PMEVTYPER_P __BIT(31) // Don't count events in EL1
1147#define PMEVTYPER_U __BIT(30) // Don't count events in EL0 1147#define PMEVTYPER_U __BIT(30) // Don't count events in EL0
1148#define PMEVTYPER_NSK __BIT(29) // Don't count events in NS EL1 1148#define PMEVTYPER_NSK __BIT(29) // Don't count events in NS EL1
1149#define PMEVTYPER_NSU __BIT(28) // Don't count events in NS EL0 1149#define PMEVTYPER_NSU __BIT(28) // Don't count events in NS EL0
1150#define PMEVTYPER_NSH __BIT(27) // Count events in NS EL2 1150#define PMEVTYPER_NSH __BIT(27) // Count events in NS EL2
1151#define PMEVTYPER_M __BIT(26) // Don't count events in EL3 1151#define PMEVTYPER_M __BIT(26) // Don't count events in EL3
1152#define PMEVTYPER_MT __BIT(25) // Count events on all CPUs with same 1152#define PMEVTYPER_MT __BIT(25) // Count events on all CPUs with same
1153 // aff1 level 1153 // aff1 level
1154#define PMEVTYPER_EVTCOUNT __BITS(15,0) // Event to count 1154#define PMEVTYPER_EVTCOUNT __BITS(15,0) // Event to count
1155 1155
1156AARCH64REG_WRITE_INLINE(pmintenclr_el1) 1156AARCH64REG_WRITE_INLINE(pmintenclr_el1)
1157AARCH64REG_WRITE_INLINE(pmintenset_el1) 1157AARCH64REG_WRITE_INLINE(pmintenset_el1)
1158 1158
1159AARCH64REG_WRITE_INLINE(pmovsclr_el0) 1159AARCH64REG_WRITE_INLINE(pmovsclr_el0)
1160AARCH64REG_READ_INLINE(pmovsset_el0) 1160AARCH64REG_READ_INLINE(pmovsset_el0)
1161AARCH64REG_WRITE_INLINE(pmovsset_el0) 1161AARCH64REG_WRITE_INLINE(pmovsset_el0)
1162 1162
1163AARCH64REG_WRITE_INLINE(pmselr_el0) 1163AARCH64REG_WRITE_INLINE(pmselr_el0)
1164 1164
1165AARCH64REG_WRITE_INLINE(pmswinc_el0) 1165AARCH64REG_WRITE_INLINE(pmswinc_el0)
1166 1166
1167AARCH64REG_READ_INLINE(pmuserenr_el0) 1167AARCH64REG_READ_INLINE(pmuserenr_el0)
1168AARCH64REG_WRITE_INLINE(pmuserenr_el0) 1168AARCH64REG_WRITE_INLINE(pmuserenr_el0)
1169 1169
1170AARCH64REG_READ_INLINE(pmxevcntr_el0) 1170AARCH64REG_READ_INLINE(pmxevcntr_el0)
1171AARCH64REG_WRITE_INLINE(pmxevcntr_el0) 1171AARCH64REG_WRITE_INLINE(pmxevcntr_el0)
1172 1172
1173AARCH64REG_READ_INLINE(pmxevtyper_el0) 1173AARCH64REG_READ_INLINE(pmxevtyper_el0)
1174AARCH64REG_WRITE_INLINE(pmxevtyper_el0) 1174AARCH64REG_WRITE_INLINE(pmxevtyper_el0)
1175 1175
1176/* 1176/*
1177 * Generic timer registers 1177 * Generic timer registers
1178 */ 1178 */
1179 1179
1180AARCH64REG_READ_INLINE(cntfrq_el0) 1180AARCH64REG_READ_INLINE(cntfrq_el0)
1181 1181
1182AARCH64REG_READ_INLINE(cnthctl_el2) 1182AARCH64REG_READ_INLINE(cnthctl_el2)
1183AARCH64REG_WRITE_INLINE(cnthctl_el2) 1183AARCH64REG_WRITE_INLINE(cnthctl_el2)
1184 1184
1185#define CNTHCTL_EVNTDIR __BIT(3) 1185#define CNTHCTL_EVNTDIR __BIT(3)
1186#define CNTHCTL_EVNTEN __BIT(2) 1186#define CNTHCTL_EVNTEN __BIT(2)
1187#define CNTHCTL_EL1PCEN __BIT(1) 1187#define CNTHCTL_EL1PCEN __BIT(1)
1188#define CNTHCTL_EL1PCTEN __BIT(0) 1188#define CNTHCTL_EL1PCTEN __BIT(0)
1189 1189
1190AARCH64REG_READ_INLINE(cntkctl_el1) 1190AARCH64REG_READ_INLINE(cntkctl_el1)
1191AARCH64REG_WRITE_INLINE(cntkctl_el1) 1191AARCH64REG_WRITE_INLINE(cntkctl_el1)
1192 1192
1193#define CNTKCTL_EL0PTEN __BIT(9) // EL0 access for CNTP CVAL/TVAL/CTL 1193#define CNTKCTL_EL0PTEN __BIT(9) // EL0 access for CNTP CVAL/TVAL/CTL
1194#define CNTKCTL_PL0PTEN CNTKCTL_EL0PTEN 1194#define CNTKCTL_PL0PTEN CNTKCTL_EL0PTEN
1195#define CNTKCTL_EL0VTEN __BIT(8) // EL0 access for CNTV CVAL/TVAL/CTL 1195#define CNTKCTL_EL0VTEN __BIT(8) // EL0 access for CNTV CVAL/TVAL/CTL
1196#define CNTKCTL_PL0VTEN CNTKCTL_EL0VTEN 1196#define CNTKCTL_PL0VTEN CNTKCTL_EL0VTEN
1197#define CNTKCTL_ELNTI __BITS(7,4) 1197#define CNTKCTL_ELNTI __BITS(7,4)
1198#define CNTKCTL_EVNTDIR __BIT(3) 1198#define CNTKCTL_EVNTDIR __BIT(3)
1199#define CNTKCTL_EVNTEN __BIT(2) 1199#define CNTKCTL_EVNTEN __BIT(2)
1200#define CNTKCTL_EL0VCTEN __BIT(1) // EL0 access for CNTVCT and CNTFRQ 1200#define CNTKCTL_EL0VCTEN __BIT(1) // EL0 access for CNTVCT and CNTFRQ
1201#define CNTKCTL_PL0VCTEN CNTKCTL_EL0VCTEN 1201#define CNTKCTL_PL0VCTEN CNTKCTL_EL0VCTEN
1202#define CNTKCTL_EL0PCTEN __BIT(0) // EL0 access for CNTPCT and CNTFRQ 1202#define CNTKCTL_EL0PCTEN __BIT(0) // EL0 access for CNTPCT and CNTFRQ
1203#define CNTKCTL_PL0PCTEN CNTKCTL_EL0PCTEN 1203#define CNTKCTL_PL0PCTEN CNTKCTL_EL0PCTEN
1204 1204
1205AARCH64REG_READ_INLINE(cntp_ctl_el0) 1205AARCH64REG_READ_INLINE(cntp_ctl_el0)
1206AARCH64REG_WRITE_INLINE(cntp_ctl_el0) 1206AARCH64REG_WRITE_INLINE(cntp_ctl_el0)
1207AARCH64REG_READ_INLINE(cntp_cval_el0) 1207AARCH64REG_READ_INLINE(cntp_cval_el0)
1208AARCH64REG_WRITE_INLINE(cntp_cval_el0) 1208AARCH64REG_WRITE_INLINE(cntp_cval_el0)
1209AARCH64REG_READ_INLINE(cntp_tval_el0) 1209AARCH64REG_READ_INLINE(cntp_tval_el0)
1210AARCH64REG_WRITE_INLINE(cntp_tval_el0) 1210AARCH64REG_WRITE_INLINE(cntp_tval_el0)