1 //===-- AArch64BaseInfo.h - Top level definitions for AArch64- --*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains small standalone helper functions and enum definitions for
11 // the AArch64 target useful for the compiler back-end and the MC libraries.
12 // As such, it deliberately does not include references to LLVM core
13 // code gen types, passes, etc..
14 //
15 //===----------------------------------------------------------------------===//
16
17 /* Capstone Disassembly Engine */
18 /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
19
20 #ifndef CS_LLVM_AARCH64_BASEINFO_H
21 #define CS_LLVM_AARCH64_BASEINFO_H
22
23 #include <ctype.h>
24 #if !defined(_MSC_VER) || !defined(_KERNEL_MODE)
25 #include <stdint.h>
26 #endif
27 #include <string.h>
28
29 #ifndef __cplusplus
30 #if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
31 #define inline /* inline */
32 #endif
33 #endif
34
getWRegFromXReg(unsigned Reg)35 inline static unsigned getWRegFromXReg(unsigned Reg)
36 {
37 switch (Reg) {
38 case ARM64_REG_X0: return ARM64_REG_W0;
39 case ARM64_REG_X1: return ARM64_REG_W1;
40 case ARM64_REG_X2: return ARM64_REG_W2;
41 case ARM64_REG_X3: return ARM64_REG_W3;
42 case ARM64_REG_X4: return ARM64_REG_W4;
43 case ARM64_REG_X5: return ARM64_REG_W5;
44 case ARM64_REG_X6: return ARM64_REG_W6;
45 case ARM64_REG_X7: return ARM64_REG_W7;
46 case ARM64_REG_X8: return ARM64_REG_W8;
47 case ARM64_REG_X9: return ARM64_REG_W9;
48 case ARM64_REG_X10: return ARM64_REG_W10;
49 case ARM64_REG_X11: return ARM64_REG_W11;
50 case ARM64_REG_X12: return ARM64_REG_W12;
51 case ARM64_REG_X13: return ARM64_REG_W13;
52 case ARM64_REG_X14: return ARM64_REG_W14;
53 case ARM64_REG_X15: return ARM64_REG_W15;
54 case ARM64_REG_X16: return ARM64_REG_W16;
55 case ARM64_REG_X17: return ARM64_REG_W17;
56 case ARM64_REG_X18: return ARM64_REG_W18;
57 case ARM64_REG_X19: return ARM64_REG_W19;
58 case ARM64_REG_X20: return ARM64_REG_W20;
59 case ARM64_REG_X21: return ARM64_REG_W21;
60 case ARM64_REG_X22: return ARM64_REG_W22;
61 case ARM64_REG_X23: return ARM64_REG_W23;
62 case ARM64_REG_X24: return ARM64_REG_W24;
63 case ARM64_REG_X25: return ARM64_REG_W25;
64 case ARM64_REG_X26: return ARM64_REG_W26;
65 case ARM64_REG_X27: return ARM64_REG_W27;
66 case ARM64_REG_X28: return ARM64_REG_W28;
67 case ARM64_REG_FP: return ARM64_REG_W29;
68 case ARM64_REG_LR: return ARM64_REG_W30;
69 case ARM64_REG_SP: return ARM64_REG_WSP;
70 case ARM64_REG_XZR: return ARM64_REG_WZR;
71 }
72
73 // For anything else, return it unchanged.
74 return Reg;
75 }
76
77 // // Enums corresponding to AArch64 condition codes
78 // The CondCodes constants map directly to the 4-bit encoding of the
79 // condition field for predicated instructions.
80 typedef enum A64CC_CondCode { // Meaning (integer) Meaning (floating-point)
81 A64CC_EQ = 0, // Equal Equal
82 A64CC_NE, // Not equal Not equal, or unordered
83 A64CC_HS, // Unsigned higher or same >, ==, or unordered
84 A64CC_LO, // Unsigned lower or same Less than
85 A64CC_MI, // Minus, negative Less than
86 A64CC_PL, // Plus, positive or zero >, ==, or unordered
87 A64CC_VS, // Overflow Unordered
88 A64CC_VC, // No overflow Ordered
89 A64CC_HI, // Unsigned higher Greater than, or unordered
90 A64CC_LS, // Unsigned lower or same Less than or equal
91 A64CC_GE, // Greater than or equal Greater than or equal
92 A64CC_LT, // Less than Less than, or unordered
93 A64CC_GT, // Signed greater than Greater than
94 A64CC_LE, // Signed less than or equal <, ==, or unordered
95 A64CC_AL, // Always (unconditional) Always (unconditional)
96 A64CC_NV, // Always (unconditional) Always (unconditional)
97 // Note the NV exists purely to disassemble 0b1111. Execution is "always".
98 A64CC_Invalid
99 } A64CC_CondCode;
100
getCondCodeName(A64CC_CondCode CC)101 inline static char *getCondCodeName(A64CC_CondCode CC)
102 {
103 switch (CC) {
104 default: return NULL; // never reach
105 case A64CC_EQ: return "eq";
106 case A64CC_NE: return "ne";
107 case A64CC_HS: return "hs";
108 case A64CC_LO: return "lo";
109 case A64CC_MI: return "mi";
110 case A64CC_PL: return "pl";
111 case A64CC_VS: return "vs";
112 case A64CC_VC: return "vc";
113 case A64CC_HI: return "hi";
114 case A64CC_LS: return "ls";
115 case A64CC_GE: return "ge";
116 case A64CC_LT: return "lt";
117 case A64CC_GT: return "gt";
118 case A64CC_LE: return "le";
119 case A64CC_AL: return "al";
120 case A64CC_NV: return "nv";
121 }
122 }
123
getInvertedCondCode(A64CC_CondCode Code)124 inline static A64CC_CondCode getInvertedCondCode(A64CC_CondCode Code)
125 {
126 // To reverse a condition it's necessary to only invert the low bit:
127 return (A64CC_CondCode)((unsigned)Code ^ 0x1);
128 }
129
130 /// Instances of this class can perform bidirectional mapping from random
131 /// identifier strings to operand encodings. For example "MSR" takes a named
132 /// system-register which must be encoded somehow and decoded for printing. This
133 /// central location means that the information for those transformations is not
134 /// duplicated and remains in sync.
135 ///
136 /// FIXME: currently the algorithm is a completely unoptimised linear
137 /// search. Obviously this could be improved, but we would probably want to work
138 /// out just how often these instructions are emitted before working on it. It
139 /// might even be optimal to just reorder the tables for the common instructions
140 /// rather than changing the algorithm.
141 typedef struct A64NamedImmMapper_Mapping {
142 char *Name;
143 uint32_t Value;
144 } A64NamedImmMapper_Mapping;
145
146 typedef struct A64NamedImmMapper {
147 A64NamedImmMapper_Mapping *Pairs;
148 size_t NumPairs;
149 uint32_t TooBigImm;
150 } A64NamedImmMapper;
151
152 typedef struct A64SysRegMapper {
153 A64NamedImmMapper_Mapping *SysRegPairs;
154 A64NamedImmMapper_Mapping *InstPairs;
155 size_t NumInstPairs;
156 } A64SysRegMapper;
157
158 extern A64SysRegMapper AArch64_MSRMapper;
159 extern A64SysRegMapper AArch64_MRSMapper;
160
161 extern A64NamedImmMapper A64DB_DBarrierMapper;
162 extern A64NamedImmMapper A64AT_ATMapper;
163 extern A64NamedImmMapper A64DC_DCMapper;
164 extern A64NamedImmMapper A64IC_ICMapper;
165 extern A64NamedImmMapper A64ISB_ISBMapper;
166 extern A64NamedImmMapper A64PRFM_PRFMMapper;
167 extern A64NamedImmMapper A64PState_PStateMapper;
168 extern A64NamedImmMapper A64TLBI_TLBIMapper;
169
170 enum {
171 A64AT_Invalid = -1, // Op0 Op1 CRn CRm Op2
172 A64AT_S1E1R = 0x43c0, // 01 000 0111 1000 000
173 A64AT_S1E2R = 0x63c0, // 01 100 0111 1000 000
174 A64AT_S1E3R = 0x73c0, // 01 110 0111 1000 000
175 A64AT_S1E1W = 0x43c1, // 01 000 0111 1000 001
176 A64AT_S1E2W = 0x63c1, // 01 100 0111 1000 001
177 A64AT_S1E3W = 0x73c1, // 01 110 0111 1000 001
178 A64AT_S1E0R = 0x43c2, // 01 000 0111 1000 010
179 A64AT_S1E0W = 0x43c3, // 01 000 0111 1000 011
180 A64AT_S12E1R = 0x63c4, // 01 100 0111 1000 100
181 A64AT_S12E1W = 0x63c5, // 01 100 0111 1000 101
182 A64AT_S12E0R = 0x63c6, // 01 100 0111 1000 110
183 A64AT_S12E0W = 0x63c7 // 01 100 0111 1000 111
184 };
185
186 enum A64DBValues {
187 A64DB_Invalid = -1,
188 A64DB_OSHLD = 0x1,
189 A64DB_OSHST = 0x2,
190 A64DB_OSH = 0x3,
191 A64DB_NSHLD = 0x5,
192 A64DB_NSHST = 0x6,
193 A64DB_NSH = 0x7,
194 A64DB_ISHLD = 0x9,
195 A64DB_ISHST = 0xa,
196 A64DB_ISH = 0xb,
197 A64DB_LD = 0xd,
198 A64DB_ST = 0xe,
199 A64DB_SY = 0xf
200 };
201
202 enum A64DCValues {
203 A64DC_Invalid = -1, // Op1 CRn CRm Op2
204 A64DC_ZVA = 0x5ba1, // 01 011 0111 0100 001
205 A64DC_IVAC = 0x43b1, // 01 000 0111 0110 001
206 A64DC_ISW = 0x43b2, // 01 000 0111 0110 010
207 A64DC_CVAC = 0x5bd1, // 01 011 0111 1010 001
208 A64DC_CSW = 0x43d2, // 01 000 0111 1010 010
209 A64DC_CVAU = 0x5bd9, // 01 011 0111 1011 001
210 A64DC_CIVAC = 0x5bf1, // 01 011 0111 1110 001
211 A64DC_CISW = 0x43f2 // 01 000 0111 1110 010
212 };
213
214 enum A64ICValues {
215 A64IC_Invalid = -1, // Op1 CRn CRm Op2
216 A64IC_IALLUIS = 0x0388, // 000 0111 0001 000
217 A64IC_IALLU = 0x03a8, // 000 0111 0101 000
218 A64IC_IVAU = 0x1ba9 // 011 0111 0101 001
219 };
220
221 enum A64ISBValues {
222 A64ISB_Invalid = -1,
223 A64ISB_SY = 0xf
224 };
225
226 enum A64PRFMValues {
227 A64PRFM_Invalid = -1,
228 A64PRFM_PLDL1KEEP = 0x00,
229 A64PRFM_PLDL1STRM = 0x01,
230 A64PRFM_PLDL2KEEP = 0x02,
231 A64PRFM_PLDL2STRM = 0x03,
232 A64PRFM_PLDL3KEEP = 0x04,
233 A64PRFM_PLDL3STRM = 0x05,
234 A64PRFM_PLIL1KEEP = 0x08,
235 A64PRFM_PLIL1STRM = 0x09,
236 A64PRFM_PLIL2KEEP = 0x0a,
237 A64PRFM_PLIL2STRM = 0x0b,
238 A64PRFM_PLIL3KEEP = 0x0c,
239 A64PRFM_PLIL3STRM = 0x0d,
240 A64PRFM_PSTL1KEEP = 0x10,
241 A64PRFM_PSTL1STRM = 0x11,
242 A64PRFM_PSTL2KEEP = 0x12,
243 A64PRFM_PSTL2STRM = 0x13,
244 A64PRFM_PSTL3KEEP = 0x14,
245 A64PRFM_PSTL3STRM = 0x15
246 };
247
248 enum A64PStateValues {
249 A64PState_Invalid = -1,
250 A64PState_SPSel = 0x05,
251 A64PState_DAIFSet = 0x1e,
252 A64PState_DAIFClr = 0x1f,
253 A64PState_PAN = 0x4,
254 A64PState_UAO = 0x3
255 };
256
257 typedef enum A64SE_ShiftExtSpecifiers {
258 A64SE_Invalid = -1,
259 A64SE_LSL,
260 A64SE_MSL,
261 A64SE_LSR,
262 A64SE_ASR,
263 A64SE_ROR,
264
265 A64SE_UXTB,
266 A64SE_UXTH,
267 A64SE_UXTW,
268 A64SE_UXTX,
269
270 A64SE_SXTB,
271 A64SE_SXTH,
272 A64SE_SXTW,
273 A64SE_SXTX
274 } A64SE_ShiftExtSpecifiers;
275
276 typedef enum A64Layout_VectorLayout {
277 A64Layout_Invalid = -1,
278 A64Layout_VL_8B,
279 A64Layout_VL_4H,
280 A64Layout_VL_2S,
281 A64Layout_VL_1D,
282
283 A64Layout_VL_16B,
284 A64Layout_VL_8H,
285 A64Layout_VL_4S,
286 A64Layout_VL_2D,
287
288 // Bare layout for the 128-bit vector
289 // (only show ".b", ".h", ".s", ".d" without vector number)
290 A64Layout_VL_B,
291 A64Layout_VL_H,
292 A64Layout_VL_S,
293 A64Layout_VL_D
294 } A64Layout_VectorLayout;
295
A64VectorLayoutToString(A64Layout_VectorLayout Layout)296 inline static char *A64VectorLayoutToString(A64Layout_VectorLayout Layout)
297 {
298 switch (Layout) {
299 case A64Layout_VL_8B: return ".8b";
300 case A64Layout_VL_4H: return ".4h";
301 case A64Layout_VL_2S: return ".2s";
302 case A64Layout_VL_1D: return ".1d";
303 case A64Layout_VL_16B: return ".16b";
304 case A64Layout_VL_8H: return ".8h";
305 case A64Layout_VL_4S: return ".4s";
306 case A64Layout_VL_2D: return ".2d";
307 case A64Layout_VL_B: return ".b";
308 case A64Layout_VL_H: return ".h";
309 case A64Layout_VL_S: return ".s";
310 case A64Layout_VL_D: return ".d";
311 default: return NULL; // never reach
312 }
313 }
314
315 enum A64SysRegROValues {
316 A64SysReg_MDCCSR_EL0 = 0x9808, // 10 011 0000 0001 000
317 A64SysReg_DBGDTRRX_EL0 = 0x9828, // 10 011 0000 0101 000
318 A64SysReg_MDRAR_EL1 = 0x8080, // 10 000 0001 0000 000
319 A64SysReg_OSLSR_EL1 = 0x808c, // 10 000 0001 0001 100
320 A64SysReg_DBGAUTHSTATUS_EL1 = 0x83f6, // 10 000 0111 1110 110
321 A64SysReg_PMCEID0_EL0 = 0xdce6, // 11 011 1001 1100 110
322 A64SysReg_PMCEID1_EL0 = 0xdce7, // 11 011 1001 1100 111
323 A64SysReg_MIDR_EL1 = 0xc000, // 11 000 0000 0000 000
324 A64SysReg_CCSIDR_EL1 = 0xc800, // 11 001 0000 0000 000
325 A64SysReg_CLIDR_EL1 = 0xc801, // 11 001 0000 0000 001
326 A64SysReg_CTR_EL0 = 0xd801, // 11 011 0000 0000 001
327 A64SysReg_MPIDR_EL1 = 0xc005, // 11 000 0000 0000 101
328 A64SysReg_REVIDR_EL1 = 0xc006, // 11 000 0000 0000 110
329 A64SysReg_AIDR_EL1 = 0xc807, // 11 001 0000 0000 111
330 A64SysReg_DCZID_EL0 = 0xd807, // 11 011 0000 0000 111
331 A64SysReg_ID_PFR0_EL1 = 0xc008, // 11 000 0000 0001 000
332 A64SysReg_ID_PFR1_EL1 = 0xc009, // 11 000 0000 0001 001
333 A64SysReg_ID_DFR0_EL1 = 0xc00a, // 11 000 0000 0001 010
334 A64SysReg_ID_AFR0_EL1 = 0xc00b, // 11 000 0000 0001 011
335 A64SysReg_ID_MMFR0_EL1 = 0xc00c, // 11 000 0000 0001 100
336 A64SysReg_ID_MMFR1_EL1 = 0xc00d, // 11 000 0000 0001 101
337 A64SysReg_ID_MMFR2_EL1 = 0xc00e, // 11 000 0000 0001 110
338 A64SysReg_ID_MMFR3_EL1 = 0xc00f, // 11 000 0000 0001 111
339 A64SysReg_ID_MMFR4_EL1 = 0xc016, // 11 000 0000 0010 110
340 A64SysReg_ID_ISAR0_EL1 = 0xc010, // 11 000 0000 0010 000
341 A64SysReg_ID_ISAR1_EL1 = 0xc011, // 11 000 0000 0010 001
342 A64SysReg_ID_ISAR2_EL1 = 0xc012, // 11 000 0000 0010 010
343 A64SysReg_ID_ISAR3_EL1 = 0xc013, // 11 000 0000 0010 011
344 A64SysReg_ID_ISAR4_EL1 = 0xc014, // 11 000 0000 0010 100
345 A64SysReg_ID_ISAR5_EL1 = 0xc015, // 11 000 0000 0010 101
346 A64SysReg_ID_A64PFR0_EL1 = 0xc020, // 11 000 0000 0100 000
347 A64SysReg_ID_A64PFR1_EL1 = 0xc021, // 11 000 0000 0100 001
348 A64SysReg_ID_A64DFR0_EL1 = 0xc028, // 11 000 0000 0101 000
349 A64SysReg_ID_A64DFR1_EL1 = 0xc029, // 11 000 0000 0101 001
350 A64SysReg_ID_A64AFR0_EL1 = 0xc02c, // 11 000 0000 0101 100
351 A64SysReg_ID_A64AFR1_EL1 = 0xc02d, // 11 000 0000 0101 101
352 A64SysReg_ID_A64ISAR0_EL1 = 0xc030, // 11 000 0000 0110 000
353 A64SysReg_ID_A64ISAR1_EL1 = 0xc031, // 11 000 0000 0110 001
354 A64SysReg_ID_A64MMFR0_EL1 = 0xc038, // 11 000 0000 0111 000
355 A64SysReg_ID_A64MMFR1_EL1 = 0xc039, // 11 000 0000 0111 001
356 A64SysReg_ID_A64MMFR2_EL1 = 0xC03A, // 11 000 0000 0111 010
357 A64SysReg_LORC_EL1 = 0xc523, // 11 000 1010 0100 011
358 A64SysReg_LOREA_EL1 = 0xc521, // 11 000 1010 0100 001
359 A64SysReg_LORID_EL1 = 0xc527, // 11 000 1010 0100 111
360 A64SysReg_LORN_EL1 = 0xc522, // 11 000 1010 0100 010
361 A64SysReg_LORSA_EL1 = 0xc520, // 11 000 1010 0100 000
362 A64SysReg_MVFR0_EL1 = 0xc018, // 11 000 0000 0011 000
363 A64SysReg_MVFR1_EL1 = 0xc019, // 11 000 0000 0011 001
364 A64SysReg_MVFR2_EL1 = 0xc01a, // 11 000 0000 0011 010
365 A64SysReg_RVBAR_EL1 = 0xc601, // 11 000 1100 0000 001
366 A64SysReg_RVBAR_EL2 = 0xe601, // 11 100 1100 0000 001
367 A64SysReg_RVBAR_EL3 = 0xf601, // 11 110 1100 0000 001
368 A64SysReg_ISR_EL1 = 0xc608, // 11 000 1100 0001 000
369 A64SysReg_CNTPCT_EL0 = 0xdf01, // 11 011 1110 0000 001
370 A64SysReg_CNTVCT_EL0 = 0xdf02, // 11 011 1110 0000 010
371
372 // Trace registers
373 A64SysReg_TRCSTATR = 0x8818, // 10 001 0000 0011 000
374 A64SysReg_TRCIDR8 = 0x8806, // 10 001 0000 0000 110
375 A64SysReg_TRCIDR9 = 0x880e, // 10 001 0000 0001 110
376 A64SysReg_TRCIDR10 = 0x8816, // 10 001 0000 0010 110
377 A64SysReg_TRCIDR11 = 0x881e, // 10 001 0000 0011 110
378 A64SysReg_TRCIDR12 = 0x8826, // 10 001 0000 0100 110
379 A64SysReg_TRCIDR13 = 0x882e, // 10 001 0000 0101 110
380 A64SysReg_TRCIDR0 = 0x8847, // 10 001 0000 1000 111
381 A64SysReg_TRCIDR1 = 0x884f, // 10 001 0000 1001 111
382 A64SysReg_TRCIDR2 = 0x8857, // 10 001 0000 1010 111
383 A64SysReg_TRCIDR3 = 0x885f, // 10 001 0000 1011 111
384 A64SysReg_TRCIDR4 = 0x8867, // 10 001 0000 1100 111
385 A64SysReg_TRCIDR5 = 0x886f, // 10 001 0000 1101 111
386 A64SysReg_TRCIDR6 = 0x8877, // 10 001 0000 1110 111
387 A64SysReg_TRCIDR7 = 0x887f, // 10 001 0000 1111 111
388 A64SysReg_TRCOSLSR = 0x888c, // 10 001 0001 0001 100
389 A64SysReg_TRCPDSR = 0x88ac, // 10 001 0001 0101 100
390 A64SysReg_TRCDEVAFF0 = 0x8bd6, // 10 001 0111 1010 110
391 A64SysReg_TRCDEVAFF1 = 0x8bde, // 10 001 0111 1011 110
392 A64SysReg_TRCLSR = 0x8bee, // 10 001 0111 1101 110
393 A64SysReg_TRCAUTHSTATUS = 0x8bf6, // 10 001 0111 1110 110
394 A64SysReg_TRCDEVARCH = 0x8bfe, // 10 001 0111 1111 110
395 A64SysReg_TRCDEVID = 0x8b97, // 10 001 0111 0010 111
396 A64SysReg_TRCDEVTYPE = 0x8b9f, // 10 001 0111 0011 111
397 A64SysReg_TRCPIDR4 = 0x8ba7, // 10 001 0111 0100 111
398 A64SysReg_TRCPIDR5 = 0x8baf, // 10 001 0111 0101 111
399 A64SysReg_TRCPIDR6 = 0x8bb7, // 10 001 0111 0110 111
400 A64SysReg_TRCPIDR7 = 0x8bbf, // 10 001 0111 0111 111
401 A64SysReg_TRCPIDR0 = 0x8bc7, // 10 001 0111 1000 111
402 A64SysReg_TRCPIDR1 = 0x8bcf, // 10 001 0111 1001 111
403 A64SysReg_TRCPIDR2 = 0x8bd7, // 10 001 0111 1010 111
404 A64SysReg_TRCPIDR3 = 0x8bdf, // 10 001 0111 1011 111
405 A64SysReg_TRCCIDR0 = 0x8be7, // 10 001 0111 1100 111
406 A64SysReg_TRCCIDR1 = 0x8bef, // 10 001 0111 1101 111
407 A64SysReg_TRCCIDR2 = 0x8bf7, // 10 001 0111 1110 111
408 A64SysReg_TRCCIDR3 = 0x8bff, // 10 001 0111 1111 111
409
410 // GICv3 registers
411 A64SysReg_ICC_IAR1_EL1 = 0xc660, // 11 000 1100 1100 000
412 A64SysReg_ICC_IAR0_EL1 = 0xc640, // 11 000 1100 1000 000
413 A64SysReg_ICC_HPPIR1_EL1 = 0xc662, // 11 000 1100 1100 010
414 A64SysReg_ICC_HPPIR0_EL1 = 0xc642, // 11 000 1100 1000 010
415 A64SysReg_ICC_RPR_EL1 = 0xc65b, // 11 000 1100 1011 011
416 A64SysReg_ICH_VTR_EL2 = 0xe659, // 11 100 1100 1011 001
417 A64SysReg_ICH_EISR_EL2 = 0xe65b, // 11 100 1100 1011 011
418 A64SysReg_ICH_ELSR_EL2 = 0xe65d // 11 100 1100 1011 101
419 };
420
421 enum A64SysRegWOValues {
422 A64SysReg_DBGDTRTX_EL0 = 0x9828, // 10 011 0000 0101 000
423 A64SysReg_OSLAR_EL1 = 0x8084, // 10 000 0001 0000 100
424 A64SysReg_PMSWINC_EL0 = 0xdce4, // 11 011 1001 1100 100
425
426 // Trace Registers
427 A64SysReg_TRCOSLAR = 0x8884, // 10 001 0001 0000 100
428 A64SysReg_TRCLAR = 0x8be6, // 10 001 0111 1100 110
429
430 // GICv3 registers
431 A64SysReg_ICC_EOIR1_EL1 = 0xc661, // 11 000 1100 1100 001
432 A64SysReg_ICC_EOIR0_EL1 = 0xc641, // 11 000 1100 1000 001
433 A64SysReg_ICC_DIR_EL1 = 0xc659, // 11 000 1100 1011 001
434 A64SysReg_ICC_SGI1R_EL1 = 0xc65d, // 11 000 1100 1011 101
435 A64SysReg_ICC_ASGI1R_EL1 = 0xc65e, // 11 000 1100 1011 110
436 A64SysReg_ICC_SGI0R_EL1 = 0xc65f // 11 000 1100 1011 111
437 };
438
439 enum A64SysRegValues {
440 A64SysReg_Invalid = -1, // Op0 Op1 CRn CRm Op2
441 A64SysReg_PAN = 0xc213, // 11 000 0100 0010 011
442 A64SysReg_UAO = 0xc214, // 11 000 0100 0010 100
443 A64SysReg_OSDTRRX_EL1 = 0x8002, // 10 000 0000 0000 010
444 A64SysReg_OSDTRTX_EL1 = 0x801a, // 10 000 0000 0011 010
445 A64SysReg_TEECR32_EL1 = 0x9000, // 10 010 0000 0000 000
446 A64SysReg_MDCCINT_EL1 = 0x8010, // 10 000 0000 0010 000
447 A64SysReg_MDSCR_EL1 = 0x8012, // 10 000 0000 0010 010
448 A64SysReg_DBGDTR_EL0 = 0x9820, // 10 011 0000 0100 000
449 A64SysReg_OSECCR_EL1 = 0x8032, // 10 000 0000 0110 010
450 A64SysReg_DBGVCR32_EL2 = 0xa038, // 10 100 0000 0111 000
451 A64SysReg_DBGBVR0_EL1 = 0x8004, // 10 000 0000 0000 100
452 A64SysReg_DBGBVR1_EL1 = 0x800c, // 10 000 0000 0001 100
453 A64SysReg_DBGBVR2_EL1 = 0x8014, // 10 000 0000 0010 100
454 A64SysReg_DBGBVR3_EL1 = 0x801c, // 10 000 0000 0011 100
455 A64SysReg_DBGBVR4_EL1 = 0x8024, // 10 000 0000 0100 100
456 A64SysReg_DBGBVR5_EL1 = 0x802c, // 10 000 0000 0101 100
457 A64SysReg_DBGBVR6_EL1 = 0x8034, // 10 000 0000 0110 100
458 A64SysReg_DBGBVR7_EL1 = 0x803c, // 10 000 0000 0111 100
459 A64SysReg_DBGBVR8_EL1 = 0x8044, // 10 000 0000 1000 100
460 A64SysReg_DBGBVR9_EL1 = 0x804c, // 10 000 0000 1001 100
461 A64SysReg_DBGBVR10_EL1 = 0x8054, // 10 000 0000 1010 100
462 A64SysReg_DBGBVR11_EL1 = 0x805c, // 10 000 0000 1011 100
463 A64SysReg_DBGBVR12_EL1 = 0x8064, // 10 000 0000 1100 100
464 A64SysReg_DBGBVR13_EL1 = 0x806c, // 10 000 0000 1101 100
465 A64SysReg_DBGBVR14_EL1 = 0x8074, // 10 000 0000 1110 100
466 A64SysReg_DBGBVR15_EL1 = 0x807c, // 10 000 0000 1111 100
467 A64SysReg_DBGBCR0_EL1 = 0x8005, // 10 000 0000 0000 101
468 A64SysReg_DBGBCR1_EL1 = 0x800d, // 10 000 0000 0001 101
469 A64SysReg_DBGBCR2_EL1 = 0x8015, // 10 000 0000 0010 101
470 A64SysReg_DBGBCR3_EL1 = 0x801d, // 10 000 0000 0011 101
471 A64SysReg_DBGBCR4_EL1 = 0x8025, // 10 000 0000 0100 101
472 A64SysReg_DBGBCR5_EL1 = 0x802d, // 10 000 0000 0101 101
473 A64SysReg_DBGBCR6_EL1 = 0x8035, // 10 000 0000 0110 101
474 A64SysReg_DBGBCR7_EL1 = 0x803d, // 10 000 0000 0111 101
475 A64SysReg_DBGBCR8_EL1 = 0x8045, // 10 000 0000 1000 101
476 A64SysReg_DBGBCR9_EL1 = 0x804d, // 10 000 0000 1001 101
477 A64SysReg_DBGBCR10_EL1 = 0x8055, // 10 000 0000 1010 101
478 A64SysReg_DBGBCR11_EL1 = 0x805d, // 10 000 0000 1011 101
479 A64SysReg_DBGBCR12_EL1 = 0x8065, // 10 000 0000 1100 101
480 A64SysReg_DBGBCR13_EL1 = 0x806d, // 10 000 0000 1101 101
481 A64SysReg_DBGBCR14_EL1 = 0x8075, // 10 000 0000 1110 101
482 A64SysReg_DBGBCR15_EL1 = 0x807d, // 10 000 0000 1111 101
483 A64SysReg_DBGWVR0_EL1 = 0x8006, // 10 000 0000 0000 110
484 A64SysReg_DBGWVR1_EL1 = 0x800e, // 10 000 0000 0001 110
485 A64SysReg_DBGWVR2_EL1 = 0x8016, // 10 000 0000 0010 110
486 A64SysReg_DBGWVR3_EL1 = 0x801e, // 10 000 0000 0011 110
487 A64SysReg_DBGWVR4_EL1 = 0x8026, // 10 000 0000 0100 110
488 A64SysReg_DBGWVR5_EL1 = 0x802e, // 10 000 0000 0101 110
489 A64SysReg_DBGWVR6_EL1 = 0x8036, // 10 000 0000 0110 110
490 A64SysReg_DBGWVR7_EL1 = 0x803e, // 10 000 0000 0111 110
491 A64SysReg_DBGWVR8_EL1 = 0x8046, // 10 000 0000 1000 110
492 A64SysReg_DBGWVR9_EL1 = 0x804e, // 10 000 0000 1001 110
493 A64SysReg_DBGWVR10_EL1 = 0x8056, // 10 000 0000 1010 110
494 A64SysReg_DBGWVR11_EL1 = 0x805e, // 10 000 0000 1011 110
495 A64SysReg_DBGWVR12_EL1 = 0x8066, // 10 000 0000 1100 110
496 A64SysReg_DBGWVR13_EL1 = 0x806e, // 10 000 0000 1101 110
497 A64SysReg_DBGWVR14_EL1 = 0x8076, // 10 000 0000 1110 110
498 A64SysReg_DBGWVR15_EL1 = 0x807e, // 10 000 0000 1111 110
499 A64SysReg_DBGWCR0_EL1 = 0x8007, // 10 000 0000 0000 111
500 A64SysReg_DBGWCR1_EL1 = 0x800f, // 10 000 0000 0001 111
501 A64SysReg_DBGWCR2_EL1 = 0x8017, // 10 000 0000 0010 111
502 A64SysReg_DBGWCR3_EL1 = 0x801f, // 10 000 0000 0011 111
503 A64SysReg_DBGWCR4_EL1 = 0x8027, // 10 000 0000 0100 111
504 A64SysReg_DBGWCR5_EL1 = 0x802f, // 10 000 0000 0101 111
505 A64SysReg_DBGWCR6_EL1 = 0x8037, // 10 000 0000 0110 111
506 A64SysReg_DBGWCR7_EL1 = 0x803f, // 10 000 0000 0111 111
507 A64SysReg_DBGWCR8_EL1 = 0x8047, // 10 000 0000 1000 111
508 A64SysReg_DBGWCR9_EL1 = 0x804f, // 10 000 0000 1001 111
509 A64SysReg_DBGWCR10_EL1 = 0x8057, // 10 000 0000 1010 111
510 A64SysReg_DBGWCR11_EL1 = 0x805f, // 10 000 0000 1011 111
511 A64SysReg_DBGWCR12_EL1 = 0x8067, // 10 000 0000 1100 111
512 A64SysReg_DBGWCR13_EL1 = 0x806f, // 10 000 0000 1101 111
513 A64SysReg_DBGWCR14_EL1 = 0x8077, // 10 000 0000 1110 111
514 A64SysReg_DBGWCR15_EL1 = 0x807f, // 10 000 0000 1111 111
515 A64SysReg_TEEHBR32_EL1 = 0x9080, // 10 010 0001 0000 000
516 A64SysReg_OSDLR_EL1 = 0x809c, // 10 000 0001 0011 100
517 A64SysReg_DBGPRCR_EL1 = 0x80a4, // 10 000 0001 0100 100
518 A64SysReg_DBGCLAIMSET_EL1 = 0x83c6, // 10 000 0111 1000 110
519 A64SysReg_DBGCLAIMCLR_EL1 = 0x83ce, // 10 000 0111 1001 110
520 A64SysReg_CSSELR_EL1 = 0xd000, // 11 010 0000 0000 000
521 A64SysReg_VPIDR_EL2 = 0xe000, // 11 100 0000 0000 000
522 A64SysReg_VMPIDR_EL2 = 0xe005, // 11 100 0000 0000 101
523 A64SysReg_CPACR_EL1 = 0xc082, // 11 000 0001 0000 010
524 A64SysReg_CPACR_EL12 = 0xe882, // 11 101 0001 0000 010
525 A64SysReg_SCTLR_EL1 = 0xc080, // 11 000 0001 0000 000
526 A64SysReg_SCTLR_EL12 = 0xe880, // 11 101 0001 0000 000
527 A64SysReg_SCTLR_EL2 = 0xe080, // 11 100 0001 0000 000
528 A64SysReg_SCTLR_EL3 = 0xf080, // 11 110 0001 0000 000
529 A64SysReg_ACTLR_EL1 = 0xc081, // 11 000 0001 0000 001
530 A64SysReg_ACTLR_EL2 = 0xe081, // 11 100 0001 0000 001
531 A64SysReg_ACTLR_EL3 = 0xf081, // 11 110 0001 0000 001
532 A64SysReg_HCR_EL2 = 0xe088, // 11 100 0001 0001 000
533 A64SysReg_SCR_EL3 = 0xf088, // 11 110 0001 0001 000
534 A64SysReg_MDCR_EL2 = 0xe089, // 11 100 0001 0001 001
535 A64SysReg_SDER32_EL3 = 0xf089, // 11 110 0001 0001 001
536 A64SysReg_CPTR_EL2 = 0xe08a, // 11 100 0001 0001 010
537 A64SysReg_CPTR_EL3 = 0xf08a, // 11 110 0001 0001 010
538 A64SysReg_HSTR_EL2 = 0xe08b, // 11 100 0001 0001 011
539 A64SysReg_HACR_EL2 = 0xe08f, // 11 100 0001 0001 111
540 A64SysReg_MDCR_EL3 = 0xf099, // 11 110 0001 0011 001
541 A64SysReg_TTBR0_EL1 = 0xc100, // 11 000 0010 0000 000
542 A64SysReg_TTBR0_EL12 = 0xe900, // 11 101 0010 0000 000
543 A64SysReg_TTBR0_EL2 = 0xe100, // 11 100 0010 0000 000
544 A64SysReg_TTBR0_EL3 = 0xf100, // 11 110 0010 0000 000
545 A64SysReg_TTBR1_EL1 = 0xc101, // 11 000 0010 0000 001
546 A64SysReg_TTBR1_EL12 = 0xe901, // 11 101 0010 0000 001
547 A64SysReg_TTBR1_EL2 = 0xe101, // 11 100 0010 0000 001
548 A64SysReg_TCR_EL1 = 0xc102, // 11 000 0010 0000 010
549 A64SysReg_TCR_EL12 = 0xe902, // 11 101 0010 0000 010
550 A64SysReg_TCR_EL2 = 0xe102, // 11 100 0010 0000 010
551 A64SysReg_TCR_EL3 = 0xf102, // 11 110 0010 0000 010
552 A64SysReg_VTTBR_EL2 = 0xe108, // 11 100 0010 0001 000
553 A64SysReg_VTCR_EL2 = 0xe10a, // 11 100 0010 0001 010
554 A64SysReg_DACR32_EL2 = 0xe180, // 11 100 0011 0000 000
555 A64SysReg_SPSR_EL1 = 0xc200, // 11 000 0100 0000 000
556 A64SysReg_SPSR_EL12 = 0xea00, // 11 101 0100 0000 000
557 A64SysReg_SPSR_EL2 = 0xe200, // 11 100 0100 0000 000
558 A64SysReg_SPSR_EL3 = 0xf200, // 11 110 0100 0000 000
559 A64SysReg_ELR_EL1 = 0xc201, // 11 000 0100 0000 001
560 A64SysReg_ELR_EL12 = 0xea01, // 11 101 0100 0000 001
561 A64SysReg_ELR_EL2 = 0xe201, // 11 100 0100 0000 001
562 A64SysReg_ELR_EL3 = 0xf201, // 11 110 0100 0000 001
563 A64SysReg_SP_EL0 = 0xc208, // 11 000 0100 0001 000
564 A64SysReg_SP_EL1 = 0xe208, // 11 100 0100 0001 000
565 A64SysReg_SP_EL2 = 0xf208, // 11 110 0100 0001 000
566 A64SysReg_SPSel = 0xc210, // 11 000 0100 0010 000
567 A64SysReg_NZCV = 0xda10, // 11 011 0100 0010 000
568 A64SysReg_DAIF = 0xda11, // 11 011 0100 0010 001
569 A64SysReg_CurrentEL = 0xc212, // 11 000 0100 0010 010
570 A64SysReg_SPSR_irq = 0xe218, // 11 100 0100 0011 000
571 A64SysReg_SPSR_abt = 0xe219, // 11 100 0100 0011 001
572 A64SysReg_SPSR_und = 0xe21a, // 11 100 0100 0011 010
573 A64SysReg_SPSR_fiq = 0xe21b, // 11 100 0100 0011 011
574 A64SysReg_FPCR = 0xda20, // 11 011 0100 0100 000
575 A64SysReg_FPSR = 0xda21, // 11 011 0100 0100 001
576 A64SysReg_DSPSR_EL0 = 0xda28, // 11 011 0100 0101 000
577 A64SysReg_DLR_EL0 = 0xda29, // 11 011 0100 0101 001
578 A64SysReg_IFSR32_EL2 = 0xe281, // 11 100 0101 0000 001
579 A64SysReg_AFSR0_EL1 = 0xc288, // 11 000 0101 0001 000
580 A64SysReg_AFSR0_EL12 = 0xea88, // 11 101 0101 0001 000
581 A64SysReg_AFSR0_EL2 = 0xe288, // 11 100 0101 0001 000
582 A64SysReg_AFSR0_EL3 = 0xf288, // 11 110 0101 0001 000
583 A64SysReg_AFSR1_EL1 = 0xc289, // 11 000 0101 0001 001
584 A64SysReg_AFSR1_EL12 = 0xea89, // 11 101 0101 0001 001
585 A64SysReg_AFSR1_EL2 = 0xe289, // 11 100 0101 0001 001
586 A64SysReg_AFSR1_EL3 = 0xf289, // 11 110 0101 0001 001
587 A64SysReg_ESR_EL1 = 0xc290, // 11 000 0101 0010 000
588 A64SysReg_ESR_EL12 = 0xea90, // 11 101 0101 0010 000
589 A64SysReg_ESR_EL2 = 0xe290, // 11 100 0101 0010 000
590 A64SysReg_ESR_EL3 = 0xf290, // 11 110 0101 0010 000
591 A64SysReg_FPEXC32_EL2 = 0xe298, // 11 100 0101 0011 000
592 A64SysReg_FAR_EL1 = 0xc300, // 11 000 0110 0000 000
593 A64SysReg_FAR_EL12 = 0xeb00, // 11 101 0110 0000 000
594 A64SysReg_FAR_EL2 = 0xe300, // 11 100 0110 0000 000
595 A64SysReg_FAR_EL3 = 0xf300, // 11 110 0110 0000 000
596 A64SysReg_HPFAR_EL2 = 0xe304, // 11 100 0110 0000 100
597 A64SysReg_PAR_EL1 = 0xc3a0, // 11 000 0111 0100 000
598 A64SysReg_PMCR_EL0 = 0xdce0, // 11 011 1001 1100 000
599 A64SysReg_PMCNTENSET_EL0 = 0xdce1, // 11 011 1001 1100 001
600 A64SysReg_PMCNTENCLR_EL0 = 0xdce2, // 11 011 1001 1100 010
601 A64SysReg_PMOVSCLR_EL0 = 0xdce3, // 11 011 1001 1100 011
602 A64SysReg_PMSELR_EL0 = 0xdce5, // 11 011 1001 1100 101
603 A64SysReg_PMCCNTR_EL0 = 0xdce8, // 11 011 1001 1101 000
604 A64SysReg_PMXEVTYPER_EL0 = 0xdce9, // 11 011 1001 1101 001
605 A64SysReg_PMXEVCNTR_EL0 = 0xdcea, // 11 011 1001 1101 010
606 A64SysReg_PMUSERENR_EL0 = 0xdcf0, // 11 011 1001 1110 000
607 A64SysReg_PMINTENSET_EL1 = 0xc4f1, // 11 000 1001 1110 001
608 A64SysReg_PMINTENCLR_EL1 = 0xc4f2, // 11 000 1001 1110 010
609 A64SysReg_PMOVSSET_EL0 = 0xdcf3, // 11 011 1001 1110 011
610 A64SysReg_MAIR_EL1 = 0xc510, // 11 000 1010 0010 000
611 A64SysReg_MAIR_EL12 = 0xed10, // 11 101 1010 0010 000
612 A64SysReg_MAIR_EL2 = 0xe510, // 11 100 1010 0010 000
613 A64SysReg_MAIR_EL3 = 0xf510, // 11 110 1010 0010 000
614 A64SysReg_AMAIR_EL1 = 0xc518, // 11 000 1010 0011 000
615 A64SysReg_AMAIR_EL12 = 0xed18, // 11 101 1010 0011 000
616 A64SysReg_AMAIR_EL2 = 0xe518, // 11 100 1010 0011 000
617 A64SysReg_AMAIR_EL3 = 0xf518, // 11 110 1010 0011 000
618 A64SysReg_VBAR_EL1 = 0xc600, // 11 000 1100 0000 000
619 A64SysReg_VBAR_EL12 = 0xee00, // 11 101 1100 0000 000
620 A64SysReg_VBAR_EL2 = 0xe600, // 11 100 1100 0000 000
621 A64SysReg_VBAR_EL3 = 0xf600, // 11 110 1100 0000 000
622 A64SysReg_RMR_EL1 = 0xc602, // 11 000 1100 0000 010
623 A64SysReg_RMR_EL2 = 0xe602, // 11 100 1100 0000 010
624 A64SysReg_RMR_EL3 = 0xf602, // 11 110 1100 0000 010
625 A64SysReg_CONTEXTIDR_EL1 = 0xc681, // 11 000 1101 0000 001
626 A64SysReg_CONTEXTIDR_EL12 = 0xee81, // 11 101 1101 0000 001
627 A64SysReg_CONTEXTIDR_EL2 = 0xe681, // 11 100 1101 0000 001
628 A64SysReg_TPIDR_EL0 = 0xde82, // 11 011 1101 0000 010
629 A64SysReg_TPIDR_EL2 = 0xe682, // 11 100 1101 0000 010
630 A64SysReg_TPIDR_EL3 = 0xf682, // 11 110 1101 0000 010
631 A64SysReg_TPIDRRO_EL0 = 0xde83, // 11 011 1101 0000 011
632 A64SysReg_TPIDR_EL1 = 0xc684, // 11 000 1101 0000 100
633 A64SysReg_CNTFRQ_EL0 = 0xdf00, // 11 011 1110 0000 000
634 A64SysReg_CNTVOFF_EL2 = 0xe703, // 11 100 1110 0000 011
635 A64SysReg_CNTKCTL_EL1 = 0xc708, // 11 000 1110 0001 000
636 A64SysReg_CNTKCTL_EL12 = 0xef08, // 11 101 1110 0001 000
637 A64SysReg_CNTHCTL_EL2 = 0xe708, // 11 100 1110 0001 000
638 A64SysReg_CNTHVCTL_EL2 = 0xe719, // 11 100 1110 0011 001
639 A64SysReg_CNTHV_CVAL_EL2 = 0xe71a, // 11 100 1110 0011 010
640 A64SysReg_CNTHV_TVAL_EL2 = 0xe718, // 11 100 1110 0011 000
641 A64SysReg_CNTP_TVAL_EL0 = 0xdf10, // 11 011 1110 0010 000
642 A64SysReg_CNTP_TVAL_EL02 = 0xef10, // 11 101 1110 0010 000
643 A64SysReg_CNTHP_TVAL_EL2 = 0xe710, // 11 100 1110 0010 000
644 A64SysReg_CNTPS_TVAL_EL1 = 0xff10, // 11 111 1110 0010 000
645 A64SysReg_CNTP_CTL_EL0 = 0xdf11, // 11 011 1110 0010 001
646 A64SysReg_CNTHP_CTL_EL2 = 0xe711, // 11 100 1110 0010 001
647 A64SysReg_CNTPS_CTL_EL1 = 0xff11, // 11 111 1110 0010 001
648 A64SysReg_CNTP_CVAL_EL0 = 0xdf12, // 11 011 1110 0010 010
649 A64SysReg_CNTP_CVAL_EL02 = 0xef12, // 11 101 1110 0010 010
650 A64SysReg_CNTHP_CVAL_EL2 = 0xe712, // 11 100 1110 0010 010
651 A64SysReg_CNTPS_CVAL_EL1 = 0xff12, // 11 111 1110 0010 010
652 A64SysReg_CNTV_TVAL_EL0 = 0xdf18, // 11 011 1110 0011 000
653 A64SysReg_CNTV_TVAL_EL02 = 0xef18, // 11 101 1110 0011 000
654 A64SysReg_CNTV_CTL_EL0 = 0xdf19, // 11 011 1110 0011 001
655 A64SysReg_CNTV_CTL_EL02 = 0xef19, // 11 101 1110 0011 001
656 A64SysReg_CNTV_CVAL_EL0 = 0xdf1a, // 11 011 1110 0011 010
657 A64SysReg_CNTV_CVAL_EL02 = 0xef1a, // 11 101 1110 0011 010
658 A64SysReg_PMEVCNTR0_EL0 = 0xdf40, // 11 011 1110 1000 000
659 A64SysReg_PMEVCNTR1_EL0 = 0xdf41, // 11 011 1110 1000 001
660 A64SysReg_PMEVCNTR2_EL0 = 0xdf42, // 11 011 1110 1000 010
661 A64SysReg_PMEVCNTR3_EL0 = 0xdf43, // 11 011 1110 1000 011
662 A64SysReg_PMEVCNTR4_EL0 = 0xdf44, // 11 011 1110 1000 100
663 A64SysReg_PMEVCNTR5_EL0 = 0xdf45, // 11 011 1110 1000 101
664 A64SysReg_PMEVCNTR6_EL0 = 0xdf46, // 11 011 1110 1000 110
665 A64SysReg_PMEVCNTR7_EL0 = 0xdf47, // 11 011 1110 1000 111
666 A64SysReg_PMEVCNTR8_EL0 = 0xdf48, // 11 011 1110 1001 000
667 A64SysReg_PMEVCNTR9_EL0 = 0xdf49, // 11 011 1110 1001 001
668 A64SysReg_PMEVCNTR10_EL0 = 0xdf4a, // 11 011 1110 1001 010
669 A64SysReg_PMEVCNTR11_EL0 = 0xdf4b, // 11 011 1110 1001 011
670 A64SysReg_PMEVCNTR12_EL0 = 0xdf4c, // 11 011 1110 1001 100
671 A64SysReg_PMEVCNTR13_EL0 = 0xdf4d, // 11 011 1110 1001 101
672 A64SysReg_PMEVCNTR14_EL0 = 0xdf4e, // 11 011 1110 1001 110
673 A64SysReg_PMEVCNTR15_EL0 = 0xdf4f, // 11 011 1110 1001 111
674 A64SysReg_PMEVCNTR16_EL0 = 0xdf50, // 11 011 1110 1010 000
675 A64SysReg_PMEVCNTR17_EL0 = 0xdf51, // 11 011 1110 1010 001
676 A64SysReg_PMEVCNTR18_EL0 = 0xdf52, // 11 011 1110 1010 010
677 A64SysReg_PMEVCNTR19_EL0 = 0xdf53, // 11 011 1110 1010 011
678 A64SysReg_PMEVCNTR20_EL0 = 0xdf54, // 11 011 1110 1010 100
679 A64SysReg_PMEVCNTR21_EL0 = 0xdf55, // 11 011 1110 1010 101
680 A64SysReg_PMEVCNTR22_EL0 = 0xdf56, // 11 011 1110 1010 110
681 A64SysReg_PMEVCNTR23_EL0 = 0xdf57, // 11 011 1110 1010 111
682 A64SysReg_PMEVCNTR24_EL0 = 0xdf58, // 11 011 1110 1011 000
683 A64SysReg_PMEVCNTR25_EL0 = 0xdf59, // 11 011 1110 1011 001
684 A64SysReg_PMEVCNTR26_EL0 = 0xdf5a, // 11 011 1110 1011 010
685 A64SysReg_PMEVCNTR27_EL0 = 0xdf5b, // 11 011 1110 1011 011
686 A64SysReg_PMEVCNTR28_EL0 = 0xdf5c, // 11 011 1110 1011 100
687 A64SysReg_PMEVCNTR29_EL0 = 0xdf5d, // 11 011 1110 1011 101
688 A64SysReg_PMEVCNTR30_EL0 = 0xdf5e, // 11 011 1110 1011 110
689 A64SysReg_PMCCFILTR_EL0 = 0xdf7f, // 11 011 1110 1111 111
690 A64SysReg_PMEVTYPER0_EL0 = 0xdf60, // 11 011 1110 1100 000
691 A64SysReg_PMEVTYPER1_EL0 = 0xdf61, // 11 011 1110 1100 001
692 A64SysReg_PMEVTYPER2_EL0 = 0xdf62, // 11 011 1110 1100 010
693 A64SysReg_PMEVTYPER3_EL0 = 0xdf63, // 11 011 1110 1100 011
694 A64SysReg_PMEVTYPER4_EL0 = 0xdf64, // 11 011 1110 1100 100
695 A64SysReg_PMEVTYPER5_EL0 = 0xdf65, // 11 011 1110 1100 101
696 A64SysReg_PMEVTYPER6_EL0 = 0xdf66, // 11 011 1110 1100 110
697 A64SysReg_PMEVTYPER7_EL0 = 0xdf67, // 11 011 1110 1100 111
698 A64SysReg_PMEVTYPER8_EL0 = 0xdf68, // 11 011 1110 1101 000
699 A64SysReg_PMEVTYPER9_EL0 = 0xdf69, // 11 011 1110 1101 001
700 A64SysReg_PMEVTYPER10_EL0 = 0xdf6a, // 11 011 1110 1101 010
701 A64SysReg_PMEVTYPER11_EL0 = 0xdf6b, // 11 011 1110 1101 011
702 A64SysReg_PMEVTYPER12_EL0 = 0xdf6c, // 11 011 1110 1101 100
703 A64SysReg_PMEVTYPER13_EL0 = 0xdf6d, // 11 011 1110 1101 101
704 A64SysReg_PMEVTYPER14_EL0 = 0xdf6e, // 11 011 1110 1101 110
705 A64SysReg_PMEVTYPER15_EL0 = 0xdf6f, // 11 011 1110 1101 111
706 A64SysReg_PMEVTYPER16_EL0 = 0xdf70, // 11 011 1110 1110 000
707 A64SysReg_PMEVTYPER17_EL0 = 0xdf71, // 11 011 1110 1110 001
708 A64SysReg_PMEVTYPER18_EL0 = 0xdf72, // 11 011 1110 1110 010
709 A64SysReg_PMEVTYPER19_EL0 = 0xdf73, // 11 011 1110 1110 011
710 A64SysReg_PMEVTYPER20_EL0 = 0xdf74, // 11 011 1110 1110 100
711 A64SysReg_PMEVTYPER21_EL0 = 0xdf75, // 11 011 1110 1110 101
712 A64SysReg_PMEVTYPER22_EL0 = 0xdf76, // 11 011 1110 1110 110
713 A64SysReg_PMEVTYPER23_EL0 = 0xdf77, // 11 011 1110 1110 111
714 A64SysReg_PMEVTYPER24_EL0 = 0xdf78, // 11 011 1110 1111 000
715 A64SysReg_PMEVTYPER25_EL0 = 0xdf79, // 11 011 1110 1111 001
716 A64SysReg_PMEVTYPER26_EL0 = 0xdf7a, // 11 011 1110 1111 010
717 A64SysReg_PMEVTYPER27_EL0 = 0xdf7b, // 11 011 1110 1111 011
718 A64SysReg_PMEVTYPER28_EL0 = 0xdf7c, // 11 011 1110 1111 100
719 A64SysReg_PMEVTYPER29_EL0 = 0xdf7d, // 11 011 1110 1111 101
720 A64SysReg_PMEVTYPER30_EL0 = 0xdf7e, // 11 011 1110 1111 110
721
722 // Trace registers
723 A64SysReg_TRCPRGCTLR = 0x8808, // 10 001 0000 0001 000
724 A64SysReg_TRCPROCSELR = 0x8810, // 10 001 0000 0010 000
725 A64SysReg_TRCCONFIGR = 0x8820, // 10 001 0000 0100 000
726 A64SysReg_TRCAUXCTLR = 0x8830, // 10 001 0000 0110 000
727 A64SysReg_TRCEVENTCTL0R = 0x8840, // 10 001 0000 1000 000
728 A64SysReg_TRCEVENTCTL1R = 0x8848, // 10 001 0000 1001 000
729 A64SysReg_TRCSTALLCTLR = 0x8858, // 10 001 0000 1011 000
730 A64SysReg_TRCTSCTLR = 0x8860, // 10 001 0000 1100 000
731 A64SysReg_TRCSYNCPR = 0x8868, // 10 001 0000 1101 000
732 A64SysReg_TRCCCCTLR = 0x8870, // 10 001 0000 1110 000
733 A64SysReg_TRCBBCTLR = 0x8878, // 10 001 0000 1111 000
734 A64SysReg_TRCTRACEIDR = 0x8801, // 10 001 0000 0000 001
735 A64SysReg_TRCQCTLR = 0x8809, // 10 001 0000 0001 001
736 A64SysReg_TRCVICTLR = 0x8802, // 10 001 0000 0000 010
737 A64SysReg_TRCVIIECTLR = 0x880a, // 10 001 0000 0001 010
738 A64SysReg_TRCVISSCTLR = 0x8812, // 10 001 0000 0010 010
739 A64SysReg_TRCVIPCSSCTLR = 0x881a, // 10 001 0000 0011 010
740 A64SysReg_TRCVDCTLR = 0x8842, // 10 001 0000 1000 010
741 A64SysReg_TRCVDSACCTLR = 0x884a, // 10 001 0000 1001 010
742 A64SysReg_TRCVDARCCTLR = 0x8852, // 10 001 0000 1010 010
743 A64SysReg_TRCSEQEVR0 = 0x8804, // 10 001 0000 0000 100
744 A64SysReg_TRCSEQEVR1 = 0x880c, // 10 001 0000 0001 100
745 A64SysReg_TRCSEQEVR2 = 0x8814, // 10 001 0000 0010 100
746 A64SysReg_TRCSEQRSTEVR = 0x8834, // 10 001 0000 0110 100
747 A64SysReg_TRCSEQSTR = 0x883c, // 10 001 0000 0111 100
748 A64SysReg_TRCEXTINSELR = 0x8844, // 10 001 0000 1000 100
749 A64SysReg_TRCCNTRLDVR0 = 0x8805, // 10 001 0000 0000 101
750 A64SysReg_TRCCNTRLDVR1 = 0x880d, // 10 001 0000 0001 101
751 A64SysReg_TRCCNTRLDVR2 = 0x8815, // 10 001 0000 0010 101
752 A64SysReg_TRCCNTRLDVR3 = 0x881d, // 10 001 0000 0011 101
753 A64SysReg_TRCCNTCTLR0 = 0x8825, // 10 001 0000 0100 101
754 A64SysReg_TRCCNTCTLR1 = 0x882d, // 10 001 0000 0101 101
755 A64SysReg_TRCCNTCTLR2 = 0x8835, // 10 001 0000 0110 101
756 A64SysReg_TRCCNTCTLR3 = 0x883d, // 10 001 0000 0111 101
757 A64SysReg_TRCCNTVR0 = 0x8845, // 10 001 0000 1000 101
758 A64SysReg_TRCCNTVR1 = 0x884d, // 10 001 0000 1001 101
759 A64SysReg_TRCCNTVR2 = 0x8855, // 10 001 0000 1010 101
760 A64SysReg_TRCCNTVR3 = 0x885d, // 10 001 0000 1011 101
761 A64SysReg_TRCIMSPEC0 = 0x8807, // 10 001 0000 0000 111
762 A64SysReg_TRCIMSPEC1 = 0x880f, // 10 001 0000 0001 111
763 A64SysReg_TRCIMSPEC2 = 0x8817, // 10 001 0000 0010 111
764 A64SysReg_TRCIMSPEC3 = 0x881f, // 10 001 0000 0011 111
765 A64SysReg_TRCIMSPEC4 = 0x8827, // 10 001 0000 0100 111
766 A64SysReg_TRCIMSPEC5 = 0x882f, // 10 001 0000 0101 111
767 A64SysReg_TRCIMSPEC6 = 0x8837, // 10 001 0000 0110 111
768 A64SysReg_TRCIMSPEC7 = 0x883f, // 10 001 0000 0111 111
769 A64SysReg_TRCRSCTLR2 = 0x8890, // 10 001 0001 0010 000
770 A64SysReg_TRCRSCTLR3 = 0x8898, // 10 001 0001 0011 000
771 A64SysReg_TRCRSCTLR4 = 0x88a0, // 10 001 0001 0100 000
772 A64SysReg_TRCRSCTLR5 = 0x88a8, // 10 001 0001 0101 000
773 A64SysReg_TRCRSCTLR6 = 0x88b0, // 10 001 0001 0110 000
774 A64SysReg_TRCRSCTLR7 = 0x88b8, // 10 001 0001 0111 000
775 A64SysReg_TRCRSCTLR8 = 0x88c0, // 10 001 0001 1000 000
776 A64SysReg_TRCRSCTLR9 = 0x88c8, // 10 001 0001 1001 000
777 A64SysReg_TRCRSCTLR10 = 0x88d0, // 10 001 0001 1010 000
778 A64SysReg_TRCRSCTLR11 = 0x88d8, // 10 001 0001 1011 000
779 A64SysReg_TRCRSCTLR12 = 0x88e0, // 10 001 0001 1100 000
780 A64SysReg_TRCRSCTLR13 = 0x88e8, // 10 001 0001 1101 000
781 A64SysReg_TRCRSCTLR14 = 0x88f0, // 10 001 0001 1110 000
782 A64SysReg_TRCRSCTLR15 = 0x88f8, // 10 001 0001 1111 000
783 A64SysReg_TRCRSCTLR16 = 0x8881, // 10 001 0001 0000 001
784 A64SysReg_TRCRSCTLR17 = 0x8889, // 10 001 0001 0001 001
785 A64SysReg_TRCRSCTLR18 = 0x8891, // 10 001 0001 0010 001
786 A64SysReg_TRCRSCTLR19 = 0x8899, // 10 001 0001 0011 001
787 A64SysReg_TRCRSCTLR20 = 0x88a1, // 10 001 0001 0100 001
788 A64SysReg_TRCRSCTLR21 = 0x88a9, // 10 001 0001 0101 001
789 A64SysReg_TRCRSCTLR22 = 0x88b1, // 10 001 0001 0110 001
790 A64SysReg_TRCRSCTLR23 = 0x88b9, // 10 001 0001 0111 001
791 A64SysReg_TRCRSCTLR24 = 0x88c1, // 10 001 0001 1000 001
792 A64SysReg_TRCRSCTLR25 = 0x88c9, // 10 001 0001 1001 001
793 A64SysReg_TRCRSCTLR26 = 0x88d1, // 10 001 0001 1010 001
794 A64SysReg_TRCRSCTLR27 = 0x88d9, // 10 001 0001 1011 001
795 A64SysReg_TRCRSCTLR28 = 0x88e1, // 10 001 0001 1100 001
796 A64SysReg_TRCRSCTLR29 = 0x88e9, // 10 001 0001 1101 001
797 A64SysReg_TRCRSCTLR30 = 0x88f1, // 10 001 0001 1110 001
798 A64SysReg_TRCRSCTLR31 = 0x88f9, // 10 001 0001 1111 001
799 A64SysReg_TRCSSCCR0 = 0x8882, // 10 001 0001 0000 010
800 A64SysReg_TRCSSCCR1 = 0x888a, // 10 001 0001 0001 010
801 A64SysReg_TRCSSCCR2 = 0x8892, // 10 001 0001 0010 010
802 A64SysReg_TRCSSCCR3 = 0x889a, // 10 001 0001 0011 010
803 A64SysReg_TRCSSCCR4 = 0x88a2, // 10 001 0001 0100 010
804 A64SysReg_TRCSSCCR5 = 0x88aa, // 10 001 0001 0101 010
805 A64SysReg_TRCSSCCR6 = 0x88b2, // 10 001 0001 0110 010
806 A64SysReg_TRCSSCCR7 = 0x88ba, // 10 001 0001 0111 010
807 A64SysReg_TRCSSCSR0 = 0x88c2, // 10 001 0001 1000 010
808 A64SysReg_TRCSSCSR1 = 0x88ca, // 10 001 0001 1001 010
809 A64SysReg_TRCSSCSR2 = 0x88d2, // 10 001 0001 1010 010
810 A64SysReg_TRCSSCSR3 = 0x88da, // 10 001 0001 1011 010
811 A64SysReg_TRCSSCSR4 = 0x88e2, // 10 001 0001 1100 010
812 A64SysReg_TRCSSCSR5 = 0x88ea, // 10 001 0001 1101 010
813 A64SysReg_TRCSSCSR6 = 0x88f2, // 10 001 0001 1110 010
814 A64SysReg_TRCSSCSR7 = 0x88fa, // 10 001 0001 1111 010
815 A64SysReg_TRCSSPCICR0 = 0x8883, // 10 001 0001 0000 011
816 A64SysReg_TRCSSPCICR1 = 0x888b, // 10 001 0001 0001 011
817 A64SysReg_TRCSSPCICR2 = 0x8893, // 10 001 0001 0010 011
818 A64SysReg_TRCSSPCICR3 = 0x889b, // 10 001 0001 0011 011
819 A64SysReg_TRCSSPCICR4 = 0x88a3, // 10 001 0001 0100 011
820 A64SysReg_TRCSSPCICR5 = 0x88ab, // 10 001 0001 0101 011
821 A64SysReg_TRCSSPCICR6 = 0x88b3, // 10 001 0001 0110 011
822 A64SysReg_TRCSSPCICR7 = 0x88bb, // 10 001 0001 0111 011
823 A64SysReg_TRCPDCR = 0x88a4, // 10 001 0001 0100 100
824 A64SysReg_TRCACVR0 = 0x8900, // 10 001 0010 0000 000
825 A64SysReg_TRCACVR1 = 0x8910, // 10 001 0010 0010 000
826 A64SysReg_TRCACVR2 = 0x8920, // 10 001 0010 0100 000
827 A64SysReg_TRCACVR3 = 0x8930, // 10 001 0010 0110 000
828 A64SysReg_TRCACVR4 = 0x8940, // 10 001 0010 1000 000
829 A64SysReg_TRCACVR5 = 0x8950, // 10 001 0010 1010 000
830 A64SysReg_TRCACVR6 = 0x8960, // 10 001 0010 1100 000
831 A64SysReg_TRCACVR7 = 0x8970, // 10 001 0010 1110 000
832 A64SysReg_TRCACVR8 = 0x8901, // 10 001 0010 0000 001
833 A64SysReg_TRCACVR9 = 0x8911, // 10 001 0010 0010 001
834 A64SysReg_TRCACVR10 = 0x8921, // 10 001 0010 0100 001
835 A64SysReg_TRCACVR11 = 0x8931, // 10 001 0010 0110 001
836 A64SysReg_TRCACVR12 = 0x8941, // 10 001 0010 1000 001
837 A64SysReg_TRCACVR13 = 0x8951, // 10 001 0010 1010 001
838 A64SysReg_TRCACVR14 = 0x8961, // 10 001 0010 1100 001
839 A64SysReg_TRCACVR15 = 0x8971, // 10 001 0010 1110 001
840 A64SysReg_TRCACATR0 = 0x8902, // 10 001 0010 0000 010
841 A64SysReg_TRCACATR1 = 0x8912, // 10 001 0010 0010 010
842 A64SysReg_TRCACATR2 = 0x8922, // 10 001 0010 0100 010
843 A64SysReg_TRCACATR3 = 0x8932, // 10 001 0010 0110 010
844 A64SysReg_TRCACATR4 = 0x8942, // 10 001 0010 1000 010
845 A64SysReg_TRCACATR5 = 0x8952, // 10 001 0010 1010 010
846 A64SysReg_TRCACATR6 = 0x8962, // 10 001 0010 1100 010
847 A64SysReg_TRCACATR7 = 0x8972, // 10 001 0010 1110 010
848 A64SysReg_TRCACATR8 = 0x8903, // 10 001 0010 0000 011
849 A64SysReg_TRCACATR9 = 0x8913, // 10 001 0010 0010 011
850 A64SysReg_TRCACATR10 = 0x8923, // 10 001 0010 0100 011
851 A64SysReg_TRCACATR11 = 0x8933, // 10 001 0010 0110 011
852 A64SysReg_TRCACATR12 = 0x8943, // 10 001 0010 1000 011
853 A64SysReg_TRCACATR13 = 0x8953, // 10 001 0010 1010 011
854 A64SysReg_TRCACATR14 = 0x8963, // 10 001 0010 1100 011
855 A64SysReg_TRCACATR15 = 0x8973, // 10 001 0010 1110 011
856 A64SysReg_TRCDVCVR0 = 0x8904, // 10 001 0010 0000 100
857 A64SysReg_TRCDVCVR1 = 0x8924, // 10 001 0010 0100 100
858 A64SysReg_TRCDVCVR2 = 0x8944, // 10 001 0010 1000 100
859 A64SysReg_TRCDVCVR3 = 0x8964, // 10 001 0010 1100 100
860 A64SysReg_TRCDVCVR4 = 0x8905, // 10 001 0010 0000 101
861 A64SysReg_TRCDVCVR5 = 0x8925, // 10 001 0010 0100 101
862 A64SysReg_TRCDVCVR6 = 0x8945, // 10 001 0010 1000 101
863 A64SysReg_TRCDVCVR7 = 0x8965, // 10 001 0010 1100 101
864 A64SysReg_TRCDVCMR0 = 0x8906, // 10 001 0010 0000 110
865 A64SysReg_TRCDVCMR1 = 0x8926, // 10 001 0010 0100 110
866 A64SysReg_TRCDVCMR2 = 0x8946, // 10 001 0010 1000 110
867 A64SysReg_TRCDVCMR3 = 0x8966, // 10 001 0010 1100 110
868 A64SysReg_TRCDVCMR4 = 0x8907, // 10 001 0010 0000 111
869 A64SysReg_TRCDVCMR5 = 0x8927, // 10 001 0010 0100 111
870 A64SysReg_TRCDVCMR6 = 0x8947, // 10 001 0010 1000 111
871 A64SysReg_TRCDVCMR7 = 0x8967, // 10 001 0010 1100 111
872 A64SysReg_TRCCIDCVR0 = 0x8980, // 10 001 0011 0000 000
873 A64SysReg_TRCCIDCVR1 = 0x8990, // 10 001 0011 0010 000
874 A64SysReg_TRCCIDCVR2 = 0x89a0, // 10 001 0011 0100 000
875 A64SysReg_TRCCIDCVR3 = 0x89b0, // 10 001 0011 0110 000
876 A64SysReg_TRCCIDCVR4 = 0x89c0, // 10 001 0011 1000 000
877 A64SysReg_TRCCIDCVR5 = 0x89d0, // 10 001 0011 1010 000
878 A64SysReg_TRCCIDCVR6 = 0x89e0, // 10 001 0011 1100 000
879 A64SysReg_TRCCIDCVR7 = 0x89f0, // 10 001 0011 1110 000
880 A64SysReg_TRCVMIDCVR0 = 0x8981, // 10 001 0011 0000 001
881 A64SysReg_TRCVMIDCVR1 = 0x8991, // 10 001 0011 0010 001
882 A64SysReg_TRCVMIDCVR2 = 0x89a1, // 10 001 0011 0100 001
883 A64SysReg_TRCVMIDCVR3 = 0x89b1, // 10 001 0011 0110 001
884 A64SysReg_TRCVMIDCVR4 = 0x89c1, // 10 001 0011 1000 001
885 A64SysReg_TRCVMIDCVR5 = 0x89d1, // 10 001 0011 1010 001
886 A64SysReg_TRCVMIDCVR6 = 0x89e1, // 10 001 0011 1100 001
887 A64SysReg_TRCVMIDCVR7 = 0x89f1, // 10 001 0011 1110 001
888 A64SysReg_TRCCIDCCTLR0 = 0x8982, // 10 001 0011 0000 010
889 A64SysReg_TRCCIDCCTLR1 = 0x898a, // 10 001 0011 0001 010
890 A64SysReg_TRCVMIDCCTLR0 = 0x8992, // 10 001 0011 0010 010
891 A64SysReg_TRCVMIDCCTLR1 = 0x899a, // 10 001 0011 0011 010
892 A64SysReg_TRCITCTRL = 0x8b84, // 10 001 0111 0000 100
893 A64SysReg_TRCCLAIMSET = 0x8bc6, // 10 001 0111 1000 110
894 A64SysReg_TRCCLAIMCLR = 0x8bce, // 10 001 0111 1001 110
895
896 // GICv3 registers
897 A64SysReg_ICC_BPR1_EL1 = 0xc663, // 11 000 1100 1100 011
898 A64SysReg_ICC_BPR0_EL1 = 0xc643, // 11 000 1100 1000 011
899 A64SysReg_ICC_PMR_EL1 = 0xc230, // 11 000 0100 0110 000
900 A64SysReg_ICC_CTLR_EL1 = 0xc664, // 11 000 1100 1100 100
901 A64SysReg_ICC_CTLR_EL3 = 0xf664, // 11 110 1100 1100 100
902 A64SysReg_ICC_SRE_EL1 = 0xc665, // 11 000 1100 1100 101
903 A64SysReg_ICC_SRE_EL2 = 0xe64d, // 11 100 1100 1001 101
904 A64SysReg_ICC_SRE_EL3 = 0xf665, // 11 110 1100 1100 101
905 A64SysReg_ICC_IGRPEN0_EL1 = 0xc666, // 11 000 1100 1100 110
906 A64SysReg_ICC_IGRPEN1_EL1 = 0xc667, // 11 000 1100 1100 111
907 A64SysReg_ICC_IGRPEN1_EL3 = 0xf667, // 11 110 1100 1100 111
908 A64SysReg_ICC_SEIEN_EL1 = 0xc668, // 11 000 1100 1101 000
909 A64SysReg_ICC_AP0R0_EL1 = 0xc644, // 11 000 1100 1000 100
910 A64SysReg_ICC_AP0R1_EL1 = 0xc645, // 11 000 1100 1000 101
911 A64SysReg_ICC_AP0R2_EL1 = 0xc646, // 11 000 1100 1000 110
912 A64SysReg_ICC_AP0R3_EL1 = 0xc647, // 11 000 1100 1000 111
913 A64SysReg_ICC_AP1R0_EL1 = 0xc648, // 11 000 1100 1001 000
914 A64SysReg_ICC_AP1R1_EL1 = 0xc649, // 11 000 1100 1001 001
915 A64SysReg_ICC_AP1R2_EL1 = 0xc64a, // 11 000 1100 1001 010
916 A64SysReg_ICC_AP1R3_EL1 = 0xc64b, // 11 000 1100 1001 011
917 A64SysReg_ICH_AP0R0_EL2 = 0xe640, // 11 100 1100 1000 000
918 A64SysReg_ICH_AP0R1_EL2 = 0xe641, // 11 100 1100 1000 001
919 A64SysReg_ICH_AP0R2_EL2 = 0xe642, // 11 100 1100 1000 010
920 A64SysReg_ICH_AP0R3_EL2 = 0xe643, // 11 100 1100 1000 011
921 A64SysReg_ICH_AP1R0_EL2 = 0xe648, // 11 100 1100 1001 000
922 A64SysReg_ICH_AP1R1_EL2 = 0xe649, // 11 100 1100 1001 001
923 A64SysReg_ICH_AP1R2_EL2 = 0xe64a, // 11 100 1100 1001 010
924 A64SysReg_ICH_AP1R3_EL2 = 0xe64b, // 11 100 1100 1001 011
925 A64SysReg_ICH_HCR_EL2 = 0xe658, // 11 100 1100 1011 000
926 A64SysReg_ICH_MISR_EL2 = 0xe65a, // 11 100 1100 1011 010
927 A64SysReg_ICH_VMCR_EL2 = 0xe65f, // 11 100 1100 1011 111
928 A64SysReg_ICH_VSEIR_EL2 = 0xe64c, // 11 100 1100 1001 100
929 A64SysReg_ICH_LR0_EL2 = 0xe660, // 11 100 1100 1100 000
930 A64SysReg_ICH_LR1_EL2 = 0xe661, // 11 100 1100 1100 001
931 A64SysReg_ICH_LR2_EL2 = 0xe662, // 11 100 1100 1100 010
932 A64SysReg_ICH_LR3_EL2 = 0xe663, // 11 100 1100 1100 011
933 A64SysReg_ICH_LR4_EL2 = 0xe664, // 11 100 1100 1100 100
934 A64SysReg_ICH_LR5_EL2 = 0xe665, // 11 100 1100 1100 101
935 A64SysReg_ICH_LR6_EL2 = 0xe666, // 11 100 1100 1100 110
936 A64SysReg_ICH_LR7_EL2 = 0xe667, // 11 100 1100 1100 111
937 A64SysReg_ICH_LR8_EL2 = 0xe668, // 11 100 1100 1101 000
938 A64SysReg_ICH_LR9_EL2 = 0xe669, // 11 100 1100 1101 001
939 A64SysReg_ICH_LR10_EL2 = 0xe66a, // 11 100 1100 1101 010
940 A64SysReg_ICH_LR11_EL2 = 0xe66b, // 11 100 1100 1101 011
941 A64SysReg_ICH_LR12_EL2 = 0xe66c, // 11 100 1100 1101 100
942 A64SysReg_ICH_LR13_EL2 = 0xe66d, // 11 100 1100 1101 101
943 A64SysReg_ICH_LR14_EL2 = 0xe66e, // 11 100 1100 1101 110
944 A64SysReg_ICH_LR15_EL2 = 0xe66f, // 11 100 1100 1101 111
945
946 // Statistical profiling registers
947 A64SysReg_PMSIDR_EL1 = 0xc4cf, // 11 000 1001 1001 111
948 A64SysReg_PMBIDR_EL1 = 0xc4d7, // 11 000 1001 1010 111
949 A64SysReg_PMBLIMITR_EL1 = 0xc4d0, // 11 000 1001 1010 000
950 A64SysReg_PMBPTR_EL1 = 0xc4d1, // 11 000 1001 1010 001
951 A64SysReg_PMBSR_EL1 = 0xc4d3, // 11 000 1001 1010 011
952 A64SysReg_PMSCR_EL1 = 0xc4c8, // 11 000 1001 1001 000
953 A64SysReg_PMSCR_EL12 = 0xecc8, // 11 101 1001 1001 000
954 A64SysReg_PMSCR_EL2 = 0xe4c8, // 11 100 1001 1001 000
955 A64SysReg_PMSICR_EL1 = 0xc4ca, // 11 000 1001 1001 010
956 A64SysReg_PMSIRR_EL1 = 0xc4cb, // 11 000 1001 1001 011
957 A64SysReg_PMSFCR_EL1 = 0xc4cc, // 11 000 1001 1001 100
958 A64SysReg_PMSEVFR_EL1 = 0xc4cd, // 11 000 1001 1001 101
959 A64SysReg_PMSLATFR_EL1 = 0xc4ce // 11 000 1001 1001 110
960 };
961
962 // Cyclone specific system registers
963 enum A64CycloneSysRegValues {
964 A64SysReg_CPM_IOACC_CTL_EL3 = 0xff90
965 };
966
967 enum A64TLBIValues {
968 A64TLBI_Invalid = -1, // Op0 Op1 CRn CRm Op2
969 A64TLBI_IPAS2E1IS = 0x6401, // 01 100 1000 0000 001
970 A64TLBI_IPAS2LE1IS = 0x6405, // 01 100 1000 0000 101
971 A64TLBI_VMALLE1IS = 0x4418, // 01 000 1000 0011 000
972 A64TLBI_ALLE2IS = 0x6418, // 01 100 1000 0011 000
973 A64TLBI_ALLE3IS = 0x7418, // 01 110 1000 0011 000
974 A64TLBI_VAE1IS = 0x4419, // 01 000 1000 0011 001
975 A64TLBI_VAE2IS = 0x6419, // 01 100 1000 0011 001
976 A64TLBI_VAE3IS = 0x7419, // 01 110 1000 0011 001
977 A64TLBI_ASIDE1IS = 0x441a, // 01 000 1000 0011 010
978 A64TLBI_VAAE1IS = 0x441b, // 01 000 1000 0011 011
979 A64TLBI_ALLE1IS = 0x641c, // 01 100 1000 0011 100
980 A64TLBI_VALE1IS = 0x441d, // 01 000 1000 0011 101
981 A64TLBI_VALE2IS = 0x641d, // 01 100 1000 0011 101
982 A64TLBI_VALE3IS = 0x741d, // 01 110 1000 0011 101
983 A64TLBI_VMALLS12E1IS = 0x641e, // 01 100 1000 0011 110
984 A64TLBI_VAALE1IS = 0x441f, // 01 000 1000 0011 111
985 A64TLBI_IPAS2E1 = 0x6421, // 01 100 1000 0100 001
986 A64TLBI_IPAS2LE1 = 0x6425, // 01 100 1000 0100 101
987 A64TLBI_VMALLE1 = 0x4438, // 01 000 1000 0111 000
988 A64TLBI_ALLE2 = 0x6438, // 01 100 1000 0111 000
989 A64TLBI_ALLE3 = 0x7438, // 01 110 1000 0111 000
990 A64TLBI_VAE1 = 0x4439, // 01 000 1000 0111 001
991 A64TLBI_VAE2 = 0x6439, // 01 100 1000 0111 001
992 A64TLBI_VAE3 = 0x7439, // 01 110 1000 0111 001
993 A64TLBI_ASIDE1 = 0x443a, // 01 000 1000 0111 010
994 A64TLBI_VAAE1 = 0x443b, // 01 000 1000 0111 011
995 A64TLBI_ALLE1 = 0x643c, // 01 100 1000 0111 100
996 A64TLBI_VALE1 = 0x443d, // 01 000 1000 0111 101
997 A64TLBI_VALE2 = 0x643d, // 01 100 1000 0111 101
998 A64TLBI_VALE3 = 0x743d, // 01 110 1000 0111 101
999 A64TLBI_VMALLS12E1 = 0x643e, // 01 100 1000 0111 110
1000 A64TLBI_VAALE1 = 0x443f // 01 000 1000 0111 111
1001 };
1002
1003 bool A64Imms_isLogicalImmBits(unsigned RegWidth, uint32_t Bits, uint64_t *Imm);
1004
1005 char *A64NamedImmMapper_toString(A64NamedImmMapper *N, uint32_t Value, bool *Valid);
1006
1007 uint32_t A64NamedImmMapper_fromString(A64NamedImmMapper *N, char *Name, bool *Valid);
1008
1009 bool A64NamedImmMapper_validImm(A64NamedImmMapper *N, uint32_t Value);
1010
1011 void A64SysRegMapper_toString(A64SysRegMapper *S, uint32_t Bits, bool *Valid, char *result);
1012
1013 #endif
1014