miscregs.hh revision 12816
112339Sjason@lowepower.com/* 212339Sjason@lowepower.com * Copyright (c) 2010-2018 ARM Limited 312339Sjason@lowepower.com * All rights reserved 412339Sjason@lowepower.com * 512339Sjason@lowepower.com * The license below extends only to copyright in the software and shall 612339Sjason@lowepower.com * not be construed as granting a license to any other intellectual 712339Sjason@lowepower.com * property including but not limited to intellectual property relating 812339Sjason@lowepower.com * to a hardware implementation of the functionality of the software 912339Sjason@lowepower.com * licensed hereunder. You may use the software subject to the license 1012339Sjason@lowepower.com * terms below provided that you ensure that this notice is replicated 1112339Sjason@lowepower.com * unmodified and in its entirety in all distributions of the software, 1212339Sjason@lowepower.com * modified or unmodified, in source code or in binary form. 1312339Sjason@lowepower.com * 1412339Sjason@lowepower.com * Copyright (c) 2009 The Regents of The University of Michigan 1512339Sjason@lowepower.com * All rights reserved. 1612339Sjason@lowepower.com * 1712339Sjason@lowepower.com * Redistribution and use in source and binary forms, with or without 1812339Sjason@lowepower.com * modification, are permitted provided that the following conditions are 1912339Sjason@lowepower.com * met: redistributions of source code must retain the above copyright 2012339Sjason@lowepower.com * notice, this list of conditions and the following disclaimer; 2112339Sjason@lowepower.com * redistributions in binary form must reproduce the above copyright 2212339Sjason@lowepower.com * notice, this list of conditions and the following disclaimer in the 2312339Sjason@lowepower.com * documentation and/or other materials provided with the distribution; 2412339Sjason@lowepower.com * neither the name of the copyright holders nor the names of its 2512339Sjason@lowepower.com * contributors may be used to endorse or promote products derived from 2612339Sjason@lowepower.com * this software without specific prior written permission. 2712339Sjason@lowepower.com * 2812339Sjason@lowepower.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2912339Sjason@lowepower.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3012339Sjason@lowepower.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 3112339Sjason@lowepower.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3212339Sjason@lowepower.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3312339Sjason@lowepower.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3412339Sjason@lowepower.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3512339Sjason@lowepower.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3612339Sjason@lowepower.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3712339Sjason@lowepower.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3814252Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3912339Sjason@lowepower.com * 4012339Sjason@lowepower.com * Authors: Gabe Black 4112339Sjason@lowepower.com * Giacomo Gabrielli 4212339Sjason@lowepower.com */ 4312339Sjason@lowepower.com#ifndef __ARCH_ARM_MISCREGS_HH__ 4412339Sjason@lowepower.com#define __ARCH_ARM_MISCREGS_HH__ 4512339Sjason@lowepower.com 4612339Sjason@lowepower.com#include <bitset> 4712339Sjason@lowepower.com#include <tuple> 4812339Sjason@lowepower.com 4912339Sjason@lowepower.com#include "base/bitunion.hh" 5012339Sjason@lowepower.com#include "base/compiler.hh" 5112339Sjason@lowepower.com 5212339Sjason@lowepower.comclass ThreadContext; 5312339Sjason@lowepower.com 5413784Sgabeblack@google.com 5513784Sgabeblack@google.comnamespace ArmISA 5612339Sjason@lowepower.com{ 5712339Sjason@lowepower.com enum MiscRegIndex { 5812339Sjason@lowepower.com MISCREG_CPSR = 0, // 0 5913841Sjason@lowepower.com MISCREG_SPSR, // 1 6013841Sjason@lowepower.com MISCREG_SPSR_FIQ, // 2 6112339Sjason@lowepower.com MISCREG_SPSR_IRQ, // 3 6213784Sgabeblack@google.com MISCREG_SPSR_SVC, // 4 6312339Sjason@lowepower.com MISCREG_SPSR_MON, // 5 6412339Sjason@lowepower.com MISCREG_SPSR_ABT, // 6 6512339Sjason@lowepower.com MISCREG_SPSR_HYP, // 7 6612339Sjason@lowepower.com MISCREG_SPSR_UND, // 8 6714252Sgabeblack@google.com MISCREG_ELR_HYP, // 9 6812339Sjason@lowepower.com MISCREG_FPSID, // 10 6912339Sjason@lowepower.com MISCREG_FPSCR, // 11 7012339Sjason@lowepower.com MISCREG_MVFR1, // 12 7112339Sjason@lowepower.com MISCREG_MVFR0, // 13 7212339Sjason@lowepower.com MISCREG_FPEXC, // 14 7312339Sjason@lowepower.com 7412339Sjason@lowepower.com // Helper registers 7512339Sjason@lowepower.com MISCREG_CPSR_MODE, // 15 7612339Sjason@lowepower.com MISCREG_CPSR_Q, // 16 7712339Sjason@lowepower.com MISCREG_FPSCR_EXC, // 17 7812339Sjason@lowepower.com MISCREG_FPSCR_QC, // 18 7912339Sjason@lowepower.com MISCREG_LOCKADDR, // 19 8012339Sjason@lowepower.com MISCREG_LOCKFLAG, // 20 8112339Sjason@lowepower.com MISCREG_PRRR_MAIR0, // 21 8212339Sjason@lowepower.com MISCREG_PRRR_MAIR0_NS, // 22 8312339Sjason@lowepower.com MISCREG_PRRR_MAIR0_S, // 23 8412339Sjason@lowepower.com MISCREG_NMRR_MAIR1, // 24 8512339Sjason@lowepower.com MISCREG_NMRR_MAIR1_NS, // 25 8612339Sjason@lowepower.com MISCREG_NMRR_MAIR1_S, // 26 8712339Sjason@lowepower.com MISCREG_PMXEVTYPER_PMCCFILTR, // 27 8812339Sjason@lowepower.com MISCREG_SCTLR_RST, // 28 8912339Sjason@lowepower.com MISCREG_SEV_MAILBOX, // 29 9012339Sjason@lowepower.com 9112339Sjason@lowepower.com // AArch32 CP14 registers (debug/trace/ThumbEE/Jazelle control) 9212339Sjason@lowepower.com MISCREG_DBGDIDR, // 30 9312339Sjason@lowepower.com MISCREG_DBGDSCRint, // 31 9412339Sjason@lowepower.com MISCREG_DBGDCCINT, // 32 9512339Sjason@lowepower.com MISCREG_DBGDTRTXint, // 33 9612339Sjason@lowepower.com MISCREG_DBGDTRRXint, // 34 9712339Sjason@lowepower.com MISCREG_DBGWFAR, // 35 9812339Sjason@lowepower.com MISCREG_DBGVCR, // 36 9912339Sjason@lowepower.com MISCREG_DBGDTRRXext, // 37 10012339Sjason@lowepower.com MISCREG_DBGDSCRext, // 38 10112339Sjason@lowepower.com MISCREG_DBGDTRTXext, // 39 10212339Sjason@lowepower.com MISCREG_DBGOSECCR, // 40 10312339Sjason@lowepower.com MISCREG_DBGBVR0, // 41 10412339Sjason@lowepower.com MISCREG_DBGBVR1, // 42 10512339Sjason@lowepower.com MISCREG_DBGBVR2, // 43 10612339Sjason@lowepower.com MISCREG_DBGBVR3, // 44 10712339Sjason@lowepower.com MISCREG_DBGBVR4, // 45 10812339Sjason@lowepower.com MISCREG_DBGBVR5, // 46 10912339Sjason@lowepower.com MISCREG_DBGBCR0, // 47 11012339Sjason@lowepower.com MISCREG_DBGBCR1, // 48 11112339Sjason@lowepower.com MISCREG_DBGBCR2, // 49 11212339Sjason@lowepower.com MISCREG_DBGBCR3, // 50 11312339Sjason@lowepower.com MISCREG_DBGBCR4, // 51 11412339Sjason@lowepower.com MISCREG_DBGBCR5, // 52 11512339Sjason@lowepower.com MISCREG_DBGWVR0, // 53 11612339Sjason@lowepower.com MISCREG_DBGWVR1, // 54 11712339Sjason@lowepower.com MISCREG_DBGWVR2, // 55 11812339Sjason@lowepower.com MISCREG_DBGWVR3, // 56 11912339Sjason@lowepower.com MISCREG_DBGWCR0, // 57 12012339Sjason@lowepower.com MISCREG_DBGWCR1, // 58 12112339Sjason@lowepower.com MISCREG_DBGWCR2, // 59 12212339Sjason@lowepower.com MISCREG_DBGWCR3, // 60 12312339Sjason@lowepower.com MISCREG_DBGDRAR, // 61 12412339Sjason@lowepower.com MISCREG_DBGBXVR4, // 62 12512339Sjason@lowepower.com MISCREG_DBGBXVR5, // 63 12612339Sjason@lowepower.com MISCREG_DBGOSLAR, // 64 12712339Sjason@lowepower.com MISCREG_DBGOSLSR, // 65 12812339Sjason@lowepower.com MISCREG_DBGOSDLR, // 66 12912339Sjason@lowepower.com MISCREG_DBGPRCR, // 67 13012339Sjason@lowepower.com MISCREG_DBGDSAR, // 68 13112339Sjason@lowepower.com MISCREG_DBGCLAIMSET, // 69 13212339Sjason@lowepower.com MISCREG_DBGCLAIMCLR, // 70 13312339Sjason@lowepower.com MISCREG_DBGAUTHSTATUS, // 71 13412339Sjason@lowepower.com MISCREG_DBGDEVID2, // 72 13512339Sjason@lowepower.com MISCREG_DBGDEVID1, // 73 13612339Sjason@lowepower.com MISCREG_DBGDEVID0, // 74 13712339Sjason@lowepower.com MISCREG_TEECR, // 75, not in ARM DDI 0487A.b+ 13812339Sjason@lowepower.com MISCREG_JIDR, // 76 13912339Sjason@lowepower.com MISCREG_TEEHBR, // 77, not in ARM DDI 0487A.b+ 14012339Sjason@lowepower.com MISCREG_JOSCR, // 78 14112339Sjason@lowepower.com MISCREG_JMCR, // 79 14212339Sjason@lowepower.com 14312339Sjason@lowepower.com // AArch32 CP15 registers (system control) 14412339Sjason@lowepower.com MISCREG_MIDR, // 80 14512339Sjason@lowepower.com MISCREG_CTR, // 81 14612339Sjason@lowepower.com MISCREG_TCMTR, // 82 14712339Sjason@lowepower.com MISCREG_TLBTR, // 83 14812339Sjason@lowepower.com MISCREG_MPIDR, // 84 14912339Sjason@lowepower.com MISCREG_REVIDR, // 85 15012339Sjason@lowepower.com MISCREG_ID_PFR0, // 86 15112339Sjason@lowepower.com MISCREG_ID_PFR1, // 87 15212339Sjason@lowepower.com MISCREG_ID_DFR0, // 88 15312339Sjason@lowepower.com MISCREG_ID_AFR0, // 89 15412339Sjason@lowepower.com MISCREG_ID_MMFR0, // 90 15512339Sjason@lowepower.com MISCREG_ID_MMFR1, // 91 15612339Sjason@lowepower.com MISCREG_ID_MMFR2, // 92 15712339Sjason@lowepower.com MISCREG_ID_MMFR3, // 93 15812339Sjason@lowepower.com MISCREG_ID_ISAR0, // 94 15912339Sjason@lowepower.com MISCREG_ID_ISAR1, // 95 16012339Sjason@lowepower.com MISCREG_ID_ISAR2, // 96 16112339Sjason@lowepower.com MISCREG_ID_ISAR3, // 97 16212339Sjason@lowepower.com MISCREG_ID_ISAR4, // 98 16312339Sjason@lowepower.com MISCREG_ID_ISAR5, // 99 16412339Sjason@lowepower.com MISCREG_CCSIDR, // 100 16512339Sjason@lowepower.com MISCREG_CLIDR, // 101 16612339Sjason@lowepower.com MISCREG_AIDR, // 102 16712339Sjason@lowepower.com MISCREG_CSSELR, // 103 16812339Sjason@lowepower.com MISCREG_CSSELR_NS, // 104 16912339Sjason@lowepower.com MISCREG_CSSELR_S, // 105 17012339Sjason@lowepower.com MISCREG_VPIDR, // 106 17112339Sjason@lowepower.com MISCREG_VMPIDR, // 107 17212339Sjason@lowepower.com MISCREG_SCTLR, // 108 17312339Sjason@lowepower.com MISCREG_SCTLR_NS, // 109 17412339Sjason@lowepower.com MISCREG_SCTLR_S, // 110 17512339Sjason@lowepower.com MISCREG_ACTLR, // 111 17612339Sjason@lowepower.com MISCREG_ACTLR_NS, // 112 17712339Sjason@lowepower.com MISCREG_ACTLR_S, // 113 17812339Sjason@lowepower.com MISCREG_CPACR, // 114 17912339Sjason@lowepower.com MISCREG_SCR, // 115 18012339Sjason@lowepower.com MISCREG_SDER, // 116 18112339Sjason@lowepower.com MISCREG_NSACR, // 117 18212339Sjason@lowepower.com MISCREG_HSCTLR, // 118 18312339Sjason@lowepower.com MISCREG_HACTLR, // 119 18412339Sjason@lowepower.com MISCREG_HCR, // 120 18512339Sjason@lowepower.com MISCREG_HDCR, // 121 18612339Sjason@lowepower.com MISCREG_HCPTR, // 122 18712339Sjason@lowepower.com MISCREG_HSTR, // 123 18812339Sjason@lowepower.com MISCREG_HACR, // 124 18912339Sjason@lowepower.com MISCREG_TTBR0, // 125 19012339Sjason@lowepower.com MISCREG_TTBR0_NS, // 126 19112339Sjason@lowepower.com MISCREG_TTBR0_S, // 127 19212339Sjason@lowepower.com MISCREG_TTBR1, // 128 19312339Sjason@lowepower.com MISCREG_TTBR1_NS, // 129 19412339Sjason@lowepower.com MISCREG_TTBR1_S, // 130 19512339Sjason@lowepower.com MISCREG_TTBCR, // 131 19612339Sjason@lowepower.com MISCREG_TTBCR_NS, // 132 19712339Sjason@lowepower.com MISCREG_TTBCR_S, // 133 19812339Sjason@lowepower.com MISCREG_HTCR, // 134 19912339Sjason@lowepower.com MISCREG_VTCR, // 135 20012339Sjason@lowepower.com MISCREG_DACR, // 136 20112339Sjason@lowepower.com MISCREG_DACR_NS, // 137 20212339Sjason@lowepower.com MISCREG_DACR_S, // 138 20312339Sjason@lowepower.com MISCREG_DFSR, // 139 20412339Sjason@lowepower.com MISCREG_DFSR_NS, // 140 20512339Sjason@lowepower.com MISCREG_DFSR_S, // 141 20612339Sjason@lowepower.com MISCREG_IFSR, // 142 20712339Sjason@lowepower.com MISCREG_IFSR_NS, // 143 20812339Sjason@lowepower.com MISCREG_IFSR_S, // 144 20912339Sjason@lowepower.com MISCREG_ADFSR, // 145 21012339Sjason@lowepower.com MISCREG_ADFSR_NS, // 146 21112339Sjason@lowepower.com MISCREG_ADFSR_S, // 147 21212339Sjason@lowepower.com MISCREG_AIFSR, // 148 21312339Sjason@lowepower.com MISCREG_AIFSR_NS, // 149 21412339Sjason@lowepower.com MISCREG_AIFSR_S, // 150 21512339Sjason@lowepower.com MISCREG_HADFSR, // 151 21612339Sjason@lowepower.com MISCREG_HAIFSR, // 152 21712339Sjason@lowepower.com MISCREG_HSR, // 153 21812339Sjason@lowepower.com MISCREG_DFAR, // 154 21912339Sjason@lowepower.com MISCREG_DFAR_NS, // 155 22012339Sjason@lowepower.com MISCREG_DFAR_S, // 156 22112339Sjason@lowepower.com MISCREG_IFAR, // 157 22212339Sjason@lowepower.com MISCREG_IFAR_NS, // 158 22312339Sjason@lowepower.com MISCREG_IFAR_S, // 159 22412339Sjason@lowepower.com MISCREG_HDFAR, // 160 22512339Sjason@lowepower.com MISCREG_HIFAR, // 161 22612339Sjason@lowepower.com MISCREG_HPFAR, // 162 22712339Sjason@lowepower.com MISCREG_ICIALLUIS, // 163 22812339Sjason@lowepower.com MISCREG_BPIALLIS, // 164 22912339Sjason@lowepower.com MISCREG_PAR, // 165 23012339Sjason@lowepower.com MISCREG_PAR_NS, // 166 23112339Sjason@lowepower.com MISCREG_PAR_S, // 167 23212339Sjason@lowepower.com MISCREG_ICIALLU, // 168 23312339Sjason@lowepower.com MISCREG_ICIMVAU, // 169 23412339Sjason@lowepower.com MISCREG_CP15ISB, // 170 23512339Sjason@lowepower.com MISCREG_BPIALL, // 171 23612339Sjason@lowepower.com MISCREG_BPIMVA, // 172 23712339Sjason@lowepower.com MISCREG_DCIMVAC, // 173 23812339Sjason@lowepower.com MISCREG_DCISW, // 174 23912339Sjason@lowepower.com MISCREG_ATS1CPR, // 175 24012339Sjason@lowepower.com MISCREG_ATS1CPW, // 176 24112339Sjason@lowepower.com MISCREG_ATS1CUR, // 177 24212339Sjason@lowepower.com MISCREG_ATS1CUW, // 178 24312339Sjason@lowepower.com MISCREG_ATS12NSOPR, // 179 24412339Sjason@lowepower.com MISCREG_ATS12NSOPW, // 180 24512339Sjason@lowepower.com MISCREG_ATS12NSOUR, // 181 24612339Sjason@lowepower.com MISCREG_ATS12NSOUW, // 182 24712339Sjason@lowepower.com MISCREG_DCCMVAC, // 183 24812339Sjason@lowepower.com MISCREG_DCCSW, // 184 24912339Sjason@lowepower.com MISCREG_CP15DSB, // 185 25012339Sjason@lowepower.com MISCREG_CP15DMB, // 186 25112339Sjason@lowepower.com MISCREG_DCCMVAU, // 187 25212339Sjason@lowepower.com MISCREG_DCCIMVAC, // 188 25312339Sjason@lowepower.com MISCREG_DCCISW, // 189 25412339Sjason@lowepower.com MISCREG_ATS1HR, // 190 25512339Sjason@lowepower.com MISCREG_ATS1HW, // 191 25612339Sjason@lowepower.com MISCREG_TLBIALLIS, // 192 25712339Sjason@lowepower.com MISCREG_TLBIMVAIS, // 193 25812339Sjason@lowepower.com MISCREG_TLBIASIDIS, // 194 25912339Sjason@lowepower.com MISCREG_TLBIMVAAIS, // 195 26012339Sjason@lowepower.com MISCREG_TLBIMVALIS, // 196 26112339Sjason@lowepower.com MISCREG_TLBIMVAALIS, // 197 26212339Sjason@lowepower.com MISCREG_ITLBIALL, // 198 26312339Sjason@lowepower.com MISCREG_ITLBIMVA, // 199 26412339Sjason@lowepower.com MISCREG_ITLBIASID, // 200 26512339Sjason@lowepower.com MISCREG_DTLBIALL, // 201 26612339Sjason@lowepower.com MISCREG_DTLBIMVA, // 202 26712339Sjason@lowepower.com MISCREG_DTLBIASID, // 203 26812339Sjason@lowepower.com MISCREG_TLBIALL, // 204 26912339Sjason@lowepower.com MISCREG_TLBIMVA, // 205 27012339Sjason@lowepower.com MISCREG_TLBIASID, // 206 27112339Sjason@lowepower.com MISCREG_TLBIMVAA, // 207 27212339Sjason@lowepower.com MISCREG_TLBIMVAL, // 208 27312339Sjason@lowepower.com MISCREG_TLBIMVAAL, // 209 27412339Sjason@lowepower.com MISCREG_TLBIIPAS2IS, // 210 27512339Sjason@lowepower.com MISCREG_TLBIIPAS2LIS, // 211 27612339Sjason@lowepower.com MISCREG_TLBIALLHIS, // 212 27712339Sjason@lowepower.com MISCREG_TLBIMVAHIS, // 213 27812339Sjason@lowepower.com MISCREG_TLBIALLNSNHIS, // 214 27912339Sjason@lowepower.com MISCREG_TLBIMVALHIS, // 215 28012339Sjason@lowepower.com MISCREG_TLBIIPAS2, // 216 28112339Sjason@lowepower.com MISCREG_TLBIIPAS2L, // 217 28212339Sjason@lowepower.com MISCREG_TLBIALLH, // 218 28312339Sjason@lowepower.com MISCREG_TLBIMVAH, // 219 28412339Sjason@lowepower.com MISCREG_TLBIALLNSNH, // 220 28512339Sjason@lowepower.com MISCREG_TLBIMVALH, // 221 28612339Sjason@lowepower.com MISCREG_PMCR, // 222 28712339Sjason@lowepower.com MISCREG_PMCNTENSET, // 223 28812339Sjason@lowepower.com MISCREG_PMCNTENCLR, // 224 28912339Sjason@lowepower.com MISCREG_PMOVSR, // 225 29012339Sjason@lowepower.com MISCREG_PMSWINC, // 226 29112339Sjason@lowepower.com MISCREG_PMSELR, // 227 29212339Sjason@lowepower.com MISCREG_PMCEID0, // 228 29312339Sjason@lowepower.com MISCREG_PMCEID1, // 229 29412339Sjason@lowepower.com MISCREG_PMCCNTR, // 230 29512339Sjason@lowepower.com MISCREG_PMXEVTYPER, // 231 29612339Sjason@lowepower.com MISCREG_PMCCFILTR, // 232 29712339Sjason@lowepower.com MISCREG_PMXEVCNTR, // 233 29812339Sjason@lowepower.com MISCREG_PMUSERENR, // 234 29912339Sjason@lowepower.com MISCREG_PMINTENSET, // 235 30012339Sjason@lowepower.com MISCREG_PMINTENCLR, // 236 30112339Sjason@lowepower.com MISCREG_PMOVSSET, // 237 30212339Sjason@lowepower.com MISCREG_L2CTLR, // 238 30312339Sjason@lowepower.com MISCREG_L2ECTLR, // 239 30412339Sjason@lowepower.com MISCREG_PRRR, // 240 30512339Sjason@lowepower.com MISCREG_PRRR_NS, // 241 30612339Sjason@lowepower.com MISCREG_PRRR_S, // 242 30712339Sjason@lowepower.com MISCREG_MAIR0, // 243 30812339Sjason@lowepower.com MISCREG_MAIR0_NS, // 244 30912339Sjason@lowepower.com MISCREG_MAIR0_S, // 245 31012339Sjason@lowepower.com MISCREG_NMRR, // 246 31112339Sjason@lowepower.com MISCREG_NMRR_NS, // 247 31212339Sjason@lowepower.com MISCREG_NMRR_S, // 248 31312339Sjason@lowepower.com MISCREG_MAIR1, // 249 31412339Sjason@lowepower.com MISCREG_MAIR1_NS, // 250 31512339Sjason@lowepower.com MISCREG_MAIR1_S, // 251 31612339Sjason@lowepower.com MISCREG_AMAIR0, // 252 31712339Sjason@lowepower.com MISCREG_AMAIR0_NS, // 253 31812339Sjason@lowepower.com MISCREG_AMAIR0_S, // 254 31912339Sjason@lowepower.com MISCREG_AMAIR1, // 255 32012339Sjason@lowepower.com MISCREG_AMAIR1_NS, // 256 32112339Sjason@lowepower.com MISCREG_AMAIR1_S, // 257 32212339Sjason@lowepower.com MISCREG_HMAIR0, // 258 32312339Sjason@lowepower.com MISCREG_HMAIR1, // 259 32412339Sjason@lowepower.com MISCREG_HAMAIR0, // 260 32512339Sjason@lowepower.com MISCREG_HAMAIR1, // 261 32612339Sjason@lowepower.com MISCREG_VBAR, // 262 32712339Sjason@lowepower.com MISCREG_VBAR_NS, // 263 32812339Sjason@lowepower.com MISCREG_VBAR_S, // 264 32912339Sjason@lowepower.com MISCREG_MVBAR, // 265 33012339Sjason@lowepower.com MISCREG_RMR, // 266 33112339Sjason@lowepower.com MISCREG_ISR, // 267 33212339Sjason@lowepower.com MISCREG_HVBAR, // 268 33312339Sjason@lowepower.com MISCREG_FCSEIDR, // 269 33412339Sjason@lowepower.com MISCREG_CONTEXTIDR, // 270 33512339Sjason@lowepower.com MISCREG_CONTEXTIDR_NS, // 271 33612339Sjason@lowepower.com MISCREG_CONTEXTIDR_S, // 272 33712339Sjason@lowepower.com MISCREG_TPIDRURW, // 273 33812339Sjason@lowepower.com MISCREG_TPIDRURW_NS, // 274 33912339Sjason@lowepower.com MISCREG_TPIDRURW_S, // 275 34012339Sjason@lowepower.com MISCREG_TPIDRURO, // 276 34112339Sjason@lowepower.com MISCREG_TPIDRURO_NS, // 277 34212339Sjason@lowepower.com MISCREG_TPIDRURO_S, // 278 34312339Sjason@lowepower.com MISCREG_TPIDRPRW, // 279 34412339Sjason@lowepower.com MISCREG_TPIDRPRW_NS, // 280 34512339Sjason@lowepower.com MISCREG_TPIDRPRW_S, // 281 34612339Sjason@lowepower.com MISCREG_HTPIDR, // 282 34712339Sjason@lowepower.com MISCREG_CNTFRQ, // 283 34812339Sjason@lowepower.com MISCREG_CNTKCTL, // 284 34912339Sjason@lowepower.com MISCREG_CNTP_TVAL, // 285 35012339Sjason@lowepower.com MISCREG_CNTP_TVAL_NS, // 286 35112339Sjason@lowepower.com MISCREG_CNTP_TVAL_S, // 287 35212339Sjason@lowepower.com MISCREG_CNTP_CTL, // 288 35312339Sjason@lowepower.com MISCREG_CNTP_CTL_NS, // 289 35412339Sjason@lowepower.com MISCREG_CNTP_CTL_S, // 290 35512339Sjason@lowepower.com MISCREG_CNTV_TVAL, // 291 35612339Sjason@lowepower.com MISCREG_CNTV_CTL, // 292 35712339Sjason@lowepower.com MISCREG_CNTHCTL, // 293 35812339Sjason@lowepower.com MISCREG_CNTHP_TVAL, // 294 35912339Sjason@lowepower.com MISCREG_CNTHP_CTL, // 295 36012339Sjason@lowepower.com MISCREG_IL1DATA0, // 296 36112339Sjason@lowepower.com MISCREG_IL1DATA1, // 297 36212339Sjason@lowepower.com MISCREG_IL1DATA2, // 298 36312339Sjason@lowepower.com MISCREG_IL1DATA3, // 299 36412339Sjason@lowepower.com MISCREG_DL1DATA0, // 300 36512339Sjason@lowepower.com MISCREG_DL1DATA1, // 301 36612339Sjason@lowepower.com MISCREG_DL1DATA2, // 302 36712339Sjason@lowepower.com MISCREG_DL1DATA3, // 303 36812339Sjason@lowepower.com MISCREG_DL1DATA4, // 304 36912339Sjason@lowepower.com MISCREG_RAMINDEX, // 305 37012339Sjason@lowepower.com MISCREG_L2ACTLR, // 306 37112339Sjason@lowepower.com MISCREG_CBAR, // 307 37212339Sjason@lowepower.com MISCREG_HTTBR, // 308 37312339Sjason@lowepower.com MISCREG_VTTBR, // 309 37412339Sjason@lowepower.com MISCREG_CNTPCT, // 310 37512339Sjason@lowepower.com MISCREG_CNTVCT, // 311 37612339Sjason@lowepower.com MISCREG_CNTP_CVAL, // 312 37712339Sjason@lowepower.com MISCREG_CNTP_CVAL_NS, // 313 37812339Sjason@lowepower.com MISCREG_CNTP_CVAL_S, // 314 37912339Sjason@lowepower.com MISCREG_CNTV_CVAL, // 315 38012339Sjason@lowepower.com MISCREG_CNTVOFF, // 316 38112339Sjason@lowepower.com MISCREG_CNTHP_CVAL, // 317 38212339Sjason@lowepower.com MISCREG_CPUMERRSR, // 318 38312749Sgiacomo.travaglini@arm.com MISCREG_L2MERRSR, // 319 38412749Sgiacomo.travaglini@arm.com 38512749Sgiacomo.travaglini@arm.com // AArch64 registers (Op0=2) 38612339Sjason@lowepower.com MISCREG_MDCCINT_EL1, // 320 38712339Sjason@lowepower.com MISCREG_OSDTRRX_EL1, // 321 38812339Sjason@lowepower.com MISCREG_MDSCR_EL1, // 322 38912339Sjason@lowepower.com MISCREG_OSDTRTX_EL1, // 323 39012339Sjason@lowepower.com MISCREG_OSECCR_EL1, // 324 39112339Sjason@lowepower.com MISCREG_DBGBVR0_EL1, // 325 39212339Sjason@lowepower.com MISCREG_DBGBVR1_EL1, // 326 39312339Sjason@lowepower.com MISCREG_DBGBVR2_EL1, // 327 39412339Sjason@lowepower.com MISCREG_DBGBVR3_EL1, // 328 39512339Sjason@lowepower.com MISCREG_DBGBVR4_EL1, // 329 39612339Sjason@lowepower.com MISCREG_DBGBVR5_EL1, // 330 39712339Sjason@lowepower.com MISCREG_DBGBCR0_EL1, // 331 39812339Sjason@lowepower.com MISCREG_DBGBCR1_EL1, // 332 39912339Sjason@lowepower.com MISCREG_DBGBCR2_EL1, // 333 40012339Sjason@lowepower.com MISCREG_DBGBCR3_EL1, // 334 40112339Sjason@lowepower.com MISCREG_DBGBCR4_EL1, // 335 40212339Sjason@lowepower.com MISCREG_DBGBCR5_EL1, // 336 40312339Sjason@lowepower.com MISCREG_DBGWVR0_EL1, // 337 40412339Sjason@lowepower.com MISCREG_DBGWVR1_EL1, // 338 40512339Sjason@lowepower.com MISCREG_DBGWVR2_EL1, // 339 40612339Sjason@lowepower.com MISCREG_DBGWVR3_EL1, // 340 40712339Sjason@lowepower.com MISCREG_DBGWCR0_EL1, // 341 40812339Sjason@lowepower.com MISCREG_DBGWCR1_EL1, // 342 40912339Sjason@lowepower.com MISCREG_DBGWCR2_EL1, // 343 41012339Sjason@lowepower.com MISCREG_DBGWCR3_EL1, // 344 41112339Sjason@lowepower.com MISCREG_MDCCSR_EL0, // 345 41212339Sjason@lowepower.com MISCREG_MDDTR_EL0, // 346 41312339Sjason@lowepower.com MISCREG_MDDTRTX_EL0, // 347 41412339Sjason@lowepower.com MISCREG_MDDTRRX_EL0, // 348 41512339Sjason@lowepower.com MISCREG_DBGVCR32_EL2, // 349 41612339Sjason@lowepower.com MISCREG_MDRAR_EL1, // 350 41712339Sjason@lowepower.com MISCREG_OSLAR_EL1, // 351 41812339Sjason@lowepower.com MISCREG_OSLSR_EL1, // 352 41912339Sjason@lowepower.com MISCREG_OSDLR_EL1, // 353 42012339Sjason@lowepower.com MISCREG_DBGPRCR_EL1, // 354 42112339Sjason@lowepower.com MISCREG_DBGCLAIMSET_EL1, // 355 42212339Sjason@lowepower.com MISCREG_DBGCLAIMCLR_EL1, // 356 42312339Sjason@lowepower.com MISCREG_DBGAUTHSTATUS_EL1, // 357 42412339Sjason@lowepower.com MISCREG_TEECR32_EL1, // 358, not in ARM DDI 0487A.b+ 42512339Sjason@lowepower.com MISCREG_TEEHBR32_EL1, // 359, not in ARM DDI 0487A.b+ 42612339Sjason@lowepower.com 42712339Sjason@lowepower.com // AArch64 registers (Op0=1,3) 42812339Sjason@lowepower.com MISCREG_MIDR_EL1, // 360 42912339Sjason@lowepower.com MISCREG_MPIDR_EL1, // 361 43014252Sgabeblack@google.com MISCREG_REVIDR_EL1, // 362 43112339Sjason@lowepower.com MISCREG_ID_PFR0_EL1, // 363 43212339Sjason@lowepower.com MISCREG_ID_PFR1_EL1, // 364 43312339Sjason@lowepower.com MISCREG_ID_DFR0_EL1, // 365 43412339Sjason@lowepower.com MISCREG_ID_AFR0_EL1, // 366 43512339Sjason@lowepower.com MISCREG_ID_MMFR0_EL1, // 367 43612339Sjason@lowepower.com MISCREG_ID_MMFR1_EL1, // 368 43712339Sjason@lowepower.com MISCREG_ID_MMFR2_EL1, // 369 43812339Sjason@lowepower.com MISCREG_ID_MMFR3_EL1, // 370 43912339Sjason@lowepower.com MISCREG_ID_ISAR0_EL1, // 371 44012339Sjason@lowepower.com MISCREG_ID_ISAR1_EL1, // 372 44112339Sjason@lowepower.com MISCREG_ID_ISAR2_EL1, // 373 44212339Sjason@lowepower.com MISCREG_ID_ISAR3_EL1, // 374 44312339Sjason@lowepower.com MISCREG_ID_ISAR4_EL1, // 375 44412339Sjason@lowepower.com MISCREG_ID_ISAR5_EL1, // 376 44512339Sjason@lowepower.com MISCREG_MVFR0_EL1, // 377 44612339Sjason@lowepower.com MISCREG_MVFR1_EL1, // 378 44712339Sjason@lowepower.com MISCREG_MVFR2_EL1, // 379 44812339Sjason@lowepower.com MISCREG_ID_AA64PFR0_EL1, // 380 44912339Sjason@lowepower.com MISCREG_ID_AA64PFR1_EL1, // 381 45012339Sjason@lowepower.com MISCREG_ID_AA64DFR0_EL1, // 382 45112339Sjason@lowepower.com MISCREG_ID_AA64DFR1_EL1, // 383 45212339Sjason@lowepower.com MISCREG_ID_AA64AFR0_EL1, // 384 45312339Sjason@lowepower.com MISCREG_ID_AA64AFR1_EL1, // 385 45412339Sjason@lowepower.com MISCREG_ID_AA64ISAR0_EL1, // 386 45512339Sjason@lowepower.com MISCREG_ID_AA64ISAR1_EL1, // 387 45612339Sjason@lowepower.com MISCREG_ID_AA64MMFR0_EL1, // 388 45712339Sjason@lowepower.com MISCREG_ID_AA64MMFR1_EL1, // 389 45812339Sjason@lowepower.com MISCREG_CCSIDR_EL1, // 390 459 MISCREG_CLIDR_EL1, // 391 460 MISCREG_AIDR_EL1, // 392 461 MISCREG_CSSELR_EL1, // 393 462 MISCREG_CTR_EL0, // 394 463 MISCREG_DCZID_EL0, // 395 464 MISCREG_VPIDR_EL2, // 396 465 MISCREG_VMPIDR_EL2, // 397 466 MISCREG_SCTLR_EL1, // 398 467 MISCREG_ACTLR_EL1, // 399 468 MISCREG_CPACR_EL1, // 400 469 MISCREG_SCTLR_EL2, // 401 470 MISCREG_ACTLR_EL2, // 402 471 MISCREG_HCR_EL2, // 403 472 MISCREG_MDCR_EL2, // 404 473 MISCREG_CPTR_EL2, // 405 474 MISCREG_HSTR_EL2, // 406 475 MISCREG_HACR_EL2, // 407 476 MISCREG_SCTLR_EL3, // 408 477 MISCREG_ACTLR_EL3, // 409 478 MISCREG_SCR_EL3, // 410 479 MISCREG_SDER32_EL3, // 411 480 MISCREG_CPTR_EL3, // 412 481 MISCREG_MDCR_EL3, // 413 482 MISCREG_TTBR0_EL1, // 414 483 MISCREG_TTBR1_EL1, // 415 484 MISCREG_TCR_EL1, // 416 485 MISCREG_TTBR0_EL2, // 417 486 MISCREG_TCR_EL2, // 418 487 MISCREG_VTTBR_EL2, // 419 488 MISCREG_VTCR_EL2, // 420 489 MISCREG_TTBR0_EL3, // 421 490 MISCREG_TCR_EL3, // 422 491 MISCREG_DACR32_EL2, // 423 492 MISCREG_SPSR_EL1, // 424 493 MISCREG_ELR_EL1, // 425 494 MISCREG_SP_EL0, // 426 495 MISCREG_SPSEL, // 427 496 MISCREG_CURRENTEL, // 428 497 MISCREG_NZCV, // 429 498 MISCREG_DAIF, // 430 499 MISCREG_FPCR, // 431 500 MISCREG_FPSR, // 432 501 MISCREG_DSPSR_EL0, // 433 502 MISCREG_DLR_EL0, // 434 503 MISCREG_SPSR_EL2, // 435 504 MISCREG_ELR_EL2, // 436 505 MISCREG_SP_EL1, // 437 506 MISCREG_SPSR_IRQ_AA64, // 438 507 MISCREG_SPSR_ABT_AA64, // 439 508 MISCREG_SPSR_UND_AA64, // 440 509 MISCREG_SPSR_FIQ_AA64, // 441 510 MISCREG_SPSR_EL3, // 442 511 MISCREG_ELR_EL3, // 443 512 MISCREG_SP_EL2, // 444 513 MISCREG_AFSR0_EL1, // 445 514 MISCREG_AFSR1_EL1, // 446 515 MISCREG_ESR_EL1, // 447 516 MISCREG_IFSR32_EL2, // 448 517 MISCREG_AFSR0_EL2, // 449 518 MISCREG_AFSR1_EL2, // 450 519 MISCREG_ESR_EL2, // 451 520 MISCREG_FPEXC32_EL2, // 452 521 MISCREG_AFSR0_EL3, // 453 522 MISCREG_AFSR1_EL3, // 454 523 MISCREG_ESR_EL3, // 455 524 MISCREG_FAR_EL1, // 456 525 MISCREG_FAR_EL2, // 457 526 MISCREG_HPFAR_EL2, // 458 527 MISCREG_FAR_EL3, // 459 528 MISCREG_IC_IALLUIS, // 460 529 MISCREG_PAR_EL1, // 461 530 MISCREG_IC_IALLU, // 462 531 MISCREG_DC_IVAC_Xt, // 463 532 MISCREG_DC_ISW_Xt, // 464 533 MISCREG_AT_S1E1R_Xt, // 465 534 MISCREG_AT_S1E1W_Xt, // 466 535 MISCREG_AT_S1E0R_Xt, // 467 536 MISCREG_AT_S1E0W_Xt, // 468 537 MISCREG_DC_CSW_Xt, // 469 538 MISCREG_DC_CISW_Xt, // 470 539 MISCREG_DC_ZVA_Xt, // 471 540 MISCREG_IC_IVAU_Xt, // 472 541 MISCREG_DC_CVAC_Xt, // 473 542 MISCREG_DC_CVAU_Xt, // 474 543 MISCREG_DC_CIVAC_Xt, // 475 544 MISCREG_AT_S1E2R_Xt, // 476 545 MISCREG_AT_S1E2W_Xt, // 477 546 MISCREG_AT_S12E1R_Xt, // 478 547 MISCREG_AT_S12E1W_Xt, // 479 548 MISCREG_AT_S12E0R_Xt, // 480 549 MISCREG_AT_S12E0W_Xt, // 481 550 MISCREG_AT_S1E3R_Xt, // 482 551 MISCREG_AT_S1E3W_Xt, // 483 552 MISCREG_TLBI_VMALLE1IS, // 484 553 MISCREG_TLBI_VAE1IS_Xt, // 485 554 MISCREG_TLBI_ASIDE1IS_Xt, // 486 555 MISCREG_TLBI_VAAE1IS_Xt, // 487 556 MISCREG_TLBI_VALE1IS_Xt, // 488 557 MISCREG_TLBI_VAALE1IS_Xt, // 489 558 MISCREG_TLBI_VMALLE1, // 490 559 MISCREG_TLBI_VAE1_Xt, // 491 560 MISCREG_TLBI_ASIDE1_Xt, // 492 561 MISCREG_TLBI_VAAE1_Xt, // 493 562 MISCREG_TLBI_VALE1_Xt, // 494 563 MISCREG_TLBI_VAALE1_Xt, // 495 564 MISCREG_TLBI_IPAS2E1IS_Xt, // 496 565 MISCREG_TLBI_IPAS2LE1IS_Xt, // 497 566 MISCREG_TLBI_ALLE2IS, // 498 567 MISCREG_TLBI_VAE2IS_Xt, // 499 568 MISCREG_TLBI_ALLE1IS, // 500 569 MISCREG_TLBI_VALE2IS_Xt, // 501 570 MISCREG_TLBI_VMALLS12E1IS, // 502 571 MISCREG_TLBI_IPAS2E1_Xt, // 503 572 MISCREG_TLBI_IPAS2LE1_Xt, // 504 573 MISCREG_TLBI_ALLE2, // 505 574 MISCREG_TLBI_VAE2_Xt, // 506 575 MISCREG_TLBI_ALLE1, // 507 576 MISCREG_TLBI_VALE2_Xt, // 508 577 MISCREG_TLBI_VMALLS12E1, // 509 578 MISCREG_TLBI_ALLE3IS, // 510 579 MISCREG_TLBI_VAE3IS_Xt, // 511 580 MISCREG_TLBI_VALE3IS_Xt, // 512 581 MISCREG_TLBI_ALLE3, // 513 582 MISCREG_TLBI_VAE3_Xt, // 514 583 MISCREG_TLBI_VALE3_Xt, // 515 584 MISCREG_PMINTENSET_EL1, // 516 585 MISCREG_PMINTENCLR_EL1, // 517 586 MISCREG_PMCR_EL0, // 518 587 MISCREG_PMCNTENSET_EL0, // 519 588 MISCREG_PMCNTENCLR_EL0, // 520 589 MISCREG_PMOVSCLR_EL0, // 521 590 MISCREG_PMSWINC_EL0, // 522 591 MISCREG_PMSELR_EL0, // 523 592 MISCREG_PMCEID0_EL0, // 524 593 MISCREG_PMCEID1_EL0, // 525 594 MISCREG_PMCCNTR_EL0, // 526 595 MISCREG_PMXEVTYPER_EL0, // 527 596 MISCREG_PMCCFILTR_EL0, // 528 597 MISCREG_PMXEVCNTR_EL0, // 529 598 MISCREG_PMUSERENR_EL0, // 530 599 MISCREG_PMOVSSET_EL0, // 531 600 MISCREG_MAIR_EL1, // 532 601 MISCREG_AMAIR_EL1, // 533 602 MISCREG_MAIR_EL2, // 534 603 MISCREG_AMAIR_EL2, // 535 604 MISCREG_MAIR_EL3, // 536 605 MISCREG_AMAIR_EL3, // 537 606 MISCREG_L2CTLR_EL1, // 538 607 MISCREG_L2ECTLR_EL1, // 539 608 MISCREG_VBAR_EL1, // 540 609 MISCREG_RVBAR_EL1, // 541 610 MISCREG_ISR_EL1, // 542 611 MISCREG_VBAR_EL2, // 543 612 MISCREG_RVBAR_EL2, // 544 613 MISCREG_VBAR_EL3, // 545 614 MISCREG_RVBAR_EL3, // 546 615 MISCREG_RMR_EL3, // 547 616 MISCREG_CONTEXTIDR_EL1, // 548 617 MISCREG_TPIDR_EL1, // 549 618 MISCREG_TPIDR_EL0, // 550 619 MISCREG_TPIDRRO_EL0, // 551 620 MISCREG_TPIDR_EL2, // 552 621 MISCREG_TPIDR_EL3, // 553 622 MISCREG_CNTKCTL_EL1, // 554 623 MISCREG_CNTFRQ_EL0, // 555 624 MISCREG_CNTPCT_EL0, // 556 625 MISCREG_CNTVCT_EL0, // 557 626 MISCREG_CNTP_TVAL_EL0, // 558 627 MISCREG_CNTP_CTL_EL0, // 559 628 MISCREG_CNTP_CVAL_EL0, // 560 629 MISCREG_CNTV_TVAL_EL0, // 561 630 MISCREG_CNTV_CTL_EL0, // 562 631 MISCREG_CNTV_CVAL_EL0, // 563 632 MISCREG_PMEVCNTR0_EL0, // 564 633 MISCREG_PMEVCNTR1_EL0, // 565 634 MISCREG_PMEVCNTR2_EL0, // 566 635 MISCREG_PMEVCNTR3_EL0, // 567 636 MISCREG_PMEVCNTR4_EL0, // 568 637 MISCREG_PMEVCNTR5_EL0, // 569 638 MISCREG_PMEVTYPER0_EL0, // 570 639 MISCREG_PMEVTYPER1_EL0, // 571 640 MISCREG_PMEVTYPER2_EL0, // 572 641 MISCREG_PMEVTYPER3_EL0, // 573 642 MISCREG_PMEVTYPER4_EL0, // 574 643 MISCREG_PMEVTYPER5_EL0, // 575 644 MISCREG_CNTVOFF_EL2, // 576 645 MISCREG_CNTHCTL_EL2, // 577 646 MISCREG_CNTHP_TVAL_EL2, // 578 647 MISCREG_CNTHP_CTL_EL2, // 579 648 MISCREG_CNTHP_CVAL_EL2, // 580 649 MISCREG_CNTPS_TVAL_EL1, // 581 650 MISCREG_CNTPS_CTL_EL1, // 582 651 MISCREG_CNTPS_CVAL_EL1, // 583 652 MISCREG_IL1DATA0_EL1, // 584 653 MISCREG_IL1DATA1_EL1, // 585 654 MISCREG_IL1DATA2_EL1, // 586 655 MISCREG_IL1DATA3_EL1, // 587 656 MISCREG_DL1DATA0_EL1, // 588 657 MISCREG_DL1DATA1_EL1, // 589 658 MISCREG_DL1DATA2_EL1, // 590 659 MISCREG_DL1DATA3_EL1, // 591 660 MISCREG_DL1DATA4_EL1, // 592 661 MISCREG_L2ACTLR_EL1, // 593 662 MISCREG_CPUACTLR_EL1, // 594 663 MISCREG_CPUECTLR_EL1, // 595 664 MISCREG_CPUMERRSR_EL1, // 596 665 MISCREG_L2MERRSR_EL1, // 597 666 MISCREG_CBAR_EL1, // 598 667 MISCREG_CONTEXTIDR_EL2, // 599 668 669 // Introduced in ARMv8.1 670 MISCREG_TTBR1_EL2, // 600 671 MISCREG_CNTHV_CTL_EL2, // 601 672 MISCREG_CNTHV_CVAL_EL2, // 602 673 MISCREG_CNTHV_TVAL_EL2, // 603 674 675 // These MISCREG_FREESLOT are available Misc Register 676 // slots for future registers to be implemented. 677 MISCREG_FREESLOT_1, // 604 678 MISCREG_FREESLOT_2, // 605 679 680 // NUM_PHYS_MISCREGS specifies the number of actual physical 681 // registers, not considering the following pseudo-registers 682 // (dummy registers), like UNKNOWN, CP15_UNIMPL, MISCREG_IMPDEF_UNIMPL. 683 // Checkpointing should use this physical index when 684 // saving/restoring register values. 685 NUM_PHYS_MISCREGS = 606, // 606 686 687 // Dummy registers 688 MISCREG_NOP, 689 MISCREG_RAZ, 690 MISCREG_CP14_UNIMPL, 691 MISCREG_CP15_UNIMPL, 692 MISCREG_UNKNOWN, 693 694 // Implementation defined register: this represent 695 // a pool of unimplemented registers whose access can throw 696 // either UNDEFINED or hypervisor trap exception. 697 MISCREG_IMPDEF_UNIMPL, 698 699 // RAS extension (unimplemented) 700 MISCREG_ERRIDR_EL1, 701 MISCREG_ERRSELR_EL1, 702 MISCREG_ERXFR_EL1, 703 MISCREG_ERXCTLR_EL1, 704 MISCREG_ERXSTATUS_EL1, 705 MISCREG_ERXADDR_EL1, 706 MISCREG_ERXMISC0_EL1, 707 MISCREG_ERXMISC1_EL1, 708 MISCREG_DISR_EL1, 709 MISCREG_VSESR_EL2, 710 MISCREG_VDISR_EL2, 711 712 // Total number of Misc Registers: Physical + Dummy 713 NUM_MISCREGS 714 }; 715 716 enum MiscRegInfo { 717 MISCREG_IMPLEMENTED, 718 MISCREG_UNVERIFIABLE, // Does the value change on every read (e.g. a 719 // arch generic counter) 720 MISCREG_WARN_NOT_FAIL, // If MISCREG_IMPLEMENTED is deasserted, it 721 // tells whether the instruction should raise a 722 // warning or fail 723 MISCREG_MUTEX, // True if the register corresponds to a pair of 724 // mutually exclusive registers 725 MISCREG_BANKED, // True if the register is banked between the two 726 // security states, and this is the parent node of the 727 // two banked registers 728 MISCREG_BANKED_CHILD, // The entry is one of the child registers that 729 // forms a banked set of regs (along with the 730 // other child regs) 731 732 // Access permissions 733 // User mode 734 MISCREG_USR_NS_RD, 735 MISCREG_USR_NS_WR, 736 MISCREG_USR_S_RD, 737 MISCREG_USR_S_WR, 738 // Privileged modes other than hypervisor or monitor 739 MISCREG_PRI_NS_RD, 740 MISCREG_PRI_NS_WR, 741 MISCREG_PRI_S_RD, 742 MISCREG_PRI_S_WR, 743 // Hypervisor mode 744 MISCREG_HYP_RD, 745 MISCREG_HYP_WR, 746 // Monitor mode, SCR.NS == 0 747 MISCREG_MON_NS0_RD, 748 MISCREG_MON_NS0_WR, 749 // Monitor mode, SCR.NS == 1 750 MISCREG_MON_NS1_RD, 751 MISCREG_MON_NS1_WR, 752 753 NUM_MISCREG_INFOS 754 }; 755 756 extern std::bitset<NUM_MISCREG_INFOS> miscRegInfo[NUM_MISCREGS]; 757 758 // Decodes 32-bit CP14 registers accessible through MCR/MRC instructions 759 MiscRegIndex decodeCP14Reg(unsigned crn, unsigned opc1, 760 unsigned crm, unsigned opc2); 761 MiscRegIndex decodeAArch64SysReg(unsigned op0, unsigned op1, 762 unsigned crn, unsigned crm, 763 unsigned op2); 764 // Whether a particular AArch64 system register is -always- read only. 765 bool aarch64SysRegReadOnly(MiscRegIndex miscReg); 766 767 // Decodes 32-bit CP15 registers accessible through MCR/MRC instructions 768 MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1, 769 unsigned crm, unsigned opc2); 770 771 // Decodes 64-bit CP15 registers accessible through MCRR/MRRC instructions 772 MiscRegIndex decodeCP15Reg64(unsigned crm, unsigned opc1); 773 774 775 const char * const miscRegName[] = { 776 "cpsr", 777 "spsr", 778 "spsr_fiq", 779 "spsr_irq", 780 "spsr_svc", 781 "spsr_mon", 782 "spsr_abt", 783 "spsr_hyp", 784 "spsr_und", 785 "elr_hyp", 786 "fpsid", 787 "fpscr", 788 "mvfr1", 789 "mvfr0", 790 "fpexc", 791 792 // Helper registers 793 "cpsr_mode", 794 "cpsr_q", 795 "fpscr_exc", 796 "fpscr_qc", 797 "lockaddr", 798 "lockflag", 799 "prrr_mair0", 800 "prrr_mair0_ns", 801 "prrr_mair0_s", 802 "nmrr_mair1", 803 "nmrr_mair1_ns", 804 "nmrr_mair1_s", 805 "pmxevtyper_pmccfiltr", 806 "sctlr_rst", 807 "sev_mailbox", 808 809 // AArch32 CP14 registers 810 "dbgdidr", 811 "dbgdscrint", 812 "dbgdccint", 813 "dbgdtrtxint", 814 "dbgdtrrxint", 815 "dbgwfar", 816 "dbgvcr", 817 "dbgdtrrxext", 818 "dbgdscrext", 819 "dbgdtrtxext", 820 "dbgoseccr", 821 "dbgbvr0", 822 "dbgbvr1", 823 "dbgbvr2", 824 "dbgbvr3", 825 "dbgbvr4", 826 "dbgbvr5", 827 "dbgbcr0", 828 "dbgbcr1", 829 "dbgbcr2", 830 "dbgbcr3", 831 "dbgbcr4", 832 "dbgbcr5", 833 "dbgwvr0", 834 "dbgwvr1", 835 "dbgwvr2", 836 "dbgwvr3", 837 "dbgwcr0", 838 "dbgwcr1", 839 "dbgwcr2", 840 "dbgwcr3", 841 "dbgdrar", 842 "dbgbxvr4", 843 "dbgbxvr5", 844 "dbgoslar", 845 "dbgoslsr", 846 "dbgosdlr", 847 "dbgprcr", 848 "dbgdsar", 849 "dbgclaimset", 850 "dbgclaimclr", 851 "dbgauthstatus", 852 "dbgdevid2", 853 "dbgdevid1", 854 "dbgdevid0", 855 "teecr", 856 "jidr", 857 "teehbr", 858 "joscr", 859 "jmcr", 860 861 // AArch32 CP15 registers 862 "midr", 863 "ctr", 864 "tcmtr", 865 "tlbtr", 866 "mpidr", 867 "revidr", 868 "id_pfr0", 869 "id_pfr1", 870 "id_dfr0", 871 "id_afr0", 872 "id_mmfr0", 873 "id_mmfr1", 874 "id_mmfr2", 875 "id_mmfr3", 876 "id_isar0", 877 "id_isar1", 878 "id_isar2", 879 "id_isar3", 880 "id_isar4", 881 "id_isar5", 882 "ccsidr", 883 "clidr", 884 "aidr", 885 "csselr", 886 "csselr_ns", 887 "csselr_s", 888 "vpidr", 889 "vmpidr", 890 "sctlr", 891 "sctlr_ns", 892 "sctlr_s", 893 "actlr", 894 "actlr_ns", 895 "actlr_s", 896 "cpacr", 897 "scr", 898 "sder", 899 "nsacr", 900 "hsctlr", 901 "hactlr", 902 "hcr", 903 "hdcr", 904 "hcptr", 905 "hstr", 906 "hacr", 907 "ttbr0", 908 "ttbr0_ns", 909 "ttbr0_s", 910 "ttbr1", 911 "ttbr1_ns", 912 "ttbr1_s", 913 "ttbcr", 914 "ttbcr_ns", 915 "ttbcr_s", 916 "htcr", 917 "vtcr", 918 "dacr", 919 "dacr_ns", 920 "dacr_s", 921 "dfsr", 922 "dfsr_ns", 923 "dfsr_s", 924 "ifsr", 925 "ifsr_ns", 926 "ifsr_s", 927 "adfsr", 928 "adfsr_ns", 929 "adfsr_s", 930 "aifsr", 931 "aifsr_ns", 932 "aifsr_s", 933 "hadfsr", 934 "haifsr", 935 "hsr", 936 "dfar", 937 "dfar_ns", 938 "dfar_s", 939 "ifar", 940 "ifar_ns", 941 "ifar_s", 942 "hdfar", 943 "hifar", 944 "hpfar", 945 "icialluis", 946 "bpiallis", 947 "par", 948 "par_ns", 949 "par_s", 950 "iciallu", 951 "icimvau", 952 "cp15isb", 953 "bpiall", 954 "bpimva", 955 "dcimvac", 956 "dcisw", 957 "ats1cpr", 958 "ats1cpw", 959 "ats1cur", 960 "ats1cuw", 961 "ats12nsopr", 962 "ats12nsopw", 963 "ats12nsour", 964 "ats12nsouw", 965 "dccmvac", 966 "dccsw", 967 "cp15dsb", 968 "cp15dmb", 969 "dccmvau", 970 "dccimvac", 971 "dccisw", 972 "ats1hr", 973 "ats1hw", 974 "tlbiallis", 975 "tlbimvais", 976 "tlbiasidis", 977 "tlbimvaais", 978 "tlbimvalis", 979 "tlbimvaalis", 980 "itlbiall", 981 "itlbimva", 982 "itlbiasid", 983 "dtlbiall", 984 "dtlbimva", 985 "dtlbiasid", 986 "tlbiall", 987 "tlbimva", 988 "tlbiasid", 989 "tlbimvaa", 990 "tlbimval", 991 "tlbimvaal", 992 "tlbiipas2is", 993 "tlbiipas2lis", 994 "tlbiallhis", 995 "tlbimvahis", 996 "tlbiallnsnhis", 997 "tlbimvalhis", 998 "tlbiipas2", 999 "tlbiipas2l", 1000 "tlbiallh", 1001 "tlbimvah", 1002 "tlbiallnsnh", 1003 "tlbimvalh", 1004 "pmcr", 1005 "pmcntenset", 1006 "pmcntenclr", 1007 "pmovsr", 1008 "pmswinc", 1009 "pmselr", 1010 "pmceid0", 1011 "pmceid1", 1012 "pmccntr", 1013 "pmxevtyper", 1014 "pmccfiltr", 1015 "pmxevcntr", 1016 "pmuserenr", 1017 "pmintenset", 1018 "pmintenclr", 1019 "pmovsset", 1020 "l2ctlr", 1021 "l2ectlr", 1022 "prrr", 1023 "prrr_ns", 1024 "prrr_s", 1025 "mair0", 1026 "mair0_ns", 1027 "mair0_s", 1028 "nmrr", 1029 "nmrr_ns", 1030 "nmrr_s", 1031 "mair1", 1032 "mair1_ns", 1033 "mair1_s", 1034 "amair0", 1035 "amair0_ns", 1036 "amair0_s", 1037 "amair1", 1038 "amair1_ns", 1039 "amair1_s", 1040 "hmair0", 1041 "hmair1", 1042 "hamair0", 1043 "hamair1", 1044 "vbar", 1045 "vbar_ns", 1046 "vbar_s", 1047 "mvbar", 1048 "rmr", 1049 "isr", 1050 "hvbar", 1051 "fcseidr", 1052 "contextidr", 1053 "contextidr_ns", 1054 "contextidr_s", 1055 "tpidrurw", 1056 "tpidrurw_ns", 1057 "tpidrurw_s", 1058 "tpidruro", 1059 "tpidruro_ns", 1060 "tpidruro_s", 1061 "tpidrprw", 1062 "tpidrprw_ns", 1063 "tpidrprw_s", 1064 "htpidr", 1065 "cntfrq", 1066 "cntkctl", 1067 "cntp_tval", 1068 "cntp_tval_ns", 1069 "cntp_tval_s", 1070 "cntp_ctl", 1071 "cntp_ctl_ns", 1072 "cntp_ctl_s", 1073 "cntv_tval", 1074 "cntv_ctl", 1075 "cnthctl", 1076 "cnthp_tval", 1077 "cnthp_ctl", 1078 "il1data0", 1079 "il1data1", 1080 "il1data2", 1081 "il1data3", 1082 "dl1data0", 1083 "dl1data1", 1084 "dl1data2", 1085 "dl1data3", 1086 "dl1data4", 1087 "ramindex", 1088 "l2actlr", 1089 "cbar", 1090 "httbr", 1091 "vttbr", 1092 "cntpct", 1093 "cntvct", 1094 "cntp_cval", 1095 "cntp_cval_ns", 1096 "cntp_cval_s", 1097 "cntv_cval", 1098 "cntvoff", 1099 "cnthp_cval", 1100 "cpumerrsr", 1101 "l2merrsr", 1102 1103 // AArch64 registers (Op0=2) 1104 "mdccint_el1", 1105 "osdtrrx_el1", 1106 "mdscr_el1", 1107 "osdtrtx_el1", 1108 "oseccr_el1", 1109 "dbgbvr0_el1", 1110 "dbgbvr1_el1", 1111 "dbgbvr2_el1", 1112 "dbgbvr3_el1", 1113 "dbgbvr4_el1", 1114 "dbgbvr5_el1", 1115 "dbgbcr0_el1", 1116 "dbgbcr1_el1", 1117 "dbgbcr2_el1", 1118 "dbgbcr3_el1", 1119 "dbgbcr4_el1", 1120 "dbgbcr5_el1", 1121 "dbgwvr0_el1", 1122 "dbgwvr1_el1", 1123 "dbgwvr2_el1", 1124 "dbgwvr3_el1", 1125 "dbgwcr0_el1", 1126 "dbgwcr1_el1", 1127 "dbgwcr2_el1", 1128 "dbgwcr3_el1", 1129 "mdccsr_el0", 1130 "mddtr_el0", 1131 "mddtrtx_el0", 1132 "mddtrrx_el0", 1133 "dbgvcr32_el2", 1134 "mdrar_el1", 1135 "oslar_el1", 1136 "oslsr_el1", 1137 "osdlr_el1", 1138 "dbgprcr_el1", 1139 "dbgclaimset_el1", 1140 "dbgclaimclr_el1", 1141 "dbgauthstatus_el1", 1142 "teecr32_el1", 1143 "teehbr32_el1", 1144 1145 // AArch64 registers (Op0=1,3) 1146 "midr_el1", 1147 "mpidr_el1", 1148 "revidr_el1", 1149 "id_pfr0_el1", 1150 "id_pfr1_el1", 1151 "id_dfr0_el1", 1152 "id_afr0_el1", 1153 "id_mmfr0_el1", 1154 "id_mmfr1_el1", 1155 "id_mmfr2_el1", 1156 "id_mmfr3_el1", 1157 "id_isar0_el1", 1158 "id_isar1_el1", 1159 "id_isar2_el1", 1160 "id_isar3_el1", 1161 "id_isar4_el1", 1162 "id_isar5_el1", 1163 "mvfr0_el1", 1164 "mvfr1_el1", 1165 "mvfr2_el1", 1166 "id_aa64pfr0_el1", 1167 "id_aa64pfr1_el1", 1168 "id_aa64dfr0_el1", 1169 "id_aa64dfr1_el1", 1170 "id_aa64afr0_el1", 1171 "id_aa64afr1_el1", 1172 "id_aa64isar0_el1", 1173 "id_aa64isar1_el1", 1174 "id_aa64mmfr0_el1", 1175 "id_aa64mmfr1_el1", 1176 "ccsidr_el1", 1177 "clidr_el1", 1178 "aidr_el1", 1179 "csselr_el1", 1180 "ctr_el0", 1181 "dczid_el0", 1182 "vpidr_el2", 1183 "vmpidr_el2", 1184 "sctlr_el1", 1185 "actlr_el1", 1186 "cpacr_el1", 1187 "sctlr_el2", 1188 "actlr_el2", 1189 "hcr_el2", 1190 "mdcr_el2", 1191 "cptr_el2", 1192 "hstr_el2", 1193 "hacr_el2", 1194 "sctlr_el3", 1195 "actlr_el3", 1196 "scr_el3", 1197 "sder32_el3", 1198 "cptr_el3", 1199 "mdcr_el3", 1200 "ttbr0_el1", 1201 "ttbr1_el1", 1202 "tcr_el1", 1203 "ttbr0_el2", 1204 "tcr_el2", 1205 "vttbr_el2", 1206 "vtcr_el2", 1207 "ttbr0_el3", 1208 "tcr_el3", 1209 "dacr32_el2", 1210 "spsr_el1", 1211 "elr_el1", 1212 "sp_el0", 1213 "spsel", 1214 "currentel", 1215 "nzcv", 1216 "daif", 1217 "fpcr", 1218 "fpsr", 1219 "dspsr_el0", 1220 "dlr_el0", 1221 "spsr_el2", 1222 "elr_el2", 1223 "sp_el1", 1224 "spsr_irq_aa64", 1225 "spsr_abt_aa64", 1226 "spsr_und_aa64", 1227 "spsr_fiq_aa64", 1228 "spsr_el3", 1229 "elr_el3", 1230 "sp_el2", 1231 "afsr0_el1", 1232 "afsr1_el1", 1233 "esr_el1", 1234 "ifsr32_el2", 1235 "afsr0_el2", 1236 "afsr1_el2", 1237 "esr_el2", 1238 "fpexc32_el2", 1239 "afsr0_el3", 1240 "afsr1_el3", 1241 "esr_el3", 1242 "far_el1", 1243 "far_el2", 1244 "hpfar_el2", 1245 "far_el3", 1246 "ic_ialluis", 1247 "par_el1", 1248 "ic_iallu", 1249 "dc_ivac_xt", 1250 "dc_isw_xt", 1251 "at_s1e1r_xt", 1252 "at_s1e1w_xt", 1253 "at_s1e0r_xt", 1254 "at_s1e0w_xt", 1255 "dc_csw_xt", 1256 "dc_cisw_xt", 1257 "dc_zva_xt", 1258 "ic_ivau_xt", 1259 "dc_cvac_xt", 1260 "dc_cvau_xt", 1261 "dc_civac_xt", 1262 "at_s1e2r_xt", 1263 "at_s1e2w_xt", 1264 "at_s12e1r_xt", 1265 "at_s12e1w_xt", 1266 "at_s12e0r_xt", 1267 "at_s12e0w_xt", 1268 "at_s1e3r_xt", 1269 "at_s1e3w_xt", 1270 "tlbi_vmalle1is", 1271 "tlbi_vae1is_xt", 1272 "tlbi_aside1is_xt", 1273 "tlbi_vaae1is_xt", 1274 "tlbi_vale1is_xt", 1275 "tlbi_vaale1is_xt", 1276 "tlbi_vmalle1", 1277 "tlbi_vae1_xt", 1278 "tlbi_aside1_xt", 1279 "tlbi_vaae1_xt", 1280 "tlbi_vale1_xt", 1281 "tlbi_vaale1_xt", 1282 "tlbi_ipas2e1is_xt", 1283 "tlbi_ipas2le1is_xt", 1284 "tlbi_alle2is", 1285 "tlbi_vae2is_xt", 1286 "tlbi_alle1is", 1287 "tlbi_vale2is_xt", 1288 "tlbi_vmalls12e1is", 1289 "tlbi_ipas2e1_xt", 1290 "tlbi_ipas2le1_xt", 1291 "tlbi_alle2", 1292 "tlbi_vae2_xt", 1293 "tlbi_alle1", 1294 "tlbi_vale2_xt", 1295 "tlbi_vmalls12e1", 1296 "tlbi_alle3is", 1297 "tlbi_vae3is_xt", 1298 "tlbi_vale3is_xt", 1299 "tlbi_alle3", 1300 "tlbi_vae3_xt", 1301 "tlbi_vale3_xt", 1302 "pmintenset_el1", 1303 "pmintenclr_el1", 1304 "pmcr_el0", 1305 "pmcntenset_el0", 1306 "pmcntenclr_el0", 1307 "pmovsclr_el0", 1308 "pmswinc_el0", 1309 "pmselr_el0", 1310 "pmceid0_el0", 1311 "pmceid1_el0", 1312 "pmccntr_el0", 1313 "pmxevtyper_el0", 1314 "pmccfiltr_el0", 1315 "pmxevcntr_el0", 1316 "pmuserenr_el0", 1317 "pmovsset_el0", 1318 "mair_el1", 1319 "amair_el1", 1320 "mair_el2", 1321 "amair_el2", 1322 "mair_el3", 1323 "amair_el3", 1324 "l2ctlr_el1", 1325 "l2ectlr_el1", 1326 "vbar_el1", 1327 "rvbar_el1", 1328 "isr_el1", 1329 "vbar_el2", 1330 "rvbar_el2", 1331 "vbar_el3", 1332 "rvbar_el3", 1333 "rmr_el3", 1334 "contextidr_el1", 1335 "tpidr_el1", 1336 "tpidr_el0", 1337 "tpidrro_el0", 1338 "tpidr_el2", 1339 "tpidr_el3", 1340 "cntkctl_el1", 1341 "cntfrq_el0", 1342 "cntpct_el0", 1343 "cntvct_el0", 1344 "cntp_tval_el0", 1345 "cntp_ctl_el0", 1346 "cntp_cval_el0", 1347 "cntv_tval_el0", 1348 "cntv_ctl_el0", 1349 "cntv_cval_el0", 1350 "pmevcntr0_el0", 1351 "pmevcntr1_el0", 1352 "pmevcntr2_el0", 1353 "pmevcntr3_el0", 1354 "pmevcntr4_el0", 1355 "pmevcntr5_el0", 1356 "pmevtyper0_el0", 1357 "pmevtyper1_el0", 1358 "pmevtyper2_el0", 1359 "pmevtyper3_el0", 1360 "pmevtyper4_el0", 1361 "pmevtyper5_el0", 1362 "cntvoff_el2", 1363 "cnthctl_el2", 1364 "cnthp_tval_el2", 1365 "cnthp_ctl_el2", 1366 "cnthp_cval_el2", 1367 "cntps_tval_el1", 1368 "cntps_ctl_el1", 1369 "cntps_cval_el1", 1370 "il1data0_el1", 1371 "il1data1_el1", 1372 "il1data2_el1", 1373 "il1data3_el1", 1374 "dl1data0_el1", 1375 "dl1data1_el1", 1376 "dl1data2_el1", 1377 "dl1data3_el1", 1378 "dl1data4_el1", 1379 "l2actlr_el1", 1380 "cpuactlr_el1", 1381 "cpuectlr_el1", 1382 "cpumerrsr_el1", 1383 "l2merrsr_el1", 1384 "cbar_el1", 1385 "contextidr_el2", 1386 1387 "ttbr1_el2", 1388 "cnthv_ctl_el2", 1389 "cnthv_cval_el2", 1390 "cnthv_tval_el2", 1391 "freeslot1", 1392 "freeslot2", 1393 1394 "num_phys_regs", 1395 1396 // Dummy registers 1397 "nop", 1398 "raz", 1399 "cp14_unimpl", 1400 "cp15_unimpl", 1401 "unknown", 1402 "impl_defined", 1403 "erridr_el1", 1404 "errselr_el1", 1405 "erxfr_el1", 1406 "erxctlr_el1", 1407 "erxstatus_el1", 1408 "erxaddr_el1", 1409 "erxmisc0_el1", 1410 "erxmisc1_el1", 1411 "disr_el1", 1412 "vsesr_el2", 1413 "vdisr_el2", 1414 }; 1415 1416 static_assert(sizeof(miscRegName) / sizeof(*miscRegName) == NUM_MISCREGS, 1417 "The miscRegName array and NUM_MISCREGS are inconsistent."); 1418 1419 BitUnion32(CPSR) 1420 Bitfield<31, 30> nz; 1421 Bitfield<29> c; 1422 Bitfield<28> v; 1423 Bitfield<27> q; 1424 Bitfield<26, 25> it1; 1425 Bitfield<24> j; 1426 Bitfield<23, 22> res0_23_22; 1427 Bitfield<21> ss; // AArch64 1428 Bitfield<20> il; // AArch64 1429 Bitfield<19, 16> ge; 1430 Bitfield<15, 10> it2; 1431 Bitfield<9> d; // AArch64 1432 Bitfield<9> e; 1433 Bitfield<8> a; 1434 Bitfield<7> i; 1435 Bitfield<6> f; 1436 Bitfield<8, 6> aif; 1437 Bitfield<9, 6> daif; // AArch64 1438 Bitfield<5> t; 1439 Bitfield<4> width; // AArch64 1440 Bitfield<3, 2> el; // AArch64 1441 Bitfield<4, 0> mode; 1442 Bitfield<0> sp; // AArch64 1443 EndBitUnion(CPSR) 1444 1445 // This mask selects bits of the CPSR that actually go in the CondCodes 1446 // integer register to allow renaming. 1447 static const uint32_t CondCodesMask = 0xF00F0000; 1448 static const uint32_t CpsrMaskQ = 0x08000000; 1449 1450 // APSR (Application Program Status Register Mask). It is the user level 1451 // alias for the CPSR. The APSR is a subset of the CPSR. Although 1452 // bits[15:0] are UNKNOWN on reads, it is permitted that, on a read of 1453 // APSR: 1454 // Bit[9] returns the value of CPSR.E. 1455 // Bits[8:6] return the value of CPSR.{A,I, F}, the mask bits. 1456 static const uint32_t ApsrMask = CpsrMaskQ | CondCodesMask | 0x000001D0; 1457 1458 // CPSR (Current Program Status Register Mask). 1459 static const uint32_t CpsrMask = ApsrMask | 0x00F003DF; 1460 1461 BitUnion32(HDCR) 1462 Bitfield<11> tdra; 1463 Bitfield<10> tdosa; 1464 Bitfield<9> tda; 1465 Bitfield<8> tde; 1466 Bitfield<7> hpme; 1467 Bitfield<6> tpm; 1468 Bitfield<5> tpmcr; 1469 Bitfield<4, 0> hpmn; 1470 EndBitUnion(HDCR) 1471 1472 BitUnion32(HCPTR) 1473 Bitfield<31> tcpac; 1474 Bitfield<20> tta; 1475 Bitfield<15> tase; 1476 Bitfield<13> tcp13; 1477 Bitfield<12> tcp12; 1478 Bitfield<11> tcp11; 1479 Bitfield<10> tcp10; 1480 Bitfield<10> tfp; // AArch64 1481 Bitfield<9> tcp9; 1482 Bitfield<8> tcp8; 1483 Bitfield<7> tcp7; 1484 Bitfield<6> tcp6; 1485 Bitfield<5> tcp5; 1486 Bitfield<4> tcp4; 1487 Bitfield<3> tcp3; 1488 Bitfield<2> tcp2; 1489 Bitfield<1> tcp1; 1490 Bitfield<0> tcp0; 1491 EndBitUnion(HCPTR) 1492 1493 BitUnion32(HSTR) 1494 Bitfield<17> tjdbx; 1495 Bitfield<16> ttee; 1496 Bitfield<15> t15; 1497 Bitfield<13> t13; 1498 Bitfield<12> t12; 1499 Bitfield<11> t11; 1500 Bitfield<10> t10; 1501 Bitfield<9> t9; 1502 Bitfield<8> t8; 1503 Bitfield<7> t7; 1504 Bitfield<6> t6; 1505 Bitfield<5> t5; 1506 Bitfield<4> t4; 1507 Bitfield<3> t3; 1508 Bitfield<2> t2; 1509 Bitfield<1> t1; 1510 Bitfield<0> t0; 1511 EndBitUnion(HSTR) 1512 1513 BitUnion64(HCR) 1514 Bitfield<34> e2h; // AArch64 1515 Bitfield<33> id; // AArch64 1516 Bitfield<32> cd; // AArch64 1517 Bitfield<31> rw; // AArch64 1518 Bitfield<30> trvm; // AArch64 1519 Bitfield<29> hcd; // AArch64 1520 Bitfield<28> tdz; // AArch64 1521 1522 Bitfield<27> tge; 1523 Bitfield<26> tvm; 1524 Bitfield<25> ttlb; 1525 Bitfield<24> tpu; 1526 Bitfield<23> tpc; 1527 Bitfield<22> tsw; 1528 Bitfield<21> tac; 1529 Bitfield<21> tacr; // AArch64 1530 Bitfield<20> tidcp; 1531 Bitfield<19> tsc; 1532 Bitfield<18> tid3; 1533 Bitfield<17> tid2; 1534 Bitfield<16> tid1; 1535 Bitfield<15> tid0; 1536 Bitfield<14> twe; 1537 Bitfield<13> twi; 1538 Bitfield<12> dc; 1539 Bitfield<11, 10> bsu; 1540 Bitfield<9> fb; 1541 Bitfield<8> va; 1542 Bitfield<8> vse; // AArch64 1543 Bitfield<7> vi; 1544 Bitfield<6> vf; 1545 Bitfield<5> amo; 1546 Bitfield<4> imo; 1547 Bitfield<3> fmo; 1548 Bitfield<2> ptw; 1549 Bitfield<1> swio; 1550 Bitfield<0> vm; 1551 EndBitUnion(HCR) 1552 1553 BitUnion32(NSACR) 1554 Bitfield<20> nstrcdis; 1555 Bitfield<19> rfr; 1556 Bitfield<15> nsasedis; 1557 Bitfield<14> nsd32dis; 1558 Bitfield<13> cp13; 1559 Bitfield<12> cp12; 1560 Bitfield<11> cp11; 1561 Bitfield<10> cp10; 1562 Bitfield<9> cp9; 1563 Bitfield<8> cp8; 1564 Bitfield<7> cp7; 1565 Bitfield<6> cp6; 1566 Bitfield<5> cp5; 1567 Bitfield<4> cp4; 1568 Bitfield<3> cp3; 1569 Bitfield<2> cp2; 1570 Bitfield<1> cp1; 1571 Bitfield<0> cp0; 1572 EndBitUnion(NSACR) 1573 1574 BitUnion32(SCR) 1575 Bitfield<13> twe; 1576 Bitfield<12> twi; 1577 Bitfield<11> st; // AArch64 1578 Bitfield<10> rw; // AArch64 1579 Bitfield<9> sif; 1580 Bitfield<8> hce; 1581 Bitfield<7> scd; 1582 Bitfield<7> smd; // AArch64 1583 Bitfield<6> nEt; 1584 Bitfield<5> aw; 1585 Bitfield<4> fw; 1586 Bitfield<3> ea; 1587 Bitfield<2> fiq; 1588 Bitfield<1> irq; 1589 Bitfield<0> ns; 1590 EndBitUnion(SCR) 1591 1592 BitUnion32(SCTLR) 1593 Bitfield<30> te; // Thumb Exception Enable (AArch32 only) 1594 Bitfield<29> afe; // Access flag enable (AArch32 only) 1595 Bitfield<28> tre; // TEX remap enable (AArch32 only) 1596 Bitfield<27> nmfi; // Non-maskable FIQ support (ARMv7 only) 1597 Bitfield<26> uci; // Enable EL0 access to DC CVAU, DC CIVAC, 1598 // DC CVAC and IC IVAU instructions 1599 // (AArch64 SCTLR_EL1 only) 1600 Bitfield<25> ee; // Exception Endianness 1601 Bitfield<24> ve; // Interrupt Vectors Enable (ARMv7 only) 1602 Bitfield<24> e0e; // Endianness of explicit data accesses at EL0 1603 // (AArch64 SCTLR_EL1 only) 1604 Bitfield<23> xp; // Extended page table enable (dropped in ARMv7) 1605 Bitfield<22> u; // Alignment (dropped in ARMv7) 1606 Bitfield<21> fi; // Fast interrupts configuration enable 1607 // (ARMv7 only) 1608 Bitfield<20> uwxn; // Unprivileged write permission implies EL1 XN 1609 // (AArch32 only) 1610 Bitfield<19> dz; // Divide by Zero fault enable 1611 // (dropped in ARMv7) 1612 Bitfield<19> wxn; // Write permission implies XN 1613 Bitfield<18> ntwe; // Not trap WFE 1614 // (ARMv8 AArch32 and AArch64 SCTLR_EL1 only) 1615 Bitfield<18> rao2; // Read as one 1616 Bitfield<16> ntwi; // Not trap WFI 1617 // (ARMv8 AArch32 and AArch64 SCTLR_EL1 only) 1618 Bitfield<16> rao3; // Read as one 1619 Bitfield<15> uct; // Enable EL0 access to CTR_EL0 1620 // (AArch64 SCTLR_EL1 only) 1621 Bitfield<14> rr; // Round Robin select (ARMv7 only) 1622 Bitfield<14> dze; // Enable EL0 access to DC ZVA 1623 // (AArch64 SCTLR_EL1 only) 1624 Bitfield<13> v; // Vectors bit (AArch32 only) 1625 Bitfield<12> i; // Instruction cache enable 1626 Bitfield<11> z; // Branch prediction enable (ARMv7 only) 1627 Bitfield<10> sw; // SWP/SWPB enable (ARMv7 only) 1628 Bitfield<9, 8> rs; // Deprecated protection bits (dropped in ARMv7) 1629 Bitfield<9> uma; // User mask access (AArch64 SCTLR_EL1 only) 1630 Bitfield<8> sed; // SETEND disable 1631 // (ARMv8 AArch32 and AArch64 SCTLR_EL1 only) 1632 Bitfield<7> b; // Endianness support (dropped in ARMv7) 1633 Bitfield<7> itd; // IT disable 1634 // (ARMv8 AArch32 and AArch64 SCTLR_EL1 only) 1635 Bitfield<6, 3> rao4; // Read as one 1636 Bitfield<6> thee; // ThumbEE enable 1637 // (ARMv8 AArch32 and AArch64 SCTLR_EL1 only) 1638 Bitfield<5> cp15ben; // CP15 barrier enable 1639 // (AArch32 and AArch64 SCTLR_EL1 only) 1640 Bitfield<4> sa0; // Stack Alignment Check Enable for EL0 1641 // (AArch64 SCTLR_EL1 only) 1642 Bitfield<3> sa; // Stack Alignment Check Enable (AArch64 only) 1643 Bitfield<2> c; // Cache enable 1644 Bitfield<1> a; // Alignment check enable 1645 Bitfield<0> m; // MMU enable 1646 EndBitUnion(SCTLR) 1647 1648 BitUnion32(CPACR) 1649 Bitfield<1, 0> cp0; 1650 Bitfield<3, 2> cp1; 1651 Bitfield<5, 4> cp2; 1652 Bitfield<7, 6> cp3; 1653 Bitfield<9, 8> cp4; 1654 Bitfield<11, 10> cp5; 1655 Bitfield<13, 12> cp6; 1656 Bitfield<15, 14> cp7; 1657 Bitfield<17, 16> cp8; 1658 Bitfield<19, 18> cp9; 1659 Bitfield<21, 20> cp10; 1660 Bitfield<21, 20> fpen; // AArch64 1661 Bitfield<23, 22> cp11; 1662 Bitfield<25, 24> cp12; 1663 Bitfield<27, 26> cp13; 1664 Bitfield<29, 28> rsvd; 1665 Bitfield<28> tta; // AArch64 1666 Bitfield<30> d32dis; 1667 Bitfield<31> asedis; 1668 EndBitUnion(CPACR) 1669 1670 BitUnion32(FSR) 1671 Bitfield<3, 0> fsLow; 1672 Bitfield<5, 0> status; // LPAE 1673 Bitfield<7, 4> domain; 1674 Bitfield<9> lpae; 1675 Bitfield<10> fsHigh; 1676 Bitfield<11> wnr; 1677 Bitfield<12> ext; 1678 Bitfield<13> cm; // LPAE 1679 EndBitUnion(FSR) 1680 1681 BitUnion32(FPSCR) 1682 Bitfield<0> ioc; 1683 Bitfield<1> dzc; 1684 Bitfield<2> ofc; 1685 Bitfield<3> ufc; 1686 Bitfield<4> ixc; 1687 Bitfield<7> idc; 1688 Bitfield<8> ioe; 1689 Bitfield<9> dze; 1690 Bitfield<10> ofe; 1691 Bitfield<11> ufe; 1692 Bitfield<12> ixe; 1693 Bitfield<15> ide; 1694 Bitfield<18, 16> len; 1695 Bitfield<21, 20> stride; 1696 Bitfield<23, 22> rMode; 1697 Bitfield<24> fz; 1698 Bitfield<25> dn; 1699 Bitfield<26> ahp; 1700 Bitfield<27> qc; 1701 Bitfield<28> v; 1702 Bitfield<29> c; 1703 Bitfield<30> z; 1704 Bitfield<31> n; 1705 EndBitUnion(FPSCR) 1706 1707 // This mask selects bits of the FPSCR that actually go in the FpCondCodes 1708 // integer register to allow renaming. 1709 static const uint32_t FpCondCodesMask = 0xF0000000; 1710 // This mask selects the cumulative FP exception flags of the FPSCR. 1711 static const uint32_t FpscrExcMask = 0x0000009F; 1712 // This mask selects the cumulative saturation flag of the FPSCR. 1713 static const uint32_t FpscrQcMask = 0x08000000; 1714 1715 BitUnion32(FPEXC) 1716 Bitfield<31> ex; 1717 Bitfield<30> en; 1718 Bitfield<29, 0> subArchDefined; 1719 EndBitUnion(FPEXC) 1720 1721 BitUnion32(MVFR0) 1722 Bitfield<3, 0> advSimdRegisters; 1723 Bitfield<7, 4> singlePrecision; 1724 Bitfield<11, 8> doublePrecision; 1725 Bitfield<15, 12> vfpExceptionTrapping; 1726 Bitfield<19, 16> divide; 1727 Bitfield<23, 20> squareRoot; 1728 Bitfield<27, 24> shortVectors; 1729 Bitfield<31, 28> roundingModes; 1730 EndBitUnion(MVFR0) 1731 1732 BitUnion32(MVFR1) 1733 Bitfield<3, 0> flushToZero; 1734 Bitfield<7, 4> defaultNaN; 1735 Bitfield<11, 8> advSimdLoadStore; 1736 Bitfield<15, 12> advSimdInteger; 1737 Bitfield<19, 16> advSimdSinglePrecision; 1738 Bitfield<23, 20> advSimdHalfPrecision; 1739 Bitfield<27, 24> vfpHalfPrecision; 1740 Bitfield<31, 28> raz; 1741 EndBitUnion(MVFR1) 1742 1743 BitUnion64(TTBCR) 1744 // Short-descriptor translation table format 1745 Bitfield<2, 0> n; 1746 Bitfield<4> pd0; 1747 Bitfield<5> pd1; 1748 // Long-descriptor translation table format 1749 Bitfield<2, 0> t0sz; 1750 Bitfield<7> epd0; 1751 Bitfield<9, 8> irgn0; 1752 Bitfield<11, 10> orgn0; 1753 Bitfield<13, 12> sh0; 1754 Bitfield<14> tg0; 1755 Bitfield<18, 16> t1sz; 1756 Bitfield<22> a1; 1757 Bitfield<23> epd1; 1758 Bitfield<25, 24> irgn1; 1759 Bitfield<27, 26> orgn1; 1760 Bitfield<29, 28> sh1; 1761 Bitfield<30> tg1; 1762 Bitfield<34, 32> ips; 1763 Bitfield<36> as; 1764 Bitfield<37> tbi0; 1765 Bitfield<38> tbi1; 1766 // Common 1767 Bitfield<31> eae; 1768 // TCR_EL2/3 (AArch64) 1769 Bitfield<18, 16> ps; 1770 Bitfield<20> tbi; 1771 EndBitUnion(TTBCR) 1772 1773 // Fields of TCR_EL{1,2,3} (mostly overlapping) 1774 // TCR_EL1 is natively 64 bits, the others are 32 bits 1775 BitUnion64(TCR) 1776 Bitfield<5, 0> t0sz; 1777 Bitfield<7> epd0; // EL1 1778 Bitfield<9, 8> irgn0; 1779 Bitfield<11, 10> orgn0; 1780 Bitfield<13, 12> sh0; 1781 Bitfield<15, 14> tg0; 1782 Bitfield<18, 16> ps; 1783 Bitfield<20> tbi; // EL2/EL3 1784 Bitfield<21, 16> t1sz; // EL1 1785 Bitfield<22> a1; // EL1 1786 Bitfield<23> epd1; // EL1 1787 Bitfield<25, 24> irgn1; // EL1 1788 Bitfield<27, 26> orgn1; // EL1 1789 Bitfield<29, 28> sh1; // EL1 1790 Bitfield<31, 30> tg1; // EL1 1791 Bitfield<34, 32> ips; // EL1 1792 Bitfield<36> as; // EL1 1793 Bitfield<37> tbi0; // EL1 1794 Bitfield<38> tbi1; // EL1 1795 EndBitUnion(TCR) 1796 1797 BitUnion32(HTCR) 1798 Bitfield<2, 0> t0sz; 1799 Bitfield<9, 8> irgn0; 1800 Bitfield<11, 10> orgn0; 1801 Bitfield<13, 12> sh0; 1802 EndBitUnion(HTCR) 1803 1804 BitUnion32(VTCR_t) 1805 Bitfield<3, 0> t0sz; 1806 Bitfield<4> s; 1807 Bitfield<5, 0> t0sz64; 1808 Bitfield<7, 6> sl0; 1809 Bitfield<9, 8> irgn0; 1810 Bitfield<11, 10> orgn0; 1811 Bitfield<13, 12> sh0; 1812 Bitfield<15, 14> tg0; 1813 EndBitUnion(VTCR_t) 1814 1815 BitUnion32(PRRR) 1816 Bitfield<1,0> tr0; 1817 Bitfield<3,2> tr1; 1818 Bitfield<5,4> tr2; 1819 Bitfield<7,6> tr3; 1820 Bitfield<9,8> tr4; 1821 Bitfield<11,10> tr5; 1822 Bitfield<13,12> tr6; 1823 Bitfield<15,14> tr7; 1824 Bitfield<16> ds0; 1825 Bitfield<17> ds1; 1826 Bitfield<18> ns0; 1827 Bitfield<19> ns1; 1828 Bitfield<24> nos0; 1829 Bitfield<25> nos1; 1830 Bitfield<26> nos2; 1831 Bitfield<27> nos3; 1832 Bitfield<28> nos4; 1833 Bitfield<29> nos5; 1834 Bitfield<30> nos6; 1835 Bitfield<31> nos7; 1836 EndBitUnion(PRRR) 1837 1838 BitUnion32(NMRR) 1839 Bitfield<1,0> ir0; 1840 Bitfield<3,2> ir1; 1841 Bitfield<5,4> ir2; 1842 Bitfield<7,6> ir3; 1843 Bitfield<9,8> ir4; 1844 Bitfield<11,10> ir5; 1845 Bitfield<13,12> ir6; 1846 Bitfield<15,14> ir7; 1847 Bitfield<17,16> or0; 1848 Bitfield<19,18> or1; 1849 Bitfield<21,20> or2; 1850 Bitfield<23,22> or3; 1851 Bitfield<25,24> or4; 1852 Bitfield<27,26> or5; 1853 Bitfield<29,28> or6; 1854 Bitfield<31,30> or7; 1855 EndBitUnion(NMRR) 1856 1857 BitUnion32(CONTEXTIDR) 1858 Bitfield<7,0> asid; 1859 Bitfield<31,8> procid; 1860 EndBitUnion(CONTEXTIDR) 1861 1862 BitUnion32(L2CTLR) 1863 Bitfield<2,0> sataRAMLatency; 1864 Bitfield<4,3> reserved_4_3; 1865 Bitfield<5> dataRAMSetup; 1866 Bitfield<8,6> tagRAMLatency; 1867 Bitfield<9> tagRAMSetup; 1868 Bitfield<11,10> dataRAMSlice; 1869 Bitfield<12> tagRAMSlice; 1870 Bitfield<20,13> reserved_20_13; 1871 Bitfield<21> eccandParityEnable; 1872 Bitfield<22> reserved_22; 1873 Bitfield<23> interptCtrlPresent; 1874 Bitfield<25,24> numCPUs; 1875 Bitfield<30,26> reserved_30_26; 1876 Bitfield<31> l2rstDISABLE_monitor; 1877 EndBitUnion(L2CTLR) 1878 1879 BitUnion32(CTR) 1880 Bitfield<3,0> iCacheLineSize; 1881 Bitfield<13,4> raz_13_4; 1882 Bitfield<15,14> l1IndexPolicy; 1883 Bitfield<19,16> dCacheLineSize; 1884 Bitfield<23,20> erg; 1885 Bitfield<27,24> cwg; 1886 Bitfield<28> raz_28; 1887 Bitfield<31,29> format; 1888 EndBitUnion(CTR) 1889 1890 BitUnion32(PMSELR) 1891 Bitfield<4, 0> sel; 1892 EndBitUnion(PMSELR) 1893 1894 BitUnion64(PAR) 1895 // 64-bit format 1896 Bitfield<63, 56> attr; 1897 Bitfield<39, 12> pa; 1898 Bitfield<11> lpae; 1899 Bitfield<9> ns; 1900 Bitfield<8, 7> sh; 1901 Bitfield<0> f; 1902 EndBitUnion(PAR) 1903 1904 BitUnion32(ESR) 1905 Bitfield<31, 26> ec; 1906 Bitfield<25> il; 1907 Bitfield<15, 0> imm16; 1908 EndBitUnion(ESR) 1909 1910 BitUnion32(CPTR) 1911 Bitfield<31> tcpac; 1912 Bitfield<20> tta; 1913 Bitfield<13, 12> res1_13_12_el2; 1914 Bitfield<10> tfp; 1915 Bitfield<9, 0> res1_9_0_el2; 1916 EndBitUnion(CPTR) 1917 1918 1919 /** 1920 * Check for permission to read coprocessor registers. 1921 * 1922 * Checks whether an instruction at the current program mode has 1923 * permissions to read the coprocessor registers. This function 1924 * returns whether the check is undefined and if not whether the 1925 * read access is permitted. 1926 * 1927 * @param the misc reg indicating the coprocessor 1928 * @param the SCR 1929 * @param the CPSR 1930 * @return a tuple of booleans: can_read, undefined 1931 */ 1932 std::tuple<bool, bool> canReadCoprocReg(MiscRegIndex reg, SCR scr, 1933 CPSR cpsr); 1934 1935 /** 1936 * Check for permission to write coprocessor registers. 1937 * 1938 * Checks whether an instruction at the current program mode has 1939 * permissions to write the coprocessor registers. This function 1940 * returns whether the check is undefined and if not whether the 1941 * write access is permitted. 1942 * 1943 * @param the misc reg indicating the coprocessor 1944 * @param the SCR 1945 * @param the CPSR 1946 * @return a tuple of booleans: can_write, undefined 1947 */ 1948 std::tuple<bool, bool> canWriteCoprocReg(MiscRegIndex reg, SCR scr, 1949 CPSR cpsr); 1950 1951 // Checks read access permissions to AArch64 system registers 1952 bool canReadAArch64SysReg(MiscRegIndex reg, SCR scr, CPSR cpsr, 1953 ThreadContext *tc); 1954 1955 // Checks write access permissions to AArch64 system registers 1956 bool canWriteAArch64SysReg(MiscRegIndex reg, SCR scr, CPSR cpsr, 1957 ThreadContext *tc); 1958 1959 // Uses just the scr.ns bit to pre flatten the misc regs. This is useful 1960 // for MCR/MRC instructions 1961 int 1962 snsBankedIndex(MiscRegIndex reg, ThreadContext *tc); 1963 1964 // Flattens a misc reg index using the specified security state. This is 1965 // used for opperations (eg address translations) where the security 1966 // state of the register access may differ from the current state of the 1967 // processor 1968 int 1969 snsBankedIndex(MiscRegIndex reg, ThreadContext *tc, bool ns); 1970 1971 // Takes a misc reg index and returns the root reg if its one of a set of 1972 // banked registers 1973 void 1974 preUnflattenMiscReg(); 1975 1976 int 1977 unflattenMiscReg(int reg); 1978 1979} 1980 1981#endif // __ARCH_ARM_MISCREGS_HH__ 1982