blob: 73859c12ea3ea230f8cefea49e51a323fd80f25a [file] [log] [blame]
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +08001//===-- 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
Nguyen Anh Quynhbb0744d2014-05-12 13:41:49 +080017/* Capstone Disassembly Engine */
Nguyen Anh Quynhbfcaba52015-03-04 17:45:23 +080018/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080019
20#ifndef CS_LLVM_AARCH64_BASEINFO_H
21#define CS_LLVM_AARCH64_BASEINFO_H
22
23#include <ctype.h>
tandasat45e5eab2016-05-11 21:48:32 -070024#if !defined(_MSC_VER) || !defined(_KERNEL_MODE)
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080025#include <stdint.h>
tandasat45e5eab2016-05-11 21:48:32 -070026#endif
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080027#include <string.h>
28
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +080029#ifndef __cplusplus
30#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
31#define inline /* inline */
32#endif
33#endif
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080034
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +080035inline 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 }
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080072
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +080073 // For anything else, return it unchanged.
74 return Reg;
75}
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080076
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.
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +080080typedef enum A64CC_CondCode { // Meaning (integer) Meaning (floating-point)
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080081 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)
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +080097 // Note the NV exists purely to disassemble 0b1111. Execution is "always".
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080098 A64CC_Invalid
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +080099} A64CC_CondCode;
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800100
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800101inline static char *getCondCodeName(A64CC_CondCode CC)
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800102{
103 switch (CC) {
Nguyen Anh Quynhcbb33582014-06-16 11:16:30 +0800104 default: return NULL; // never reach
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800105 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
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800124inline 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.
141typedef struct A64NamedImmMapper_Mapping {
142 char *Name;
143 uint32_t Value;
144} A64NamedImmMapper_Mapping;
145
146typedef struct A64NamedImmMapper {
147 A64NamedImmMapper_Mapping *Pairs;
148 size_t NumPairs;
149 uint32_t TooBigImm;
150} A64NamedImmMapper;
151
152typedef struct A64SysRegMapper {
153 A64NamedImmMapper_Mapping *SysRegPairs;
154 A64NamedImmMapper_Mapping *InstPairs;
155 size_t NumInstPairs;
156} A64SysRegMapper;
157
158extern A64SysRegMapper AArch64_MSRMapper;
159extern A64SysRegMapper AArch64_MRSMapper;
160
161extern A64NamedImmMapper A64DB_DBarrierMapper;
162extern A64NamedImmMapper A64AT_ATMapper;
163extern A64NamedImmMapper A64DC_DCMapper;
164extern A64NamedImmMapper A64IC_ICMapper;
165extern A64NamedImmMapper A64ISB_ISBMapper;
166extern A64NamedImmMapper A64PRFM_PRFMMapper;
167extern A64NamedImmMapper A64PState_PStateMapper;
168extern A64NamedImmMapper A64TLBI_TLBIMapper;
169
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800170enum {
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
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800186enum A64DBValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800187 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
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800202enum A64DCValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800203 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
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800214enum A64ICValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800215 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
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800221enum A64ISBValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800222 A64ISB_Invalid = -1,
223 A64ISB_SY = 0xf
224};
225
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800226enum A64PRFMValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800227 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
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800248enum A64PStateValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800249 A64PState_Invalid = -1,
250 A64PState_SPSel = 0x05,
251 A64PState_DAIFSet = 0x1e,
252 A64PState_DAIFClr = 0x1f
253};
254
255typedef enum A64SE_ShiftExtSpecifiers {
256 A64SE_Invalid = -1,
257 A64SE_LSL,
258 A64SE_MSL,
259 A64SE_LSR,
260 A64SE_ASR,
261 A64SE_ROR,
262
263 A64SE_UXTB,
264 A64SE_UXTH,
265 A64SE_UXTW,
266 A64SE_UXTX,
267
268 A64SE_SXTB,
269 A64SE_SXTH,
270 A64SE_SXTW,
271 A64SE_SXTX
272} A64SE_ShiftExtSpecifiers;
273
Nguyen Anh Quynh731bf2a2013-12-08 15:13:47 +0800274typedef enum A64Layout_VectorLayout {
275 A64Layout_Invalid = -1,
276 A64Layout_VL_8B,
277 A64Layout_VL_4H,
278 A64Layout_VL_2S,
279 A64Layout_VL_1D,
280
281 A64Layout_VL_16B,
282 A64Layout_VL_8H,
283 A64Layout_VL_4S,
284 A64Layout_VL_2D,
285
286 // Bare layout for the 128-bit vector
287 // (only show ".b", ".h", ".s", ".d" without vector number)
288 A64Layout_VL_B,
289 A64Layout_VL_H,
290 A64Layout_VL_S,
291 A64Layout_VL_D
292} A64Layout_VectorLayout;
293
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800294inline static char *A64VectorLayoutToString(A64Layout_VectorLayout Layout)
Nguyen Anh Quynh731bf2a2013-12-08 15:13:47 +0800295{
296 switch (Layout) {
297 case A64Layout_VL_8B: return ".8b";
298 case A64Layout_VL_4H: return ".4h";
299 case A64Layout_VL_2S: return ".2s";
300 case A64Layout_VL_1D: return ".1d";
301 case A64Layout_VL_16B: return ".16b";
302 case A64Layout_VL_8H: return ".8h";
303 case A64Layout_VL_4S: return ".4s";
304 case A64Layout_VL_2D: return ".2d";
305 case A64Layout_VL_B: return ".b";
306 case A64Layout_VL_H: return ".h";
307 case A64Layout_VL_S: return ".s";
308 case A64Layout_VL_D: return ".d";
309 default: return NULL; // never reach
310 }
311}
312
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800313enum A64SysRegROValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800314 A64SysReg_MDCCSR_EL0 = 0x9808, // 10 011 0000 0001 000
315 A64SysReg_DBGDTRRX_EL0 = 0x9828, // 10 011 0000 0101 000
316 A64SysReg_MDRAR_EL1 = 0x8080, // 10 000 0001 0000 000
317 A64SysReg_OSLSR_EL1 = 0x808c, // 10 000 0001 0001 100
318 A64SysReg_DBGAUTHSTATUS_EL1 = 0x83f6, // 10 000 0111 1110 110
319 A64SysReg_PMCEID0_EL0 = 0xdce6, // 11 011 1001 1100 110
320 A64SysReg_PMCEID1_EL0 = 0xdce7, // 11 011 1001 1100 111
321 A64SysReg_MIDR_EL1 = 0xc000, // 11 000 0000 0000 000
322 A64SysReg_CCSIDR_EL1 = 0xc800, // 11 001 0000 0000 000
323 A64SysReg_CLIDR_EL1 = 0xc801, // 11 001 0000 0000 001
324 A64SysReg_CTR_EL0 = 0xd801, // 11 011 0000 0000 001
325 A64SysReg_MPIDR_EL1 = 0xc005, // 11 000 0000 0000 101
326 A64SysReg_REVIDR_EL1 = 0xc006, // 11 000 0000 0000 110
327 A64SysReg_AIDR_EL1 = 0xc807, // 11 001 0000 0000 111
328 A64SysReg_DCZID_EL0 = 0xd807, // 11 011 0000 0000 111
329 A64SysReg_ID_PFR0_EL1 = 0xc008, // 11 000 0000 0001 000
330 A64SysReg_ID_PFR1_EL1 = 0xc009, // 11 000 0000 0001 001
331 A64SysReg_ID_DFR0_EL1 = 0xc00a, // 11 000 0000 0001 010
332 A64SysReg_ID_AFR0_EL1 = 0xc00b, // 11 000 0000 0001 011
333 A64SysReg_ID_MMFR0_EL1 = 0xc00c, // 11 000 0000 0001 100
334 A64SysReg_ID_MMFR1_EL1 = 0xc00d, // 11 000 0000 0001 101
335 A64SysReg_ID_MMFR2_EL1 = 0xc00e, // 11 000 0000 0001 110
336 A64SysReg_ID_MMFR3_EL1 = 0xc00f, // 11 000 0000 0001 111
337 A64SysReg_ID_ISAR0_EL1 = 0xc010, // 11 000 0000 0010 000
338 A64SysReg_ID_ISAR1_EL1 = 0xc011, // 11 000 0000 0010 001
339 A64SysReg_ID_ISAR2_EL1 = 0xc012, // 11 000 0000 0010 010
340 A64SysReg_ID_ISAR3_EL1 = 0xc013, // 11 000 0000 0010 011
341 A64SysReg_ID_ISAR4_EL1 = 0xc014, // 11 000 0000 0010 100
342 A64SysReg_ID_ISAR5_EL1 = 0xc015, // 11 000 0000 0010 101
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800343 A64SysReg_ID_A64PFR0_EL1 = 0xc020, // 11 000 0000 0100 000
344 A64SysReg_ID_A64PFR1_EL1 = 0xc021, // 11 000 0000 0100 001
345 A64SysReg_ID_A64DFR0_EL1 = 0xc028, // 11 000 0000 0101 000
346 A64SysReg_ID_A64DFR1_EL1 = 0xc029, // 11 000 0000 0101 001
347 A64SysReg_ID_A64AFR0_EL1 = 0xc02c, // 11 000 0000 0101 100
348 A64SysReg_ID_A64AFR1_EL1 = 0xc02d, // 11 000 0000 0101 101
349 A64SysReg_ID_A64ISAR0_EL1 = 0xc030, // 11 000 0000 0110 000
350 A64SysReg_ID_A64ISAR1_EL1 = 0xc031, // 11 000 0000 0110 001
351 A64SysReg_ID_A64MMFR0_EL1 = 0xc038, // 11 000 0000 0111 000
352 A64SysReg_ID_A64MMFR1_EL1 = 0xc039, // 11 000 0000 0111 001
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800353 A64SysReg_MVFR0_EL1 = 0xc018, // 11 000 0000 0011 000
354 A64SysReg_MVFR1_EL1 = 0xc019, // 11 000 0000 0011 001
355 A64SysReg_MVFR2_EL1 = 0xc01a, // 11 000 0000 0011 010
356 A64SysReg_RVBAR_EL1 = 0xc601, // 11 000 1100 0000 001
357 A64SysReg_RVBAR_EL2 = 0xe601, // 11 100 1100 0000 001
358 A64SysReg_RVBAR_EL3 = 0xf601, // 11 110 1100 0000 001
359 A64SysReg_ISR_EL1 = 0xc608, // 11 000 1100 0001 000
360 A64SysReg_CNTPCT_EL0 = 0xdf01, // 11 011 1110 0000 001
361 A64SysReg_CNTVCT_EL0 = 0xdf02, // 11 011 1110 0000 010
362
363 // Trace registers
364 A64SysReg_TRCSTATR = 0x8818, // 10 001 0000 0011 000
365 A64SysReg_TRCIDR8 = 0x8806, // 10 001 0000 0000 110
366 A64SysReg_TRCIDR9 = 0x880e, // 10 001 0000 0001 110
367 A64SysReg_TRCIDR10 = 0x8816, // 10 001 0000 0010 110
368 A64SysReg_TRCIDR11 = 0x881e, // 10 001 0000 0011 110
369 A64SysReg_TRCIDR12 = 0x8826, // 10 001 0000 0100 110
370 A64SysReg_TRCIDR13 = 0x882e, // 10 001 0000 0101 110
371 A64SysReg_TRCIDR0 = 0x8847, // 10 001 0000 1000 111
372 A64SysReg_TRCIDR1 = 0x884f, // 10 001 0000 1001 111
373 A64SysReg_TRCIDR2 = 0x8857, // 10 001 0000 1010 111
374 A64SysReg_TRCIDR3 = 0x885f, // 10 001 0000 1011 111
375 A64SysReg_TRCIDR4 = 0x8867, // 10 001 0000 1100 111
376 A64SysReg_TRCIDR5 = 0x886f, // 10 001 0000 1101 111
377 A64SysReg_TRCIDR6 = 0x8877, // 10 001 0000 1110 111
378 A64SysReg_TRCIDR7 = 0x887f, // 10 001 0000 1111 111
379 A64SysReg_TRCOSLSR = 0x888c, // 10 001 0001 0001 100
380 A64SysReg_TRCPDSR = 0x88ac, // 10 001 0001 0101 100
381 A64SysReg_TRCDEVAFF0 = 0x8bd6, // 10 001 0111 1010 110
382 A64SysReg_TRCDEVAFF1 = 0x8bde, // 10 001 0111 1011 110
383 A64SysReg_TRCLSR = 0x8bee, // 10 001 0111 1101 110
384 A64SysReg_TRCAUTHSTATUS = 0x8bf6, // 10 001 0111 1110 110
385 A64SysReg_TRCDEVARCH = 0x8bfe, // 10 001 0111 1111 110
386 A64SysReg_TRCDEVID = 0x8b97, // 10 001 0111 0010 111
387 A64SysReg_TRCDEVTYPE = 0x8b9f, // 10 001 0111 0011 111
388 A64SysReg_TRCPIDR4 = 0x8ba7, // 10 001 0111 0100 111
389 A64SysReg_TRCPIDR5 = 0x8baf, // 10 001 0111 0101 111
390 A64SysReg_TRCPIDR6 = 0x8bb7, // 10 001 0111 0110 111
391 A64SysReg_TRCPIDR7 = 0x8bbf, // 10 001 0111 0111 111
392 A64SysReg_TRCPIDR0 = 0x8bc7, // 10 001 0111 1000 111
393 A64SysReg_TRCPIDR1 = 0x8bcf, // 10 001 0111 1001 111
394 A64SysReg_TRCPIDR2 = 0x8bd7, // 10 001 0111 1010 111
395 A64SysReg_TRCPIDR3 = 0x8bdf, // 10 001 0111 1011 111
396 A64SysReg_TRCCIDR0 = 0x8be7, // 10 001 0111 1100 111
397 A64SysReg_TRCCIDR1 = 0x8bef, // 10 001 0111 1101 111
398 A64SysReg_TRCCIDR2 = 0x8bf7, // 10 001 0111 1110 111
399 A64SysReg_TRCCIDR3 = 0x8bff, // 10 001 0111 1111 111
400
401 // GICv3 registers
402 A64SysReg_ICC_IAR1_EL1 = 0xc660, // 11 000 1100 1100 000
403 A64SysReg_ICC_IAR0_EL1 = 0xc640, // 11 000 1100 1000 000
404 A64SysReg_ICC_HPPIR1_EL1 = 0xc662, // 11 000 1100 1100 010
405 A64SysReg_ICC_HPPIR0_EL1 = 0xc642, // 11 000 1100 1000 010
406 A64SysReg_ICC_RPR_EL1 = 0xc65b, // 11 000 1100 1011 011
407 A64SysReg_ICH_VTR_EL2 = 0xe659, // 11 100 1100 1011 001
408 A64SysReg_ICH_EISR_EL2 = 0xe65b, // 11 100 1100 1011 011
409 A64SysReg_ICH_ELSR_EL2 = 0xe65d // 11 100 1100 1011 101
410};
411
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800412enum A64SysRegWOValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800413 A64SysReg_DBGDTRTX_EL0 = 0x9828, // 10 011 0000 0101 000
414 A64SysReg_OSLAR_EL1 = 0x8084, // 10 000 0001 0000 100
415 A64SysReg_PMSWINC_EL0 = 0xdce4, // 11 011 1001 1100 100
416
417 // Trace Registers
418 A64SysReg_TRCOSLAR = 0x8884, // 10 001 0001 0000 100
419 A64SysReg_TRCLAR = 0x8be6, // 10 001 0111 1100 110
420
421 // GICv3 registers
422 A64SysReg_ICC_EOIR1_EL1 = 0xc661, // 11 000 1100 1100 001
423 A64SysReg_ICC_EOIR0_EL1 = 0xc641, // 11 000 1100 1000 001
424 A64SysReg_ICC_DIR_EL1 = 0xc659, // 11 000 1100 1011 001
425 A64SysReg_ICC_SGI1R_EL1 = 0xc65d, // 11 000 1100 1011 101
426 A64SysReg_ICC_ASGI1R_EL1 = 0xc65e, // 11 000 1100 1011 110
427 A64SysReg_ICC_SGI0R_EL1 = 0xc65f // 11 000 1100 1011 111
428};
429
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800430enum A64SysRegValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800431 A64SysReg_Invalid = -1, // Op0 Op1 CRn CRm Op2
432 A64SysReg_OSDTRRX_EL1 = 0x8002, // 10 000 0000 0000 010
433 A64SysReg_OSDTRTX_EL1 = 0x801a, // 10 000 0000 0011 010
434 A64SysReg_TEECR32_EL1 = 0x9000, // 10 010 0000 0000 000
435 A64SysReg_MDCCINT_EL1 = 0x8010, // 10 000 0000 0010 000
436 A64SysReg_MDSCR_EL1 = 0x8012, // 10 000 0000 0010 010
437 A64SysReg_DBGDTR_EL0 = 0x9820, // 10 011 0000 0100 000
438 A64SysReg_OSECCR_EL1 = 0x8032, // 10 000 0000 0110 010
439 A64SysReg_DBGVCR32_EL2 = 0xa038, // 10 100 0000 0111 000
440 A64SysReg_DBGBVR0_EL1 = 0x8004, // 10 000 0000 0000 100
441 A64SysReg_DBGBVR1_EL1 = 0x800c, // 10 000 0000 0001 100
442 A64SysReg_DBGBVR2_EL1 = 0x8014, // 10 000 0000 0010 100
443 A64SysReg_DBGBVR3_EL1 = 0x801c, // 10 000 0000 0011 100
444 A64SysReg_DBGBVR4_EL1 = 0x8024, // 10 000 0000 0100 100
445 A64SysReg_DBGBVR5_EL1 = 0x802c, // 10 000 0000 0101 100
446 A64SysReg_DBGBVR6_EL1 = 0x8034, // 10 000 0000 0110 100
447 A64SysReg_DBGBVR7_EL1 = 0x803c, // 10 000 0000 0111 100
448 A64SysReg_DBGBVR8_EL1 = 0x8044, // 10 000 0000 1000 100
449 A64SysReg_DBGBVR9_EL1 = 0x804c, // 10 000 0000 1001 100
450 A64SysReg_DBGBVR10_EL1 = 0x8054, // 10 000 0000 1010 100
451 A64SysReg_DBGBVR11_EL1 = 0x805c, // 10 000 0000 1011 100
452 A64SysReg_DBGBVR12_EL1 = 0x8064, // 10 000 0000 1100 100
453 A64SysReg_DBGBVR13_EL1 = 0x806c, // 10 000 0000 1101 100
454 A64SysReg_DBGBVR14_EL1 = 0x8074, // 10 000 0000 1110 100
455 A64SysReg_DBGBVR15_EL1 = 0x807c, // 10 000 0000 1111 100
456 A64SysReg_DBGBCR0_EL1 = 0x8005, // 10 000 0000 0000 101
457 A64SysReg_DBGBCR1_EL1 = 0x800d, // 10 000 0000 0001 101
458 A64SysReg_DBGBCR2_EL1 = 0x8015, // 10 000 0000 0010 101
459 A64SysReg_DBGBCR3_EL1 = 0x801d, // 10 000 0000 0011 101
460 A64SysReg_DBGBCR4_EL1 = 0x8025, // 10 000 0000 0100 101
461 A64SysReg_DBGBCR5_EL1 = 0x802d, // 10 000 0000 0101 101
462 A64SysReg_DBGBCR6_EL1 = 0x8035, // 10 000 0000 0110 101
463 A64SysReg_DBGBCR7_EL1 = 0x803d, // 10 000 0000 0111 101
464 A64SysReg_DBGBCR8_EL1 = 0x8045, // 10 000 0000 1000 101
465 A64SysReg_DBGBCR9_EL1 = 0x804d, // 10 000 0000 1001 101
466 A64SysReg_DBGBCR10_EL1 = 0x8055, // 10 000 0000 1010 101
467 A64SysReg_DBGBCR11_EL1 = 0x805d, // 10 000 0000 1011 101
468 A64SysReg_DBGBCR12_EL1 = 0x8065, // 10 000 0000 1100 101
469 A64SysReg_DBGBCR13_EL1 = 0x806d, // 10 000 0000 1101 101
470 A64SysReg_DBGBCR14_EL1 = 0x8075, // 10 000 0000 1110 101
471 A64SysReg_DBGBCR15_EL1 = 0x807d, // 10 000 0000 1111 101
472 A64SysReg_DBGWVR0_EL1 = 0x8006, // 10 000 0000 0000 110
473 A64SysReg_DBGWVR1_EL1 = 0x800e, // 10 000 0000 0001 110
474 A64SysReg_DBGWVR2_EL1 = 0x8016, // 10 000 0000 0010 110
475 A64SysReg_DBGWVR3_EL1 = 0x801e, // 10 000 0000 0011 110
476 A64SysReg_DBGWVR4_EL1 = 0x8026, // 10 000 0000 0100 110
477 A64SysReg_DBGWVR5_EL1 = 0x802e, // 10 000 0000 0101 110
478 A64SysReg_DBGWVR6_EL1 = 0x8036, // 10 000 0000 0110 110
479 A64SysReg_DBGWVR7_EL1 = 0x803e, // 10 000 0000 0111 110
480 A64SysReg_DBGWVR8_EL1 = 0x8046, // 10 000 0000 1000 110
481 A64SysReg_DBGWVR9_EL1 = 0x804e, // 10 000 0000 1001 110
482 A64SysReg_DBGWVR10_EL1 = 0x8056, // 10 000 0000 1010 110
483 A64SysReg_DBGWVR11_EL1 = 0x805e, // 10 000 0000 1011 110
484 A64SysReg_DBGWVR12_EL1 = 0x8066, // 10 000 0000 1100 110
485 A64SysReg_DBGWVR13_EL1 = 0x806e, // 10 000 0000 1101 110
486 A64SysReg_DBGWVR14_EL1 = 0x8076, // 10 000 0000 1110 110
487 A64SysReg_DBGWVR15_EL1 = 0x807e, // 10 000 0000 1111 110
488 A64SysReg_DBGWCR0_EL1 = 0x8007, // 10 000 0000 0000 111
489 A64SysReg_DBGWCR1_EL1 = 0x800f, // 10 000 0000 0001 111
490 A64SysReg_DBGWCR2_EL1 = 0x8017, // 10 000 0000 0010 111
491 A64SysReg_DBGWCR3_EL1 = 0x801f, // 10 000 0000 0011 111
492 A64SysReg_DBGWCR4_EL1 = 0x8027, // 10 000 0000 0100 111
493 A64SysReg_DBGWCR5_EL1 = 0x802f, // 10 000 0000 0101 111
494 A64SysReg_DBGWCR6_EL1 = 0x8037, // 10 000 0000 0110 111
495 A64SysReg_DBGWCR7_EL1 = 0x803f, // 10 000 0000 0111 111
496 A64SysReg_DBGWCR8_EL1 = 0x8047, // 10 000 0000 1000 111
497 A64SysReg_DBGWCR9_EL1 = 0x804f, // 10 000 0000 1001 111
498 A64SysReg_DBGWCR10_EL1 = 0x8057, // 10 000 0000 1010 111
499 A64SysReg_DBGWCR11_EL1 = 0x805f, // 10 000 0000 1011 111
500 A64SysReg_DBGWCR12_EL1 = 0x8067, // 10 000 0000 1100 111
501 A64SysReg_DBGWCR13_EL1 = 0x806f, // 10 000 0000 1101 111
502 A64SysReg_DBGWCR14_EL1 = 0x8077, // 10 000 0000 1110 111
503 A64SysReg_DBGWCR15_EL1 = 0x807f, // 10 000 0000 1111 111
504 A64SysReg_TEEHBR32_EL1 = 0x9080, // 10 010 0001 0000 000
505 A64SysReg_OSDLR_EL1 = 0x809c, // 10 000 0001 0011 100
506 A64SysReg_DBGPRCR_EL1 = 0x80a4, // 10 000 0001 0100 100
507 A64SysReg_DBGCLAIMSET_EL1 = 0x83c6, // 10 000 0111 1000 110
508 A64SysReg_DBGCLAIMCLR_EL1 = 0x83ce, // 10 000 0111 1001 110
509 A64SysReg_CSSELR_EL1 = 0xd000, // 11 010 0000 0000 000
510 A64SysReg_VPIDR_EL2 = 0xe000, // 11 100 0000 0000 000
511 A64SysReg_VMPIDR_EL2 = 0xe005, // 11 100 0000 0000 101
512 A64SysReg_CPACR_EL1 = 0xc082, // 11 000 0001 0000 010
513 A64SysReg_SCTLR_EL1 = 0xc080, // 11 000 0001 0000 000
514 A64SysReg_SCTLR_EL2 = 0xe080, // 11 100 0001 0000 000
515 A64SysReg_SCTLR_EL3 = 0xf080, // 11 110 0001 0000 000
516 A64SysReg_ACTLR_EL1 = 0xc081, // 11 000 0001 0000 001
517 A64SysReg_ACTLR_EL2 = 0xe081, // 11 100 0001 0000 001
518 A64SysReg_ACTLR_EL3 = 0xf081, // 11 110 0001 0000 001
519 A64SysReg_HCR_EL2 = 0xe088, // 11 100 0001 0001 000
520 A64SysReg_SCR_EL3 = 0xf088, // 11 110 0001 0001 000
521 A64SysReg_MDCR_EL2 = 0xe089, // 11 100 0001 0001 001
522 A64SysReg_SDER32_EL3 = 0xf089, // 11 110 0001 0001 001
523 A64SysReg_CPTR_EL2 = 0xe08a, // 11 100 0001 0001 010
524 A64SysReg_CPTR_EL3 = 0xf08a, // 11 110 0001 0001 010
525 A64SysReg_HSTR_EL2 = 0xe08b, // 11 100 0001 0001 011
526 A64SysReg_HACR_EL2 = 0xe08f, // 11 100 0001 0001 111
527 A64SysReg_MDCR_EL3 = 0xf099, // 11 110 0001 0011 001
528 A64SysReg_TTBR0_EL1 = 0xc100, // 11 000 0010 0000 000
529 A64SysReg_TTBR0_EL2 = 0xe100, // 11 100 0010 0000 000
530 A64SysReg_TTBR0_EL3 = 0xf100, // 11 110 0010 0000 000
531 A64SysReg_TTBR1_EL1 = 0xc101, // 11 000 0010 0000 001
532 A64SysReg_TCR_EL1 = 0xc102, // 11 000 0010 0000 010
533 A64SysReg_TCR_EL2 = 0xe102, // 11 100 0010 0000 010
534 A64SysReg_TCR_EL3 = 0xf102, // 11 110 0010 0000 010
535 A64SysReg_VTTBR_EL2 = 0xe108, // 11 100 0010 0001 000
536 A64SysReg_VTCR_EL2 = 0xe10a, // 11 100 0010 0001 010
537 A64SysReg_DACR32_EL2 = 0xe180, // 11 100 0011 0000 000
538 A64SysReg_SPSR_EL1 = 0xc200, // 11 000 0100 0000 000
539 A64SysReg_SPSR_EL2 = 0xe200, // 11 100 0100 0000 000
540 A64SysReg_SPSR_EL3 = 0xf200, // 11 110 0100 0000 000
541 A64SysReg_ELR_EL1 = 0xc201, // 11 000 0100 0000 001
542 A64SysReg_ELR_EL2 = 0xe201, // 11 100 0100 0000 001
543 A64SysReg_ELR_EL3 = 0xf201, // 11 110 0100 0000 001
544 A64SysReg_SP_EL0 = 0xc208, // 11 000 0100 0001 000
545 A64SysReg_SP_EL1 = 0xe208, // 11 100 0100 0001 000
546 A64SysReg_SP_EL2 = 0xf208, // 11 110 0100 0001 000
547 A64SysReg_SPSel = 0xc210, // 11 000 0100 0010 000
548 A64SysReg_NZCV = 0xda10, // 11 011 0100 0010 000
549 A64SysReg_DAIF = 0xda11, // 11 011 0100 0010 001
550 A64SysReg_CurrentEL = 0xc212, // 11 000 0100 0010 010
551 A64SysReg_SPSR_irq = 0xe218, // 11 100 0100 0011 000
552 A64SysReg_SPSR_abt = 0xe219, // 11 100 0100 0011 001
553 A64SysReg_SPSR_und = 0xe21a, // 11 100 0100 0011 010
554 A64SysReg_SPSR_fiq = 0xe21b, // 11 100 0100 0011 011
555 A64SysReg_FPCR = 0xda20, // 11 011 0100 0100 000
556 A64SysReg_FPSR = 0xda21, // 11 011 0100 0100 001
557 A64SysReg_DSPSR_EL0 = 0xda28, // 11 011 0100 0101 000
558 A64SysReg_DLR_EL0 = 0xda29, // 11 011 0100 0101 001
559 A64SysReg_IFSR32_EL2 = 0xe281, // 11 100 0101 0000 001
560 A64SysReg_AFSR0_EL1 = 0xc288, // 11 000 0101 0001 000
561 A64SysReg_AFSR0_EL2 = 0xe288, // 11 100 0101 0001 000
562 A64SysReg_AFSR0_EL3 = 0xf288, // 11 110 0101 0001 000
563 A64SysReg_AFSR1_EL1 = 0xc289, // 11 000 0101 0001 001
564 A64SysReg_AFSR1_EL2 = 0xe289, // 11 100 0101 0001 001
565 A64SysReg_AFSR1_EL3 = 0xf289, // 11 110 0101 0001 001
566 A64SysReg_ESR_EL1 = 0xc290, // 11 000 0101 0010 000
567 A64SysReg_ESR_EL2 = 0xe290, // 11 100 0101 0010 000
568 A64SysReg_ESR_EL3 = 0xf290, // 11 110 0101 0010 000
569 A64SysReg_FPEXC32_EL2 = 0xe298, // 11 100 0101 0011 000
570 A64SysReg_FAR_EL1 = 0xc300, // 11 000 0110 0000 000
571 A64SysReg_FAR_EL2 = 0xe300, // 11 100 0110 0000 000
572 A64SysReg_FAR_EL3 = 0xf300, // 11 110 0110 0000 000
573 A64SysReg_HPFAR_EL2 = 0xe304, // 11 100 0110 0000 100
574 A64SysReg_PAR_EL1 = 0xc3a0, // 11 000 0111 0100 000
575 A64SysReg_PMCR_EL0 = 0xdce0, // 11 011 1001 1100 000
576 A64SysReg_PMCNTENSET_EL0 = 0xdce1, // 11 011 1001 1100 001
577 A64SysReg_PMCNTENCLR_EL0 = 0xdce2, // 11 011 1001 1100 010
578 A64SysReg_PMOVSCLR_EL0 = 0xdce3, // 11 011 1001 1100 011
579 A64SysReg_PMSELR_EL0 = 0xdce5, // 11 011 1001 1100 101
580 A64SysReg_PMCCNTR_EL0 = 0xdce8, // 11 011 1001 1101 000
581 A64SysReg_PMXEVTYPER_EL0 = 0xdce9, // 11 011 1001 1101 001
582 A64SysReg_PMXEVCNTR_EL0 = 0xdcea, // 11 011 1001 1101 010
583 A64SysReg_PMUSERENR_EL0 = 0xdcf0, // 11 011 1001 1110 000
584 A64SysReg_PMINTENSET_EL1 = 0xc4f1, // 11 000 1001 1110 001
585 A64SysReg_PMINTENCLR_EL1 = 0xc4f2, // 11 000 1001 1110 010
586 A64SysReg_PMOVSSET_EL0 = 0xdcf3, // 11 011 1001 1110 011
587 A64SysReg_MAIR_EL1 = 0xc510, // 11 000 1010 0010 000
588 A64SysReg_MAIR_EL2 = 0xe510, // 11 100 1010 0010 000
589 A64SysReg_MAIR_EL3 = 0xf510, // 11 110 1010 0010 000
590 A64SysReg_AMAIR_EL1 = 0xc518, // 11 000 1010 0011 000
591 A64SysReg_AMAIR_EL2 = 0xe518, // 11 100 1010 0011 000
592 A64SysReg_AMAIR_EL3 = 0xf518, // 11 110 1010 0011 000
593 A64SysReg_VBAR_EL1 = 0xc600, // 11 000 1100 0000 000
594 A64SysReg_VBAR_EL2 = 0xe600, // 11 100 1100 0000 000
595 A64SysReg_VBAR_EL3 = 0xf600, // 11 110 1100 0000 000
596 A64SysReg_RMR_EL1 = 0xc602, // 11 000 1100 0000 010
597 A64SysReg_RMR_EL2 = 0xe602, // 11 100 1100 0000 010
598 A64SysReg_RMR_EL3 = 0xf602, // 11 110 1100 0000 010
599 A64SysReg_CONTEXTIDR_EL1 = 0xc681, // 11 000 1101 0000 001
600 A64SysReg_TPIDR_EL0 = 0xde82, // 11 011 1101 0000 010
601 A64SysReg_TPIDR_EL2 = 0xe682, // 11 100 1101 0000 010
602 A64SysReg_TPIDR_EL3 = 0xf682, // 11 110 1101 0000 010
603 A64SysReg_TPIDRRO_EL0 = 0xde83, // 11 011 1101 0000 011
604 A64SysReg_TPIDR_EL1 = 0xc684, // 11 000 1101 0000 100
605 A64SysReg_CNTFRQ_EL0 = 0xdf00, // 11 011 1110 0000 000
606 A64SysReg_CNTVOFF_EL2 = 0xe703, // 11 100 1110 0000 011
607 A64SysReg_CNTKCTL_EL1 = 0xc708, // 11 000 1110 0001 000
608 A64SysReg_CNTHCTL_EL2 = 0xe708, // 11 100 1110 0001 000
609 A64SysReg_CNTP_TVAL_EL0 = 0xdf10, // 11 011 1110 0010 000
610 A64SysReg_CNTHP_TVAL_EL2 = 0xe710, // 11 100 1110 0010 000
611 A64SysReg_CNTPS_TVAL_EL1 = 0xff10, // 11 111 1110 0010 000
612 A64SysReg_CNTP_CTL_EL0 = 0xdf11, // 11 011 1110 0010 001
613 A64SysReg_CNTHP_CTL_EL2 = 0xe711, // 11 100 1110 0010 001
614 A64SysReg_CNTPS_CTL_EL1 = 0xff11, // 11 111 1110 0010 001
615 A64SysReg_CNTP_CVAL_EL0 = 0xdf12, // 11 011 1110 0010 010
616 A64SysReg_CNTHP_CVAL_EL2 = 0xe712, // 11 100 1110 0010 010
617 A64SysReg_CNTPS_CVAL_EL1 = 0xff12, // 11 111 1110 0010 010
618 A64SysReg_CNTV_TVAL_EL0 = 0xdf18, // 11 011 1110 0011 000
619 A64SysReg_CNTV_CTL_EL0 = 0xdf19, // 11 011 1110 0011 001
620 A64SysReg_CNTV_CVAL_EL0 = 0xdf1a, // 11 011 1110 0011 010
621 A64SysReg_PMEVCNTR0_EL0 = 0xdf40, // 11 011 1110 1000 000
622 A64SysReg_PMEVCNTR1_EL0 = 0xdf41, // 11 011 1110 1000 001
623 A64SysReg_PMEVCNTR2_EL0 = 0xdf42, // 11 011 1110 1000 010
624 A64SysReg_PMEVCNTR3_EL0 = 0xdf43, // 11 011 1110 1000 011
625 A64SysReg_PMEVCNTR4_EL0 = 0xdf44, // 11 011 1110 1000 100
626 A64SysReg_PMEVCNTR5_EL0 = 0xdf45, // 11 011 1110 1000 101
627 A64SysReg_PMEVCNTR6_EL0 = 0xdf46, // 11 011 1110 1000 110
628 A64SysReg_PMEVCNTR7_EL0 = 0xdf47, // 11 011 1110 1000 111
629 A64SysReg_PMEVCNTR8_EL0 = 0xdf48, // 11 011 1110 1001 000
630 A64SysReg_PMEVCNTR9_EL0 = 0xdf49, // 11 011 1110 1001 001
631 A64SysReg_PMEVCNTR10_EL0 = 0xdf4a, // 11 011 1110 1001 010
632 A64SysReg_PMEVCNTR11_EL0 = 0xdf4b, // 11 011 1110 1001 011
633 A64SysReg_PMEVCNTR12_EL0 = 0xdf4c, // 11 011 1110 1001 100
634 A64SysReg_PMEVCNTR13_EL0 = 0xdf4d, // 11 011 1110 1001 101
635 A64SysReg_PMEVCNTR14_EL0 = 0xdf4e, // 11 011 1110 1001 110
636 A64SysReg_PMEVCNTR15_EL0 = 0xdf4f, // 11 011 1110 1001 111
637 A64SysReg_PMEVCNTR16_EL0 = 0xdf50, // 11 011 1110 1010 000
638 A64SysReg_PMEVCNTR17_EL0 = 0xdf51, // 11 011 1110 1010 001
639 A64SysReg_PMEVCNTR18_EL0 = 0xdf52, // 11 011 1110 1010 010
640 A64SysReg_PMEVCNTR19_EL0 = 0xdf53, // 11 011 1110 1010 011
641 A64SysReg_PMEVCNTR20_EL0 = 0xdf54, // 11 011 1110 1010 100
642 A64SysReg_PMEVCNTR21_EL0 = 0xdf55, // 11 011 1110 1010 101
643 A64SysReg_PMEVCNTR22_EL0 = 0xdf56, // 11 011 1110 1010 110
644 A64SysReg_PMEVCNTR23_EL0 = 0xdf57, // 11 011 1110 1010 111
645 A64SysReg_PMEVCNTR24_EL0 = 0xdf58, // 11 011 1110 1011 000
646 A64SysReg_PMEVCNTR25_EL0 = 0xdf59, // 11 011 1110 1011 001
647 A64SysReg_PMEVCNTR26_EL0 = 0xdf5a, // 11 011 1110 1011 010
648 A64SysReg_PMEVCNTR27_EL0 = 0xdf5b, // 11 011 1110 1011 011
649 A64SysReg_PMEVCNTR28_EL0 = 0xdf5c, // 11 011 1110 1011 100
650 A64SysReg_PMEVCNTR29_EL0 = 0xdf5d, // 11 011 1110 1011 101
651 A64SysReg_PMEVCNTR30_EL0 = 0xdf5e, // 11 011 1110 1011 110
652 A64SysReg_PMCCFILTR_EL0 = 0xdf7f, // 11 011 1110 1111 111
653 A64SysReg_PMEVTYPER0_EL0 = 0xdf60, // 11 011 1110 1100 000
654 A64SysReg_PMEVTYPER1_EL0 = 0xdf61, // 11 011 1110 1100 001
655 A64SysReg_PMEVTYPER2_EL0 = 0xdf62, // 11 011 1110 1100 010
656 A64SysReg_PMEVTYPER3_EL0 = 0xdf63, // 11 011 1110 1100 011
657 A64SysReg_PMEVTYPER4_EL0 = 0xdf64, // 11 011 1110 1100 100
658 A64SysReg_PMEVTYPER5_EL0 = 0xdf65, // 11 011 1110 1100 101
659 A64SysReg_PMEVTYPER6_EL0 = 0xdf66, // 11 011 1110 1100 110
660 A64SysReg_PMEVTYPER7_EL0 = 0xdf67, // 11 011 1110 1100 111
661 A64SysReg_PMEVTYPER8_EL0 = 0xdf68, // 11 011 1110 1101 000
662 A64SysReg_PMEVTYPER9_EL0 = 0xdf69, // 11 011 1110 1101 001
663 A64SysReg_PMEVTYPER10_EL0 = 0xdf6a, // 11 011 1110 1101 010
664 A64SysReg_PMEVTYPER11_EL0 = 0xdf6b, // 11 011 1110 1101 011
665 A64SysReg_PMEVTYPER12_EL0 = 0xdf6c, // 11 011 1110 1101 100
666 A64SysReg_PMEVTYPER13_EL0 = 0xdf6d, // 11 011 1110 1101 101
667 A64SysReg_PMEVTYPER14_EL0 = 0xdf6e, // 11 011 1110 1101 110
668 A64SysReg_PMEVTYPER15_EL0 = 0xdf6f, // 11 011 1110 1101 111
669 A64SysReg_PMEVTYPER16_EL0 = 0xdf70, // 11 011 1110 1110 000
670 A64SysReg_PMEVTYPER17_EL0 = 0xdf71, // 11 011 1110 1110 001
671 A64SysReg_PMEVTYPER18_EL0 = 0xdf72, // 11 011 1110 1110 010
672 A64SysReg_PMEVTYPER19_EL0 = 0xdf73, // 11 011 1110 1110 011
673 A64SysReg_PMEVTYPER20_EL0 = 0xdf74, // 11 011 1110 1110 100
674 A64SysReg_PMEVTYPER21_EL0 = 0xdf75, // 11 011 1110 1110 101
675 A64SysReg_PMEVTYPER22_EL0 = 0xdf76, // 11 011 1110 1110 110
676 A64SysReg_PMEVTYPER23_EL0 = 0xdf77, // 11 011 1110 1110 111
677 A64SysReg_PMEVTYPER24_EL0 = 0xdf78, // 11 011 1110 1111 000
678 A64SysReg_PMEVTYPER25_EL0 = 0xdf79, // 11 011 1110 1111 001
679 A64SysReg_PMEVTYPER26_EL0 = 0xdf7a, // 11 011 1110 1111 010
680 A64SysReg_PMEVTYPER27_EL0 = 0xdf7b, // 11 011 1110 1111 011
681 A64SysReg_PMEVTYPER28_EL0 = 0xdf7c, // 11 011 1110 1111 100
682 A64SysReg_PMEVTYPER29_EL0 = 0xdf7d, // 11 011 1110 1111 101
683 A64SysReg_PMEVTYPER30_EL0 = 0xdf7e, // 11 011 1110 1111 110
684
685 // Trace registers
686 A64SysReg_TRCPRGCTLR = 0x8808, // 10 001 0000 0001 000
687 A64SysReg_TRCPROCSELR = 0x8810, // 10 001 0000 0010 000
688 A64SysReg_TRCCONFIGR = 0x8820, // 10 001 0000 0100 000
689 A64SysReg_TRCAUXCTLR = 0x8830, // 10 001 0000 0110 000
690 A64SysReg_TRCEVENTCTL0R = 0x8840, // 10 001 0000 1000 000
691 A64SysReg_TRCEVENTCTL1R = 0x8848, // 10 001 0000 1001 000
692 A64SysReg_TRCSTALLCTLR = 0x8858, // 10 001 0000 1011 000
693 A64SysReg_TRCTSCTLR = 0x8860, // 10 001 0000 1100 000
694 A64SysReg_TRCSYNCPR = 0x8868, // 10 001 0000 1101 000
695 A64SysReg_TRCCCCTLR = 0x8870, // 10 001 0000 1110 000
696 A64SysReg_TRCBBCTLR = 0x8878, // 10 001 0000 1111 000
697 A64SysReg_TRCTRACEIDR = 0x8801, // 10 001 0000 0000 001
698 A64SysReg_TRCQCTLR = 0x8809, // 10 001 0000 0001 001
699 A64SysReg_TRCVICTLR = 0x8802, // 10 001 0000 0000 010
700 A64SysReg_TRCVIIECTLR = 0x880a, // 10 001 0000 0001 010
701 A64SysReg_TRCVISSCTLR = 0x8812, // 10 001 0000 0010 010
702 A64SysReg_TRCVIPCSSCTLR = 0x881a, // 10 001 0000 0011 010
703 A64SysReg_TRCVDCTLR = 0x8842, // 10 001 0000 1000 010
704 A64SysReg_TRCVDSACCTLR = 0x884a, // 10 001 0000 1001 010
705 A64SysReg_TRCVDARCCTLR = 0x8852, // 10 001 0000 1010 010
706 A64SysReg_TRCSEQEVR0 = 0x8804, // 10 001 0000 0000 100
707 A64SysReg_TRCSEQEVR1 = 0x880c, // 10 001 0000 0001 100
708 A64SysReg_TRCSEQEVR2 = 0x8814, // 10 001 0000 0010 100
709 A64SysReg_TRCSEQRSTEVR = 0x8834, // 10 001 0000 0110 100
710 A64SysReg_TRCSEQSTR = 0x883c, // 10 001 0000 0111 100
711 A64SysReg_TRCEXTINSELR = 0x8844, // 10 001 0000 1000 100
712 A64SysReg_TRCCNTRLDVR0 = 0x8805, // 10 001 0000 0000 101
713 A64SysReg_TRCCNTRLDVR1 = 0x880d, // 10 001 0000 0001 101
714 A64SysReg_TRCCNTRLDVR2 = 0x8815, // 10 001 0000 0010 101
715 A64SysReg_TRCCNTRLDVR3 = 0x881d, // 10 001 0000 0011 101
716 A64SysReg_TRCCNTCTLR0 = 0x8825, // 10 001 0000 0100 101
717 A64SysReg_TRCCNTCTLR1 = 0x882d, // 10 001 0000 0101 101
718 A64SysReg_TRCCNTCTLR2 = 0x8835, // 10 001 0000 0110 101
719 A64SysReg_TRCCNTCTLR3 = 0x883d, // 10 001 0000 0111 101
720 A64SysReg_TRCCNTVR0 = 0x8845, // 10 001 0000 1000 101
721 A64SysReg_TRCCNTVR1 = 0x884d, // 10 001 0000 1001 101
722 A64SysReg_TRCCNTVR2 = 0x8855, // 10 001 0000 1010 101
723 A64SysReg_TRCCNTVR3 = 0x885d, // 10 001 0000 1011 101
724 A64SysReg_TRCIMSPEC0 = 0x8807, // 10 001 0000 0000 111
725 A64SysReg_TRCIMSPEC1 = 0x880f, // 10 001 0000 0001 111
726 A64SysReg_TRCIMSPEC2 = 0x8817, // 10 001 0000 0010 111
727 A64SysReg_TRCIMSPEC3 = 0x881f, // 10 001 0000 0011 111
728 A64SysReg_TRCIMSPEC4 = 0x8827, // 10 001 0000 0100 111
729 A64SysReg_TRCIMSPEC5 = 0x882f, // 10 001 0000 0101 111
730 A64SysReg_TRCIMSPEC6 = 0x8837, // 10 001 0000 0110 111
731 A64SysReg_TRCIMSPEC7 = 0x883f, // 10 001 0000 0111 111
732 A64SysReg_TRCRSCTLR2 = 0x8890, // 10 001 0001 0010 000
733 A64SysReg_TRCRSCTLR3 = 0x8898, // 10 001 0001 0011 000
734 A64SysReg_TRCRSCTLR4 = 0x88a0, // 10 001 0001 0100 000
735 A64SysReg_TRCRSCTLR5 = 0x88a8, // 10 001 0001 0101 000
736 A64SysReg_TRCRSCTLR6 = 0x88b0, // 10 001 0001 0110 000
737 A64SysReg_TRCRSCTLR7 = 0x88b8, // 10 001 0001 0111 000
738 A64SysReg_TRCRSCTLR8 = 0x88c0, // 10 001 0001 1000 000
739 A64SysReg_TRCRSCTLR9 = 0x88c8, // 10 001 0001 1001 000
740 A64SysReg_TRCRSCTLR10 = 0x88d0, // 10 001 0001 1010 000
741 A64SysReg_TRCRSCTLR11 = 0x88d8, // 10 001 0001 1011 000
742 A64SysReg_TRCRSCTLR12 = 0x88e0, // 10 001 0001 1100 000
743 A64SysReg_TRCRSCTLR13 = 0x88e8, // 10 001 0001 1101 000
744 A64SysReg_TRCRSCTLR14 = 0x88f0, // 10 001 0001 1110 000
745 A64SysReg_TRCRSCTLR15 = 0x88f8, // 10 001 0001 1111 000
746 A64SysReg_TRCRSCTLR16 = 0x8881, // 10 001 0001 0000 001
747 A64SysReg_TRCRSCTLR17 = 0x8889, // 10 001 0001 0001 001
748 A64SysReg_TRCRSCTLR18 = 0x8891, // 10 001 0001 0010 001
749 A64SysReg_TRCRSCTLR19 = 0x8899, // 10 001 0001 0011 001
750 A64SysReg_TRCRSCTLR20 = 0x88a1, // 10 001 0001 0100 001
751 A64SysReg_TRCRSCTLR21 = 0x88a9, // 10 001 0001 0101 001
752 A64SysReg_TRCRSCTLR22 = 0x88b1, // 10 001 0001 0110 001
753 A64SysReg_TRCRSCTLR23 = 0x88b9, // 10 001 0001 0111 001
754 A64SysReg_TRCRSCTLR24 = 0x88c1, // 10 001 0001 1000 001
755 A64SysReg_TRCRSCTLR25 = 0x88c9, // 10 001 0001 1001 001
756 A64SysReg_TRCRSCTLR26 = 0x88d1, // 10 001 0001 1010 001
757 A64SysReg_TRCRSCTLR27 = 0x88d9, // 10 001 0001 1011 001
758 A64SysReg_TRCRSCTLR28 = 0x88e1, // 10 001 0001 1100 001
759 A64SysReg_TRCRSCTLR29 = 0x88e9, // 10 001 0001 1101 001
760 A64SysReg_TRCRSCTLR30 = 0x88f1, // 10 001 0001 1110 001
761 A64SysReg_TRCRSCTLR31 = 0x88f9, // 10 001 0001 1111 001
762 A64SysReg_TRCSSCCR0 = 0x8882, // 10 001 0001 0000 010
763 A64SysReg_TRCSSCCR1 = 0x888a, // 10 001 0001 0001 010
764 A64SysReg_TRCSSCCR2 = 0x8892, // 10 001 0001 0010 010
765 A64SysReg_TRCSSCCR3 = 0x889a, // 10 001 0001 0011 010
766 A64SysReg_TRCSSCCR4 = 0x88a2, // 10 001 0001 0100 010
767 A64SysReg_TRCSSCCR5 = 0x88aa, // 10 001 0001 0101 010
768 A64SysReg_TRCSSCCR6 = 0x88b2, // 10 001 0001 0110 010
769 A64SysReg_TRCSSCCR7 = 0x88ba, // 10 001 0001 0111 010
770 A64SysReg_TRCSSCSR0 = 0x88c2, // 10 001 0001 1000 010
771 A64SysReg_TRCSSCSR1 = 0x88ca, // 10 001 0001 1001 010
772 A64SysReg_TRCSSCSR2 = 0x88d2, // 10 001 0001 1010 010
773 A64SysReg_TRCSSCSR3 = 0x88da, // 10 001 0001 1011 010
774 A64SysReg_TRCSSCSR4 = 0x88e2, // 10 001 0001 1100 010
775 A64SysReg_TRCSSCSR5 = 0x88ea, // 10 001 0001 1101 010
776 A64SysReg_TRCSSCSR6 = 0x88f2, // 10 001 0001 1110 010
777 A64SysReg_TRCSSCSR7 = 0x88fa, // 10 001 0001 1111 010
778 A64SysReg_TRCSSPCICR0 = 0x8883, // 10 001 0001 0000 011
779 A64SysReg_TRCSSPCICR1 = 0x888b, // 10 001 0001 0001 011
780 A64SysReg_TRCSSPCICR2 = 0x8893, // 10 001 0001 0010 011
781 A64SysReg_TRCSSPCICR3 = 0x889b, // 10 001 0001 0011 011
782 A64SysReg_TRCSSPCICR4 = 0x88a3, // 10 001 0001 0100 011
783 A64SysReg_TRCSSPCICR5 = 0x88ab, // 10 001 0001 0101 011
784 A64SysReg_TRCSSPCICR6 = 0x88b3, // 10 001 0001 0110 011
785 A64SysReg_TRCSSPCICR7 = 0x88bb, // 10 001 0001 0111 011
786 A64SysReg_TRCPDCR = 0x88a4, // 10 001 0001 0100 100
787 A64SysReg_TRCACVR0 = 0x8900, // 10 001 0010 0000 000
788 A64SysReg_TRCACVR1 = 0x8910, // 10 001 0010 0010 000
789 A64SysReg_TRCACVR2 = 0x8920, // 10 001 0010 0100 000
790 A64SysReg_TRCACVR3 = 0x8930, // 10 001 0010 0110 000
791 A64SysReg_TRCACVR4 = 0x8940, // 10 001 0010 1000 000
792 A64SysReg_TRCACVR5 = 0x8950, // 10 001 0010 1010 000
793 A64SysReg_TRCACVR6 = 0x8960, // 10 001 0010 1100 000
794 A64SysReg_TRCACVR7 = 0x8970, // 10 001 0010 1110 000
795 A64SysReg_TRCACVR8 = 0x8901, // 10 001 0010 0000 001
796 A64SysReg_TRCACVR9 = 0x8911, // 10 001 0010 0010 001
797 A64SysReg_TRCACVR10 = 0x8921, // 10 001 0010 0100 001
798 A64SysReg_TRCACVR11 = 0x8931, // 10 001 0010 0110 001
799 A64SysReg_TRCACVR12 = 0x8941, // 10 001 0010 1000 001
800 A64SysReg_TRCACVR13 = 0x8951, // 10 001 0010 1010 001
801 A64SysReg_TRCACVR14 = 0x8961, // 10 001 0010 1100 001
802 A64SysReg_TRCACVR15 = 0x8971, // 10 001 0010 1110 001
803 A64SysReg_TRCACATR0 = 0x8902, // 10 001 0010 0000 010
804 A64SysReg_TRCACATR1 = 0x8912, // 10 001 0010 0010 010
805 A64SysReg_TRCACATR2 = 0x8922, // 10 001 0010 0100 010
806 A64SysReg_TRCACATR3 = 0x8932, // 10 001 0010 0110 010
807 A64SysReg_TRCACATR4 = 0x8942, // 10 001 0010 1000 010
808 A64SysReg_TRCACATR5 = 0x8952, // 10 001 0010 1010 010
809 A64SysReg_TRCACATR6 = 0x8962, // 10 001 0010 1100 010
810 A64SysReg_TRCACATR7 = 0x8972, // 10 001 0010 1110 010
811 A64SysReg_TRCACATR8 = 0x8903, // 10 001 0010 0000 011
812 A64SysReg_TRCACATR9 = 0x8913, // 10 001 0010 0010 011
813 A64SysReg_TRCACATR10 = 0x8923, // 10 001 0010 0100 011
814 A64SysReg_TRCACATR11 = 0x8933, // 10 001 0010 0110 011
815 A64SysReg_TRCACATR12 = 0x8943, // 10 001 0010 1000 011
816 A64SysReg_TRCACATR13 = 0x8953, // 10 001 0010 1010 011
817 A64SysReg_TRCACATR14 = 0x8963, // 10 001 0010 1100 011
818 A64SysReg_TRCACATR15 = 0x8973, // 10 001 0010 1110 011
819 A64SysReg_TRCDVCVR0 = 0x8904, // 10 001 0010 0000 100
820 A64SysReg_TRCDVCVR1 = 0x8924, // 10 001 0010 0100 100
821 A64SysReg_TRCDVCVR2 = 0x8944, // 10 001 0010 1000 100
822 A64SysReg_TRCDVCVR3 = 0x8964, // 10 001 0010 1100 100
823 A64SysReg_TRCDVCVR4 = 0x8905, // 10 001 0010 0000 101
824 A64SysReg_TRCDVCVR5 = 0x8925, // 10 001 0010 0100 101
825 A64SysReg_TRCDVCVR6 = 0x8945, // 10 001 0010 1000 101
826 A64SysReg_TRCDVCVR7 = 0x8965, // 10 001 0010 1100 101
827 A64SysReg_TRCDVCMR0 = 0x8906, // 10 001 0010 0000 110
828 A64SysReg_TRCDVCMR1 = 0x8926, // 10 001 0010 0100 110
829 A64SysReg_TRCDVCMR2 = 0x8946, // 10 001 0010 1000 110
830 A64SysReg_TRCDVCMR3 = 0x8966, // 10 001 0010 1100 110
831 A64SysReg_TRCDVCMR4 = 0x8907, // 10 001 0010 0000 111
832 A64SysReg_TRCDVCMR5 = 0x8927, // 10 001 0010 0100 111
833 A64SysReg_TRCDVCMR6 = 0x8947, // 10 001 0010 1000 111
834 A64SysReg_TRCDVCMR7 = 0x8967, // 10 001 0010 1100 111
835 A64SysReg_TRCCIDCVR0 = 0x8980, // 10 001 0011 0000 000
836 A64SysReg_TRCCIDCVR1 = 0x8990, // 10 001 0011 0010 000
837 A64SysReg_TRCCIDCVR2 = 0x89a0, // 10 001 0011 0100 000
838 A64SysReg_TRCCIDCVR3 = 0x89b0, // 10 001 0011 0110 000
839 A64SysReg_TRCCIDCVR4 = 0x89c0, // 10 001 0011 1000 000
840 A64SysReg_TRCCIDCVR5 = 0x89d0, // 10 001 0011 1010 000
841 A64SysReg_TRCCIDCVR6 = 0x89e0, // 10 001 0011 1100 000
842 A64SysReg_TRCCIDCVR7 = 0x89f0, // 10 001 0011 1110 000
843 A64SysReg_TRCVMIDCVR0 = 0x8981, // 10 001 0011 0000 001
844 A64SysReg_TRCVMIDCVR1 = 0x8991, // 10 001 0011 0010 001
845 A64SysReg_TRCVMIDCVR2 = 0x89a1, // 10 001 0011 0100 001
846 A64SysReg_TRCVMIDCVR3 = 0x89b1, // 10 001 0011 0110 001
847 A64SysReg_TRCVMIDCVR4 = 0x89c1, // 10 001 0011 1000 001
848 A64SysReg_TRCVMIDCVR5 = 0x89d1, // 10 001 0011 1010 001
849 A64SysReg_TRCVMIDCVR6 = 0x89e1, // 10 001 0011 1100 001
850 A64SysReg_TRCVMIDCVR7 = 0x89f1, // 10 001 0011 1110 001
851 A64SysReg_TRCCIDCCTLR0 = 0x8982, // 10 001 0011 0000 010
852 A64SysReg_TRCCIDCCTLR1 = 0x898a, // 10 001 0011 0001 010
853 A64SysReg_TRCVMIDCCTLR0 = 0x8992, // 10 001 0011 0010 010
854 A64SysReg_TRCVMIDCCTLR1 = 0x899a, // 10 001 0011 0011 010
855 A64SysReg_TRCITCTRL = 0x8b84, // 10 001 0111 0000 100
856 A64SysReg_TRCCLAIMSET = 0x8bc6, // 10 001 0111 1000 110
857 A64SysReg_TRCCLAIMCLR = 0x8bce, // 10 001 0111 1001 110
858
859 // GICv3 registers
860 A64SysReg_ICC_BPR1_EL1 = 0xc663, // 11 000 1100 1100 011
861 A64SysReg_ICC_BPR0_EL1 = 0xc643, // 11 000 1100 1000 011
862 A64SysReg_ICC_PMR_EL1 = 0xc230, // 11 000 0100 0110 000
863 A64SysReg_ICC_CTLR_EL1 = 0xc664, // 11 000 1100 1100 100
864 A64SysReg_ICC_CTLR_EL3 = 0xf664, // 11 110 1100 1100 100
865 A64SysReg_ICC_SRE_EL1 = 0xc665, // 11 000 1100 1100 101
866 A64SysReg_ICC_SRE_EL2 = 0xe64d, // 11 100 1100 1001 101
867 A64SysReg_ICC_SRE_EL3 = 0xf665, // 11 110 1100 1100 101
868 A64SysReg_ICC_IGRPEN0_EL1 = 0xc666, // 11 000 1100 1100 110
869 A64SysReg_ICC_IGRPEN1_EL1 = 0xc667, // 11 000 1100 1100 111
870 A64SysReg_ICC_IGRPEN1_EL3 = 0xf667, // 11 110 1100 1100 111
871 A64SysReg_ICC_SEIEN_EL1 = 0xc668, // 11 000 1100 1101 000
872 A64SysReg_ICC_AP0R0_EL1 = 0xc644, // 11 000 1100 1000 100
873 A64SysReg_ICC_AP0R1_EL1 = 0xc645, // 11 000 1100 1000 101
874 A64SysReg_ICC_AP0R2_EL1 = 0xc646, // 11 000 1100 1000 110
875 A64SysReg_ICC_AP0R3_EL1 = 0xc647, // 11 000 1100 1000 111
876 A64SysReg_ICC_AP1R0_EL1 = 0xc648, // 11 000 1100 1001 000
877 A64SysReg_ICC_AP1R1_EL1 = 0xc649, // 11 000 1100 1001 001
878 A64SysReg_ICC_AP1R2_EL1 = 0xc64a, // 11 000 1100 1001 010
879 A64SysReg_ICC_AP1R3_EL1 = 0xc64b, // 11 000 1100 1001 011
880 A64SysReg_ICH_AP0R0_EL2 = 0xe640, // 11 100 1100 1000 000
881 A64SysReg_ICH_AP0R1_EL2 = 0xe641, // 11 100 1100 1000 001
882 A64SysReg_ICH_AP0R2_EL2 = 0xe642, // 11 100 1100 1000 010
883 A64SysReg_ICH_AP0R3_EL2 = 0xe643, // 11 100 1100 1000 011
884 A64SysReg_ICH_AP1R0_EL2 = 0xe648, // 11 100 1100 1001 000
885 A64SysReg_ICH_AP1R1_EL2 = 0xe649, // 11 100 1100 1001 001
886 A64SysReg_ICH_AP1R2_EL2 = 0xe64a, // 11 100 1100 1001 010
887 A64SysReg_ICH_AP1R3_EL2 = 0xe64b, // 11 100 1100 1001 011
888 A64SysReg_ICH_HCR_EL2 = 0xe658, // 11 100 1100 1011 000
889 A64SysReg_ICH_MISR_EL2 = 0xe65a, // 11 100 1100 1011 010
890 A64SysReg_ICH_VMCR_EL2 = 0xe65f, // 11 100 1100 1011 111
891 A64SysReg_ICH_VSEIR_EL2 = 0xe64c, // 11 100 1100 1001 100
892 A64SysReg_ICH_LR0_EL2 = 0xe660, // 11 100 1100 1100 000
893 A64SysReg_ICH_LR1_EL2 = 0xe661, // 11 100 1100 1100 001
894 A64SysReg_ICH_LR2_EL2 = 0xe662, // 11 100 1100 1100 010
895 A64SysReg_ICH_LR3_EL2 = 0xe663, // 11 100 1100 1100 011
896 A64SysReg_ICH_LR4_EL2 = 0xe664, // 11 100 1100 1100 100
897 A64SysReg_ICH_LR5_EL2 = 0xe665, // 11 100 1100 1100 101
898 A64SysReg_ICH_LR6_EL2 = 0xe666, // 11 100 1100 1100 110
899 A64SysReg_ICH_LR7_EL2 = 0xe667, // 11 100 1100 1100 111
900 A64SysReg_ICH_LR8_EL2 = 0xe668, // 11 100 1100 1101 000
901 A64SysReg_ICH_LR9_EL2 = 0xe669, // 11 100 1100 1101 001
902 A64SysReg_ICH_LR10_EL2 = 0xe66a, // 11 100 1100 1101 010
903 A64SysReg_ICH_LR11_EL2 = 0xe66b, // 11 100 1100 1101 011
904 A64SysReg_ICH_LR12_EL2 = 0xe66c, // 11 100 1100 1101 100
905 A64SysReg_ICH_LR13_EL2 = 0xe66d, // 11 100 1100 1101 101
906 A64SysReg_ICH_LR14_EL2 = 0xe66e, // 11 100 1100 1101 110
907 A64SysReg_ICH_LR15_EL2 = 0xe66f // 11 100 1100 1101 111
908};
909
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800910// Cyclone specific system registers
911enum A64CycloneSysRegValues {
912 A64SysReg_CPM_IOACC_CTL_EL3 = 0xff90
913};
914
915enum A64TLBIValues {
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800916 A64TLBI_Invalid = -1, // Op0 Op1 CRn CRm Op2
917 A64TLBI_IPAS2E1IS = 0x6401, // 01 100 1000 0000 001
918 A64TLBI_IPAS2LE1IS = 0x6405, // 01 100 1000 0000 101
919 A64TLBI_VMALLE1IS = 0x4418, // 01 000 1000 0011 000
920 A64TLBI_ALLE2IS = 0x6418, // 01 100 1000 0011 000
921 A64TLBI_ALLE3IS = 0x7418, // 01 110 1000 0011 000
922 A64TLBI_VAE1IS = 0x4419, // 01 000 1000 0011 001
923 A64TLBI_VAE2IS = 0x6419, // 01 100 1000 0011 001
924 A64TLBI_VAE3IS = 0x7419, // 01 110 1000 0011 001
925 A64TLBI_ASIDE1IS = 0x441a, // 01 000 1000 0011 010
926 A64TLBI_VAAE1IS = 0x441b, // 01 000 1000 0011 011
927 A64TLBI_ALLE1IS = 0x641c, // 01 100 1000 0011 100
928 A64TLBI_VALE1IS = 0x441d, // 01 000 1000 0011 101
929 A64TLBI_VALE2IS = 0x641d, // 01 100 1000 0011 101
930 A64TLBI_VALE3IS = 0x741d, // 01 110 1000 0011 101
931 A64TLBI_VMALLS12E1IS = 0x641e, // 01 100 1000 0011 110
932 A64TLBI_VAALE1IS = 0x441f, // 01 000 1000 0011 111
933 A64TLBI_IPAS2E1 = 0x6421, // 01 100 1000 0100 001
934 A64TLBI_IPAS2LE1 = 0x6425, // 01 100 1000 0100 101
935 A64TLBI_VMALLE1 = 0x4438, // 01 000 1000 0111 000
936 A64TLBI_ALLE2 = 0x6438, // 01 100 1000 0111 000
937 A64TLBI_ALLE3 = 0x7438, // 01 110 1000 0111 000
938 A64TLBI_VAE1 = 0x4439, // 01 000 1000 0111 001
939 A64TLBI_VAE2 = 0x6439, // 01 100 1000 0111 001
940 A64TLBI_VAE3 = 0x7439, // 01 110 1000 0111 001
941 A64TLBI_ASIDE1 = 0x443a, // 01 000 1000 0111 010
942 A64TLBI_VAAE1 = 0x443b, // 01 000 1000 0111 011
943 A64TLBI_ALLE1 = 0x643c, // 01 100 1000 0111 100
944 A64TLBI_VALE1 = 0x443d, // 01 000 1000 0111 101
945 A64TLBI_VALE2 = 0x643d, // 01 100 1000 0111 101
946 A64TLBI_VALE3 = 0x743d, // 01 110 1000 0111 101
947 A64TLBI_VMALLS12E1 = 0x643e, // 01 100 1000 0111 110
948 A64TLBI_VAALE1 = 0x443f // 01 000 1000 0111 111
949};
950
951bool A64Imms_isLogicalImmBits(unsigned RegWidth, uint32_t Bits, uint64_t *Imm);
952
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800953char *A64NamedImmMapper_toString(A64NamedImmMapper *N, uint32_t Value, bool *Valid);
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800954
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800955uint32_t A64NamedImmMapper_fromString(A64NamedImmMapper *N, char *Name, bool *Valid);
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800956
Nguyen Anh Quynh46a74e52014-08-25 16:47:12 +0800957bool A64NamedImmMapper_validImm(A64NamedImmMapper *N, uint32_t Value);
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800958
Nguyen Anh Quynh3e4c3572015-03-03 22:58:54 +0800959void A64SysRegMapper_toString(A64SysRegMapper *S, uint32_t Bits, char *result);
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +0800960
961#endif