miscregs.hh revision 9051
16242Sgblack@eecs.umich.edu/*
28868SMatt.Horsnell@arm.com * Copyright (c) 2010-2012 ARM Limited
37093Sgblack@eecs.umich.edu * All rights reserved
47093Sgblack@eecs.umich.edu *
57093Sgblack@eecs.umich.edu * The license below extends only to copyright in the software and shall
67093Sgblack@eecs.umich.edu * not be construed as granting a license to any other intellectual
77093Sgblack@eecs.umich.edu * property including but not limited to intellectual property relating
87093Sgblack@eecs.umich.edu * to a hardware implementation of the functionality of the software
97093Sgblack@eecs.umich.edu * licensed hereunder.  You may use the software subject to the license
107093Sgblack@eecs.umich.edu * terms below provided that you ensure that this notice is replicated
117093Sgblack@eecs.umich.edu * unmodified and in its entirety in all distributions of the software,
127093Sgblack@eecs.umich.edu * modified or unmodified, in source code or in binary form.
137093Sgblack@eecs.umich.edu *
146242Sgblack@eecs.umich.edu * Copyright (c) 2009 The Regents of The University of Michigan
156242Sgblack@eecs.umich.edu * All rights reserved.
166242Sgblack@eecs.umich.edu *
176242Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
186242Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
196242Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
206242Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
216242Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
226242Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
236242Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
246242Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
256242Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
266242Sgblack@eecs.umich.edu * this software without specific prior written permission.
276242Sgblack@eecs.umich.edu *
286242Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
296242Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
306242Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
316242Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
326242Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
336242Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
346242Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
356242Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
366242Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
376242Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
386242Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
396242Sgblack@eecs.umich.edu *
406242Sgblack@eecs.umich.edu * Authors: Gabe Black
416242Sgblack@eecs.umich.edu */
426242Sgblack@eecs.umich.edu#ifndef __ARCH_ARM_MISCREGS_HH__
436242Sgblack@eecs.umich.edu#define __ARCH_ARM_MISCREGS_HH__
446242Sgblack@eecs.umich.edu
456242Sgblack@eecs.umich.edu#include "base/bitunion.hh"
466242Sgblack@eecs.umich.edu
476242Sgblack@eecs.umich.edunamespace ArmISA
486242Sgblack@eecs.umich.edu{
496242Sgblack@eecs.umich.edu    enum ConditionCode {
506242Sgblack@eecs.umich.edu        COND_EQ  =   0,
516242Sgblack@eecs.umich.edu        COND_NE, //  1
526242Sgblack@eecs.umich.edu        COND_CS, //  2
536242Sgblack@eecs.umich.edu        COND_CC, //  3
546242Sgblack@eecs.umich.edu        COND_MI, //  4
556242Sgblack@eecs.umich.edu        COND_PL, //  5
566242Sgblack@eecs.umich.edu        COND_VS, //  6
576242Sgblack@eecs.umich.edu        COND_VC, //  7
586242Sgblack@eecs.umich.edu        COND_HI, //  8
596242Sgblack@eecs.umich.edu        COND_LS, //  9
606242Sgblack@eecs.umich.edu        COND_GE, // 10
616242Sgblack@eecs.umich.edu        COND_LT, // 11
626242Sgblack@eecs.umich.edu        COND_GT, // 12
636242Sgblack@eecs.umich.edu        COND_LE, // 13
646242Sgblack@eecs.umich.edu        COND_AL, // 14
657111Sgblack@eecs.umich.edu        COND_UC  // 15
666242Sgblack@eecs.umich.edu    };
676242Sgblack@eecs.umich.edu
686242Sgblack@eecs.umich.edu    enum MiscRegIndex {
696242Sgblack@eecs.umich.edu        MISCREG_CPSR = 0,
708302SAli.Saidi@ARM.com        MISCREG_CPSR_Q,
716735Sgblack@eecs.umich.edu        MISCREG_SPSR,
726242Sgblack@eecs.umich.edu        MISCREG_SPSR_FIQ,
736242Sgblack@eecs.umich.edu        MISCREG_SPSR_IRQ,
746242Sgblack@eecs.umich.edu        MISCREG_SPSR_SVC,
756723Sgblack@eecs.umich.edu        MISCREG_SPSR_MON,
766242Sgblack@eecs.umich.edu        MISCREG_SPSR_UND,
776242Sgblack@eecs.umich.edu        MISCREG_SPSR_ABT,
786261Sgblack@eecs.umich.edu        MISCREG_FPSR,
796403Sgblack@eecs.umich.edu        MISCREG_FPSID,
806403Sgblack@eecs.umich.edu        MISCREG_FPSCR,
817783SGiacomo.Gabrielli@arm.com        MISCREG_FPSCR_QC,  // Cumulative saturation flag
827783SGiacomo.Gabrielli@arm.com        MISCREG_FPSCR_EXC,  // Cumulative FP exception flags
836403Sgblack@eecs.umich.edu        MISCREG_FPEXC,
847325Sgblack@eecs.umich.edu        MISCREG_MVFR0,
857325Sgblack@eecs.umich.edu        MISCREG_MVFR1,
867400SAli.Saidi@ARM.com        MISCREG_SCTLR_RST,
877350SAli.Saidi@ARM.com        MISCREG_SEV_MAILBOX,
887259Sgblack@eecs.umich.edu
898868SMatt.Horsnell@arm.com        // CP14 registers
908868SMatt.Horsnell@arm.com        MISCREG_CP14_START,
918868SMatt.Horsnell@arm.com        MISCREG_DBGDIDR = MISCREG_CP14_START,
928868SMatt.Horsnell@arm.com        MISCREG_DBGDSCR_INT,
938868SMatt.Horsnell@arm.com        MISCREG_DBGDTRRX_INT,
948868SMatt.Horsnell@arm.com        MISCREG_DBGTRTX_INT,
958868SMatt.Horsnell@arm.com        MISCREG_DBGWFAR,
968868SMatt.Horsnell@arm.com        MISCREG_DBGVCR,
978868SMatt.Horsnell@arm.com        MISCREG_DBGECR,
988868SMatt.Horsnell@arm.com        MISCREG_DBGDSCCR,
998868SMatt.Horsnell@arm.com        MISCREG_DBGSMCR,
1008868SMatt.Horsnell@arm.com        MISCREG_DBGDTRRX_EXT,
1018868SMatt.Horsnell@arm.com        MISCREG_DBGDSCR_EXT,
1028868SMatt.Horsnell@arm.com        MISCREG_DBGDTRTX_EXT,
1038868SMatt.Horsnell@arm.com        MISCREG_DBGDRCR,
1048868SMatt.Horsnell@arm.com        MISCREG_DBGBVR,
1058868SMatt.Horsnell@arm.com        MISCREG_DBGBCR,
1068868SMatt.Horsnell@arm.com        MISCREG_DBGBVR_M,
1078868SMatt.Horsnell@arm.com        MISCREG_DBGBCR_M,
1088868SMatt.Horsnell@arm.com        MISCREG_DBGDRAR,
1098868SMatt.Horsnell@arm.com        MISCREG_DBGBXVR_M,
1108868SMatt.Horsnell@arm.com        MISCREG_DBGOSLAR,
1118868SMatt.Horsnell@arm.com        MISCREG_DBGOSSRR,
1128868SMatt.Horsnell@arm.com        MISCREG_DBGOSDLR,
1138868SMatt.Horsnell@arm.com        MISCREG_DBGPRCR,
1148868SMatt.Horsnell@arm.com        MISCREG_DBGPRSR,
1158868SMatt.Horsnell@arm.com        MISCREG_DBGDSAR,
1168868SMatt.Horsnell@arm.com        MISCREG_DBGITCTRL,
1178868SMatt.Horsnell@arm.com        MISCREG_DBGCLAIMSET,
1188868SMatt.Horsnell@arm.com        MISCREG_DBGCLAIMCLR,
1198868SMatt.Horsnell@arm.com        MISCREG_DBGAUTHSTATUS,
1208868SMatt.Horsnell@arm.com        MISCREG_DBGDEVID2,
1218868SMatt.Horsnell@arm.com        MISCREG_DBGDEVID1,
1228868SMatt.Horsnell@arm.com        MISCREG_DBGDEVID,
1238868SMatt.Horsnell@arm.com
1247259Sgblack@eecs.umich.edu        // CP15 registers
1257259Sgblack@eecs.umich.edu        MISCREG_CP15_START,
1267259Sgblack@eecs.umich.edu        MISCREG_SCTLR = MISCREG_CP15_START,
1277264Sgblack@eecs.umich.edu        MISCREG_DCCISW,
1287267Sgblack@eecs.umich.edu        MISCREG_DCCIMVAC,
1297285Sgblack@eecs.umich.edu        MISCREG_DCCMVAC,
1307265Sgblack@eecs.umich.edu        MISCREG_CONTEXTIDR,
1317266Sgblack@eecs.umich.edu        MISCREG_TPIDRURW,
1327266Sgblack@eecs.umich.edu        MISCREG_TPIDRURO,
1337266Sgblack@eecs.umich.edu        MISCREG_TPIDRPRW,
1347268Sgblack@eecs.umich.edu        MISCREG_CP15ISB,
1357272Sgblack@eecs.umich.edu        MISCREG_CP15DSB,
1367272Sgblack@eecs.umich.edu        MISCREG_CP15DMB,
1377271Sgblack@eecs.umich.edu        MISCREG_CPACR,
1387273Sgblack@eecs.umich.edu        MISCREG_CLIDR,
1397287Sgblack@eecs.umich.edu        MISCREG_CCSIDR,
1407287Sgblack@eecs.umich.edu        MISCREG_CSSELR,
1417274Sgblack@eecs.umich.edu        MISCREG_ICIALLUIS,
1427275Sgblack@eecs.umich.edu        MISCREG_ICIALLU,
1437276Sgblack@eecs.umich.edu        MISCREG_ICIMVAU,
1447286Sgblack@eecs.umich.edu        MISCREG_BPIMVA,
1457297Sgblack@eecs.umich.edu        MISCREG_BPIALLIS,
1467297Sgblack@eecs.umich.edu        MISCREG_BPIALL,
1477298Sgblack@eecs.umich.edu        MISCREG_MIDR,
1487352Sgblack@eecs.umich.edu        MISCREG_TTBR0,
1497352Sgblack@eecs.umich.edu        MISCREG_TTBR1,
1507354Sgblack@eecs.umich.edu        MISCREG_TLBTR,
1517353Sgblack@eecs.umich.edu        MISCREG_DACR,
1527355Sgblack@eecs.umich.edu        MISCREG_TLBIALLIS,
1537355Sgblack@eecs.umich.edu        MISCREG_TLBIMVAIS,
1547355Sgblack@eecs.umich.edu        MISCREG_TLBIASIDIS,
1557355Sgblack@eecs.umich.edu        MISCREG_TLBIMVAAIS,
1567355Sgblack@eecs.umich.edu        MISCREG_ITLBIALL,
1577355Sgblack@eecs.umich.edu        MISCREG_ITLBIMVA,
1587355Sgblack@eecs.umich.edu        MISCREG_ITLBIASID,
1597355Sgblack@eecs.umich.edu        MISCREG_DTLBIALL,
1607355Sgblack@eecs.umich.edu        MISCREG_DTLBIMVA,
1617355Sgblack@eecs.umich.edu        MISCREG_DTLBIASID,
1627355Sgblack@eecs.umich.edu        MISCREG_TLBIALL,
1637355Sgblack@eecs.umich.edu        MISCREG_TLBIMVA,
1647355Sgblack@eecs.umich.edu        MISCREG_TLBIASID,
1657355Sgblack@eecs.umich.edu        MISCREG_TLBIMVAA,
1667362Sgblack@eecs.umich.edu        MISCREG_DFSR,
1677362Sgblack@eecs.umich.edu        MISCREG_IFSR,
1687362Sgblack@eecs.umich.edu        MISCREG_DFAR,
1697362Sgblack@eecs.umich.edu        MISCREG_IFAR,
1707390Sgblack@eecs.umich.edu        MISCREG_MPIDR,
1717404SAli.Saidi@ARM.com        MISCREG_PRRR,
1727404SAli.Saidi@ARM.com        MISCREG_NMRR,
1737404SAli.Saidi@ARM.com        MISCREG_TTBCR,
1747404SAli.Saidi@ARM.com        MISCREG_ID_PFR0,
1757406SAli.Saidi@ARM.com        MISCREG_CTR,
1767406SAli.Saidi@ARM.com        MISCREG_SCR,
1777406SAli.Saidi@ARM.com        MISCREG_SDER,
1787436Sdam.sunwoo@arm.com        MISCREG_PAR,
1797436Sdam.sunwoo@arm.com        MISCREG_V2PCWPR,
1807436Sdam.sunwoo@arm.com        MISCREG_V2PCWPW,
1817436Sdam.sunwoo@arm.com        MISCREG_V2PCWUR,
1827436Sdam.sunwoo@arm.com        MISCREG_V2PCWUW,
1837436Sdam.sunwoo@arm.com        MISCREG_V2POWPR,
1847436Sdam.sunwoo@arm.com        MISCREG_V2POWPW,
1857436Sdam.sunwoo@arm.com        MISCREG_V2POWUR,
1867436Sdam.sunwoo@arm.com        MISCREG_V2POWUW,
1877583SAli.Saidi@arm.com        MISCREG_ID_MMFR0,
1888468Swade.walker@arm.com        MISCREG_ID_MMFR2,
1898284SAli.Saidi@ARM.com        MISCREG_ID_MMFR3,
1907583SAli.Saidi@arm.com        MISCREG_ACTLR,
1917583SAli.Saidi@arm.com        MISCREG_PMCR,
1927583SAli.Saidi@arm.com        MISCREG_PMCCNTR,
1937583SAli.Saidi@arm.com        MISCREG_PMCNTENSET,
1947583SAli.Saidi@arm.com        MISCREG_PMCNTENCLR,
1957583SAli.Saidi@arm.com        MISCREG_PMOVSR,
1967583SAli.Saidi@arm.com        MISCREG_PMSWINC,
1977583SAli.Saidi@arm.com        MISCREG_PMSELR,
1987583SAli.Saidi@arm.com        MISCREG_PMCEID0,
1997583SAli.Saidi@arm.com        MISCREG_PMCEID1,
2007583SAli.Saidi@arm.com        MISCREG_PMC_OTHER,
2017583SAli.Saidi@arm.com        MISCREG_PMXEVCNTR,
2027583SAli.Saidi@arm.com        MISCREG_PMUSERENR,
2037583SAli.Saidi@arm.com        MISCREG_PMINTENSET,
2047583SAli.Saidi@arm.com        MISCREG_PMINTENCLR,
2058147SAli.Saidi@ARM.com        MISCREG_ID_ISAR0,
2068147SAli.Saidi@ARM.com        MISCREG_ID_ISAR1,
2078147SAli.Saidi@ARM.com        MISCREG_ID_ISAR2,
2088147SAli.Saidi@ARM.com        MISCREG_ID_ISAR3,
2098147SAli.Saidi@ARM.com        MISCREG_ID_ISAR4,
2108147SAli.Saidi@ARM.com        MISCREG_ID_ISAR5,
2118208SAli.Saidi@ARM.com        MISCREG_CPSR_MODE,
2128209SAli.Saidi@ARM.com        MISCREG_LOCKFLAG,
2138209SAli.Saidi@ARM.com        MISCREG_LOCKADDR,
2148299Schander.sudanthi@arm.com        MISCREG_ID_PFR1,
2158549Sdaniel.johnson@arm.com        MISCREG_L2CTLR,
2167259Sgblack@eecs.umich.edu        MISCREG_CP15_UNIMP_START,
2177406SAli.Saidi@ARM.com        MISCREG_TCMTR = MISCREG_CP15_UNIMP_START,
2187259Sgblack@eecs.umich.edu        MISCREG_ID_DFR0,
2197259Sgblack@eecs.umich.edu        MISCREG_ID_AFR0,
2207259Sgblack@eecs.umich.edu        MISCREG_ID_MMFR1,
2217259Sgblack@eecs.umich.edu        MISCREG_AIDR,
2227259Sgblack@eecs.umich.edu        MISCREG_ADFSR,
2237259Sgblack@eecs.umich.edu        MISCREG_AIFSR,
2247259Sgblack@eecs.umich.edu        MISCREG_DCIMVAC,
2257259Sgblack@eecs.umich.edu        MISCREG_DCISW,
2267259Sgblack@eecs.umich.edu        MISCREG_MCCSW,
2277259Sgblack@eecs.umich.edu        MISCREG_DCCMVAU,
2287351Sgblack@eecs.umich.edu        MISCREG_NSACR,
2297351Sgblack@eecs.umich.edu        MISCREG_VBAR,
2307351Sgblack@eecs.umich.edu        MISCREG_MVBAR,
2317351Sgblack@eecs.umich.edu        MISCREG_ISR,
2327351Sgblack@eecs.umich.edu        MISCREG_FCEIDR,
2338058SAli.Saidi@ARM.com        MISCREG_L2LATENCY,
2348550SChander.Sudanthi@ARM.com        MISCREG_CRN15,
2357351Sgblack@eecs.umich.edu
2367259Sgblack@eecs.umich.edu
2377259Sgblack@eecs.umich.edu        MISCREG_CP15_END,
2387259Sgblack@eecs.umich.edu
2397259Sgblack@eecs.umich.edu        // Dummy indices
2407259Sgblack@eecs.umich.edu        MISCREG_NOP = MISCREG_CP15_END,
2417259Sgblack@eecs.umich.edu        MISCREG_RAZ,
2427259Sgblack@eecs.umich.edu
2436735Sgblack@eecs.umich.edu        NUM_MISCREGS
2446261Sgblack@eecs.umich.edu    };
2456261Sgblack@eecs.umich.edu
2468868SMatt.Horsnell@arm.com    MiscRegIndex decodeCP14Reg(unsigned crn, unsigned opc1,
2478868SMatt.Horsnell@arm.com                               unsigned crm, unsigned opc2);
2488868SMatt.Horsnell@arm.com
2497259Sgblack@eecs.umich.edu    MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1,
2507259Sgblack@eecs.umich.edu                               unsigned crm, unsigned opc2);
2517259Sgblack@eecs.umich.edu
2528868SMatt.Horsnell@arm.com
2536261Sgblack@eecs.umich.edu    const char * const miscRegName[NUM_MISCREGS] = {
2548302SAli.Saidi@ARM.com        "cpsr", "cpsr_q", "spsr", "spsr_fiq", "spsr_irq", "spsr_svc",
2557259Sgblack@eecs.umich.edu        "spsr_mon", "spsr_und", "spsr_abt",
2567783SGiacomo.Gabrielli@arm.com        "fpsr", "fpsid", "fpscr", "fpscr_qc", "fpscr_exc", "fpexc",
2577783SGiacomo.Gabrielli@arm.com        "mvfr0", "mvfr1",
2587400SAli.Saidi@ARM.com        "sctlr_rst", "sev_mailbox",
2598868SMatt.Horsnell@arm.com        "DBGDIDR",
2608868SMatt.Horsnell@arm.com        "DBGDSCR_INT",
2618868SMatt.Horsnell@arm.com        "DBGDTRRX_INT",
2628868SMatt.Horsnell@arm.com        "DBGTRTX_INT",
2638868SMatt.Horsnell@arm.com        "DBGWFAR",
2648868SMatt.Horsnell@arm.com        "DBGVCR",
2658868SMatt.Horsnell@arm.com        "DBGECR",
2668868SMatt.Horsnell@arm.com        "DBGDSCCR",
2678868SMatt.Horsnell@arm.com        "DBGSMCR",
2688868SMatt.Horsnell@arm.com        "DBGDTRRX_EXT",
2698868SMatt.Horsnell@arm.com        "DBGDSCR_EXT",
2708868SMatt.Horsnell@arm.com        "DBGDTRTX_EXT",
2718868SMatt.Horsnell@arm.com        "DBGDRCR",
2728868SMatt.Horsnell@arm.com        "DBGBVR",
2738868SMatt.Horsnell@arm.com        "DBGBCR",
2748868SMatt.Horsnell@arm.com        "DBGBVR_M",
2758868SMatt.Horsnell@arm.com        "DBGBCR_M",
2768868SMatt.Horsnell@arm.com        "DBGDRAR",
2778868SMatt.Horsnell@arm.com        "DBGBXVR_M",
2788868SMatt.Horsnell@arm.com        "DBGOSLAR",
2798868SMatt.Horsnell@arm.com        "DBGOSSRR",
2808868SMatt.Horsnell@arm.com        "DBGOSDLR",
2818868SMatt.Horsnell@arm.com        "DBGPRCR",
2828868SMatt.Horsnell@arm.com        "DBGPRSR",
2838868SMatt.Horsnell@arm.com        "DBGDSAR",
2848868SMatt.Horsnell@arm.com        "DBGITCTRL",
2858868SMatt.Horsnell@arm.com        "DBGCLAIMSET",
2868868SMatt.Horsnell@arm.com        "DBGCLAIMCLR",
2878868SMatt.Horsnell@arm.com        "DBGAUTHSTATUS",
2888868SMatt.Horsnell@arm.com        "DBGDEVID2",
2898868SMatt.Horsnell@arm.com        "DBGDEVID1",
2908868SMatt.Horsnell@arm.com        "DBGDEVID",
2917285Sgblack@eecs.umich.edu        "sctlr", "dccisw", "dccimvac", "dccmvac",
2927267Sgblack@eecs.umich.edu        "contextidr", "tpidrurw", "tpidruro", "tpidrprw",
2937287Sgblack@eecs.umich.edu        "cp15isb", "cp15dsb", "cp15dmb", "cpacr",
2947287Sgblack@eecs.umich.edu        "clidr", "ccsidr", "csselr",
2957297Sgblack@eecs.umich.edu        "icialluis", "iciallu", "icimvau",
2967297Sgblack@eecs.umich.edu        "bpimva", "bpiallis", "bpiall",
2977355Sgblack@eecs.umich.edu        "midr", "ttbr0", "ttbr1", "tlbtr", "dacr",
2987355Sgblack@eecs.umich.edu        "tlbiallis", "tlbimvais", "tlbiasidis", "tlbimvaais",
2997355Sgblack@eecs.umich.edu        "itlbiall", "itlbimva", "itlbiasid",
3007355Sgblack@eecs.umich.edu        "dtlbiall", "dtlbimva", "dtlbiasid",
3017355Sgblack@eecs.umich.edu        "tlbiall", "tlbimva", "tlbiasid", "tlbimvaa",
3027390Sgblack@eecs.umich.edu        "dfsr", "ifsr", "dfar", "ifar", "mpidr",
3037436Sdam.sunwoo@arm.com        "prrr", "nmrr",  "ttbcr", "id_pfr0", "ctr",
3047436Sdam.sunwoo@arm.com        "scr", "sder", "par",
3057436Sdam.sunwoo@arm.com        "v2pcwpr", "v2pcwpw", "v2pcwur", "v2pcwuw",
3067436Sdam.sunwoo@arm.com        "v2powpr", "v2powpw", "v2powur", "v2powuw",
3078468Swade.walker@arm.com        "id_mmfr0", "id_mmfr2", "id_mmfr3", "actlr", "pmcr", "pmccntr",
3087583SAli.Saidi@arm.com        "pmcntenset", "pmcntenclr", "pmovsr",
3097583SAli.Saidi@arm.com        "pmswinc", "pmselr", "pmceid0",
3107583SAli.Saidi@arm.com        "pmceid1", "pmc_other", "pmxevcntr",
3117583SAli.Saidi@arm.com        "pmuserenr", "pmintenset", "pmintenclr",
3128147SAli.Saidi@ARM.com        "id_isar0", "id_isar1", "id_isar2", "id_isar3", "id_isar4", "id_isar5",
3138299Schander.sudanthi@arm.com        "cpsr_mode", "lockflag", "lockaddr", "id_pfr1",
3148549Sdaniel.johnson@arm.com        "l2ctlr",
3157583SAli.Saidi@arm.com         // Unimplemented below
3167406SAli.Saidi@ARM.com        "tcmtr",
3178299Schander.sudanthi@arm.com        "id_dfr0", "id_afr0",
3188468Swade.walker@arm.com        "id_mmfr1",
3198147SAli.Saidi@ARM.com        "aidr", "adfsr", "aifsr",
3207297Sgblack@eecs.umich.edu        "dcimvac", "dcisw", "mccsw",
3217272Sgblack@eecs.umich.edu        "dccmvau",
3227406SAli.Saidi@ARM.com        "nsacr",
3238179Sgblack@eecs.umich.edu        "vbar", "mvbar", "isr", "fceidr", "l2latency",
3248550SChander.Sudanthi@ARM.com        "crn15",
3257259Sgblack@eecs.umich.edu        "nop", "raz"
3266242Sgblack@eecs.umich.edu    };
3276242Sgblack@eecs.umich.edu
3286242Sgblack@eecs.umich.edu    BitUnion32(CPSR)
3298303SAli.Saidi@ARM.com        Bitfield<31,30> nz;
3306242Sgblack@eecs.umich.edu        Bitfield<29> c;
3316242Sgblack@eecs.umich.edu        Bitfield<28> v;
3326242Sgblack@eecs.umich.edu        Bitfield<27> q;
3336735Sgblack@eecs.umich.edu        Bitfield<26,25> it1;
3346242Sgblack@eecs.umich.edu        Bitfield<24> j;
3356242Sgblack@eecs.umich.edu        Bitfield<19, 16> ge;
3366735Sgblack@eecs.umich.edu        Bitfield<15,10> it2;
3376242Sgblack@eecs.umich.edu        Bitfield<9> e;
3386242Sgblack@eecs.umich.edu        Bitfield<8> a;
3396242Sgblack@eecs.umich.edu        Bitfield<7> i;
3406242Sgblack@eecs.umich.edu        Bitfield<6> f;
3416242Sgblack@eecs.umich.edu        Bitfield<5> t;
3426242Sgblack@eecs.umich.edu        Bitfield<4, 0> mode;
3436242Sgblack@eecs.umich.edu    EndBitUnion(CPSR)
3446735Sgblack@eecs.umich.edu
3456750Sgblack@eecs.umich.edu    // This mask selects bits of the CPSR that actually go in the CondCodes
3466750Sgblack@eecs.umich.edu    // integer register to allow renaming.
3478302SAli.Saidi@ARM.com    static const uint32_t CondCodesMask   = 0xF00F0000;
3488302SAli.Saidi@ARM.com    static const uint32_t CpsrMaskQ       = 0x08000000;
3496750Sgblack@eecs.umich.edu
3506735Sgblack@eecs.umich.edu    BitUnion32(SCTLR)
3517360Sgblack@eecs.umich.edu        Bitfield<31> ie;  // Instruction endianness
3526735Sgblack@eecs.umich.edu        Bitfield<30> te;  // Thumb Exception Enable
3536735Sgblack@eecs.umich.edu        Bitfield<29> afe; // Access flag enable
3549051Schander.sudanthi@arm.com        Bitfield<28> tre; // TEX Remap bit
3556735Sgblack@eecs.umich.edu        Bitfield<27> nmfi;// Non-maskable fast interrupts enable
3566735Sgblack@eecs.umich.edu        Bitfield<25> ee;  // Exception Endianness bit
3576735Sgblack@eecs.umich.edu        Bitfield<24> ve;  // Interrupt vectors enable
3587406SAli.Saidi@ARM.com        Bitfield<23> xp; //  Extended page table enable bit
3596735Sgblack@eecs.umich.edu        Bitfield<22> u;   // Alignment (now unused)
3606735Sgblack@eecs.umich.edu        Bitfield<21> fi;  // Fast interrupts configuration enable
3617360Sgblack@eecs.umich.edu        Bitfield<19> dz;  // Divide by Zero fault enable bit
3626735Sgblack@eecs.umich.edu        Bitfield<18> rao2;// Read as one
3637360Sgblack@eecs.umich.edu        Bitfield<17> br;  // Background region bit
3646735Sgblack@eecs.umich.edu        Bitfield<16> rao3;// Read as one
3656735Sgblack@eecs.umich.edu        Bitfield<14> rr;  // Round robin cache replacement
3666735Sgblack@eecs.umich.edu        Bitfield<13> v;   // Base address for exception vectors
3676735Sgblack@eecs.umich.edu        Bitfield<12> i;   // instruction cache enable
3686735Sgblack@eecs.umich.edu        Bitfield<11> z;   // branch prediction enable bit
3696735Sgblack@eecs.umich.edu        Bitfield<10> sw;  // Enable swp/swpb
3707406SAli.Saidi@ARM.com        Bitfield<9,8> rs;   // deprecated protection bits
3716735Sgblack@eecs.umich.edu        Bitfield<6,3> rao4;// Read as one
3729051Schander.sudanthi@arm.com        Bitfield<7>  b;   // Endianness support (unused)
3736735Sgblack@eecs.umich.edu        Bitfield<2>  c;   // Cache enable bit
3746735Sgblack@eecs.umich.edu        Bitfield<1>  a;   // Alignment fault checking
3759051Schander.sudanthi@arm.com        Bitfield<0>  m;   // MMU enable bit
3766735Sgblack@eecs.umich.edu    EndBitUnion(SCTLR)
3777320Sgblack@eecs.umich.edu
3787320Sgblack@eecs.umich.edu    BitUnion32(CPACR)
3797320Sgblack@eecs.umich.edu        Bitfield<1, 0> cp0;
3807320Sgblack@eecs.umich.edu        Bitfield<3, 2> cp1;
3817320Sgblack@eecs.umich.edu        Bitfield<5, 4> cp2;
3827320Sgblack@eecs.umich.edu        Bitfield<7, 6> cp3;
3837320Sgblack@eecs.umich.edu        Bitfield<9, 8> cp4;
3847320Sgblack@eecs.umich.edu        Bitfield<11, 10> cp5;
3857320Sgblack@eecs.umich.edu        Bitfield<13, 12> cp6;
3867320Sgblack@eecs.umich.edu        Bitfield<15, 14> cp7;
3877320Sgblack@eecs.umich.edu        Bitfield<17, 16> cp8;
3887320Sgblack@eecs.umich.edu        Bitfield<19, 18> cp9;
3897320Sgblack@eecs.umich.edu        Bitfield<21, 20> cp10;
3907320Sgblack@eecs.umich.edu        Bitfield<23, 22> cp11;
3917320Sgblack@eecs.umich.edu        Bitfield<25, 24> cp12;
3927320Sgblack@eecs.umich.edu        Bitfield<27, 26> cp13;
3938206SWilliam.Wang@arm.com        Bitfield<29, 28> rsvd;
3947320Sgblack@eecs.umich.edu        Bitfield<30> d32dis;
3957320Sgblack@eecs.umich.edu        Bitfield<31> asedis;
3967320Sgblack@eecs.umich.edu    EndBitUnion(CPACR)
3977362Sgblack@eecs.umich.edu
3987362Sgblack@eecs.umich.edu    BitUnion32(FSR)
3997362Sgblack@eecs.umich.edu        Bitfield<3, 0> fsLow;
4007362Sgblack@eecs.umich.edu        Bitfield<7, 4> domain;
4017362Sgblack@eecs.umich.edu        Bitfield<10> fsHigh;
4027362Sgblack@eecs.umich.edu        Bitfield<11> wnr;
4037362Sgblack@eecs.umich.edu        Bitfield<12> ext;
4047362Sgblack@eecs.umich.edu    EndBitUnion(FSR)
4057376Sgblack@eecs.umich.edu
4067376Sgblack@eecs.umich.edu    BitUnion32(FPSCR)
4077376Sgblack@eecs.umich.edu        Bitfield<0> ioc;
4087376Sgblack@eecs.umich.edu        Bitfield<1> dzc;
4097376Sgblack@eecs.umich.edu        Bitfield<2> ofc;
4107376Sgblack@eecs.umich.edu        Bitfield<3> ufc;
4117376Sgblack@eecs.umich.edu        Bitfield<4> ixc;
4127376Sgblack@eecs.umich.edu        Bitfield<7> idc;
4137376Sgblack@eecs.umich.edu        Bitfield<8> ioe;
4147376Sgblack@eecs.umich.edu        Bitfield<9> dze;
4157376Sgblack@eecs.umich.edu        Bitfield<10> ofe;
4167376Sgblack@eecs.umich.edu        Bitfield<11> ufe;
4177376Sgblack@eecs.umich.edu        Bitfield<12> ixe;
4187376Sgblack@eecs.umich.edu        Bitfield<15> ide;
4197376Sgblack@eecs.umich.edu        Bitfield<18, 16> len;
4207376Sgblack@eecs.umich.edu        Bitfield<21, 20> stride;
4217376Sgblack@eecs.umich.edu        Bitfield<23, 22> rMode;
4227376Sgblack@eecs.umich.edu        Bitfield<24> fz;
4237376Sgblack@eecs.umich.edu        Bitfield<25> dn;
4247376Sgblack@eecs.umich.edu        Bitfield<26> ahp;
4257376Sgblack@eecs.umich.edu        Bitfield<27> qc;
4267376Sgblack@eecs.umich.edu        Bitfield<28> v;
4277376Sgblack@eecs.umich.edu        Bitfield<29> c;
4287376Sgblack@eecs.umich.edu        Bitfield<30> z;
4297376Sgblack@eecs.umich.edu        Bitfield<31> n;
4307376Sgblack@eecs.umich.edu    EndBitUnion(FPSCR)
4317383Sgblack@eecs.umich.edu
4327643Sgblack@eecs.umich.edu    // This mask selects bits of the FPSCR that actually go in the FpCondCodes
4337643Sgblack@eecs.umich.edu    // integer register to allow renaming.
4347783SGiacomo.Gabrielli@arm.com    static const uint32_t FpCondCodesMask = 0xF0000000;
4357783SGiacomo.Gabrielli@arm.com    // This mask selects the cumulative FP exception flags of the FPSCR.
4367783SGiacomo.Gabrielli@arm.com    static const uint32_t FpscrExcMask = 0x0000009F;
4377783SGiacomo.Gabrielli@arm.com    // This mask selects the cumulative saturation flag of the FPSCR.
4387783SGiacomo.Gabrielli@arm.com    static const uint32_t FpscrQcMask = 0x08000000;
4397643Sgblack@eecs.umich.edu
4407640Sgblack@eecs.umich.edu    BitUnion32(FPEXC)
4417640Sgblack@eecs.umich.edu        Bitfield<31> ex;
4427640Sgblack@eecs.umich.edu        Bitfield<30> en;
4437640Sgblack@eecs.umich.edu        Bitfield<29, 0> subArchDefined;
4447640Sgblack@eecs.umich.edu    EndBitUnion(FPEXC)
4457640Sgblack@eecs.umich.edu
4467383Sgblack@eecs.umich.edu    BitUnion32(MVFR0)
4477383Sgblack@eecs.umich.edu        Bitfield<3, 0> advSimdRegisters;
4487383Sgblack@eecs.umich.edu        Bitfield<7, 4> singlePrecision;
4497383Sgblack@eecs.umich.edu        Bitfield<11, 8> doublePrecision;
4507383Sgblack@eecs.umich.edu        Bitfield<15, 12> vfpExceptionTrapping;
4517383Sgblack@eecs.umich.edu        Bitfield<19, 16> divide;
4527383Sgblack@eecs.umich.edu        Bitfield<23, 20> squareRoot;
4537383Sgblack@eecs.umich.edu        Bitfield<27, 24> shortVectors;
4547383Sgblack@eecs.umich.edu        Bitfield<31, 28> roundingModes;
4557383Sgblack@eecs.umich.edu    EndBitUnion(MVFR0)
4567383Sgblack@eecs.umich.edu
4577383Sgblack@eecs.umich.edu    BitUnion32(MVFR1)
4587383Sgblack@eecs.umich.edu        Bitfield<3, 0> flushToZero;
4597383Sgblack@eecs.umich.edu        Bitfield<7, 4> defaultNaN;
4607383Sgblack@eecs.umich.edu        Bitfield<11, 8> advSimdLoadStore;
4617383Sgblack@eecs.umich.edu        Bitfield<15, 12> advSimdInteger;
4627383Sgblack@eecs.umich.edu        Bitfield<19, 16> advSimdSinglePrecision;
4637383Sgblack@eecs.umich.edu        Bitfield<23, 20> advSimdHalfPrecision;
4647383Sgblack@eecs.umich.edu        Bitfield<27, 24> vfpHalfPrecision;
4657383Sgblack@eecs.umich.edu        Bitfield<31, 28> raz;
4667383Sgblack@eecs.umich.edu    EndBitUnion(MVFR1)
4677404SAli.Saidi@ARM.com
4687404SAli.Saidi@ARM.com    BitUnion32(PRRR)
4697404SAli.Saidi@ARM.com       Bitfield<1,0> tr0;
4707404SAli.Saidi@ARM.com       Bitfield<3,2> tr1;
4717404SAli.Saidi@ARM.com       Bitfield<5,4> tr2;
4727404SAli.Saidi@ARM.com       Bitfield<7,6> tr3;
4737404SAli.Saidi@ARM.com       Bitfield<9,8> tr4;
4747404SAli.Saidi@ARM.com       Bitfield<11,10> tr5;
4757404SAli.Saidi@ARM.com       Bitfield<13,12> tr6;
4767404SAli.Saidi@ARM.com       Bitfield<15,14> tr7;
4777404SAli.Saidi@ARM.com       Bitfield<16> ds0;
4787404SAli.Saidi@ARM.com       Bitfield<17> ds1;
4797404SAli.Saidi@ARM.com       Bitfield<18> ns0;
4807404SAli.Saidi@ARM.com       Bitfield<19> ns1;
4817404SAli.Saidi@ARM.com       Bitfield<24> nos0;
4827404SAli.Saidi@ARM.com       Bitfield<25> nos1;
4837404SAli.Saidi@ARM.com       Bitfield<26> nos2;
4847404SAli.Saidi@ARM.com       Bitfield<27> nos3;
4857404SAli.Saidi@ARM.com       Bitfield<28> nos4;
4867404SAli.Saidi@ARM.com       Bitfield<29> nos5;
4877404SAli.Saidi@ARM.com       Bitfield<30> nos6;
4887404SAli.Saidi@ARM.com       Bitfield<31> nos7;
4897404SAli.Saidi@ARM.com   EndBitUnion(PRRR)
4907404SAli.Saidi@ARM.com
4917404SAli.Saidi@ARM.com   BitUnion32(NMRR)
4927404SAli.Saidi@ARM.com       Bitfield<1,0> ir0;
4937404SAli.Saidi@ARM.com       Bitfield<3,2> ir1;
4947404SAli.Saidi@ARM.com       Bitfield<5,4> ir2;
4957404SAli.Saidi@ARM.com       Bitfield<7,6> ir3;
4967404SAli.Saidi@ARM.com       Bitfield<9,8> ir4;
4977404SAli.Saidi@ARM.com       Bitfield<11,10> ir5;
4987404SAli.Saidi@ARM.com       Bitfield<13,12> ir6;
4997404SAli.Saidi@ARM.com       Bitfield<15,14> ir7;
5007404SAli.Saidi@ARM.com       Bitfield<17,16> or0;
5017404SAli.Saidi@ARM.com       Bitfield<19,18> or1;
5027404SAli.Saidi@ARM.com       Bitfield<21,20> or2;
5037404SAli.Saidi@ARM.com       Bitfield<23,22> or3;
5047404SAli.Saidi@ARM.com       Bitfield<25,24> or4;
5057404SAli.Saidi@ARM.com       Bitfield<27,26> or5;
5067404SAli.Saidi@ARM.com       Bitfield<29,28> or6;
5077404SAli.Saidi@ARM.com       Bitfield<31,30> or7;
5087404SAli.Saidi@ARM.com   EndBitUnion(NMRR)
5097404SAli.Saidi@ARM.com
5108552Sdaniel.johnson@arm.com   BitUnion32(CONTEXTIDR)
5118552Sdaniel.johnson@arm.com      Bitfield<7,0>  asid;
5128552Sdaniel.johnson@arm.com      Bitfield<31,8> procid;
5138552Sdaniel.johnson@arm.com   EndBitUnion(CONTEXTIDR)
5148552Sdaniel.johnson@arm.com
5158549Sdaniel.johnson@arm.com   BitUnion32(L2CTLR)
5168549Sdaniel.johnson@arm.com      Bitfield<2,0>   sataRAMLatency;
5178549Sdaniel.johnson@arm.com      Bitfield<4,3>   reserved_4_3;
5188549Sdaniel.johnson@arm.com      Bitfield<5>     dataRAMSetup;
5198549Sdaniel.johnson@arm.com      Bitfield<8,6>   tagRAMLatency;
5208549Sdaniel.johnson@arm.com      Bitfield<9>     tagRAMSetup;
5218549Sdaniel.johnson@arm.com      Bitfield<11,10> dataRAMSlice;
5228549Sdaniel.johnson@arm.com      Bitfield<12>    tagRAMSlice;
5238549Sdaniel.johnson@arm.com      Bitfield<20,13> reserved_20_13;
5248549Sdaniel.johnson@arm.com      Bitfield<21>    eccandParityEnable;
5258549Sdaniel.johnson@arm.com      Bitfield<22>    reserved_22;
5268549Sdaniel.johnson@arm.com      Bitfield<23>    interptCtrlPresent;
5278549Sdaniel.johnson@arm.com      Bitfield<25,24> numCPUs;
5288549Sdaniel.johnson@arm.com      Bitfield<30,26> reserved_30_26;
5298549Sdaniel.johnson@arm.com      Bitfield<31>    l2rstDISABLE_monitor;
5308549Sdaniel.johnson@arm.com   EndBitUnion(L2CTLR)
5318549Sdaniel.johnson@arm.com
5328902Sandreas.hansson@arm.com}
5336242Sgblack@eecs.umich.edu
5346242Sgblack@eecs.umich.edu#endif // __ARCH_ARM_MISCREGS_HH__
535