miscregs.hh revision 7362
16242Sgblack@eecs.umich.edu/* 27093Sgblack@eecs.umich.edu * Copyright (c) 2010 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, 706735Sgblack@eecs.umich.edu MISCREG_SPSR, 716242Sgblack@eecs.umich.edu MISCREG_SPSR_FIQ, 726242Sgblack@eecs.umich.edu MISCREG_SPSR_IRQ, 736242Sgblack@eecs.umich.edu MISCREG_SPSR_SVC, 746723Sgblack@eecs.umich.edu MISCREG_SPSR_MON, 756242Sgblack@eecs.umich.edu MISCREG_SPSR_UND, 766242Sgblack@eecs.umich.edu MISCREG_SPSR_ABT, 776261Sgblack@eecs.umich.edu MISCREG_FPSR, 786403Sgblack@eecs.umich.edu MISCREG_FPSID, 796403Sgblack@eecs.umich.edu MISCREG_FPSCR, 806403Sgblack@eecs.umich.edu MISCREG_FPEXC, 817325Sgblack@eecs.umich.edu MISCREG_MVFR0, 827325Sgblack@eecs.umich.edu MISCREG_MVFR1, 837350SAli.Saidi@ARM.com MISCREG_SEV_MAILBOX, 847259Sgblack@eecs.umich.edu 857259Sgblack@eecs.umich.edu // CP15 registers 867259Sgblack@eecs.umich.edu MISCREG_CP15_START, 877259Sgblack@eecs.umich.edu MISCREG_SCTLR = MISCREG_CP15_START, 887264Sgblack@eecs.umich.edu MISCREG_DCCISW, 897267Sgblack@eecs.umich.edu MISCREG_DCCIMVAC, 907285Sgblack@eecs.umich.edu MISCREG_DCCMVAC, 917265Sgblack@eecs.umich.edu MISCREG_CONTEXTIDR, 927266Sgblack@eecs.umich.edu MISCREG_TPIDRURW, 937266Sgblack@eecs.umich.edu MISCREG_TPIDRURO, 947266Sgblack@eecs.umich.edu MISCREG_TPIDRPRW, 957268Sgblack@eecs.umich.edu MISCREG_CP15ISB, 967272Sgblack@eecs.umich.edu MISCREG_CP15DSB, 977272Sgblack@eecs.umich.edu MISCREG_CP15DMB, 987271Sgblack@eecs.umich.edu MISCREG_CPACR, 997273Sgblack@eecs.umich.edu MISCREG_CLIDR, 1007287Sgblack@eecs.umich.edu MISCREG_CCSIDR, 1017287Sgblack@eecs.umich.edu MISCREG_CSSELR, 1027274Sgblack@eecs.umich.edu MISCREG_ICIALLUIS, 1037275Sgblack@eecs.umich.edu MISCREG_ICIALLU, 1047276Sgblack@eecs.umich.edu MISCREG_ICIMVAU, 1057286Sgblack@eecs.umich.edu MISCREG_BPIMVA, 1067297Sgblack@eecs.umich.edu MISCREG_BPIALLIS, 1077297Sgblack@eecs.umich.edu MISCREG_BPIALL, 1087298Sgblack@eecs.umich.edu MISCREG_MIDR, 1097352Sgblack@eecs.umich.edu MISCREG_TTBR0, 1107352Sgblack@eecs.umich.edu MISCREG_TTBR1, 1117354Sgblack@eecs.umich.edu MISCREG_TLBTR, 1127353Sgblack@eecs.umich.edu MISCREG_DACR, 1137355Sgblack@eecs.umich.edu MISCREG_TLBIALLIS, 1147355Sgblack@eecs.umich.edu MISCREG_TLBIMVAIS, 1157355Sgblack@eecs.umich.edu MISCREG_TLBIASIDIS, 1167355Sgblack@eecs.umich.edu MISCREG_TLBIMVAAIS, 1177355Sgblack@eecs.umich.edu MISCREG_ITLBIALL, 1187355Sgblack@eecs.umich.edu MISCREG_ITLBIMVA, 1197355Sgblack@eecs.umich.edu MISCREG_ITLBIASID, 1207355Sgblack@eecs.umich.edu MISCREG_DTLBIALL, 1217355Sgblack@eecs.umich.edu MISCREG_DTLBIMVA, 1227355Sgblack@eecs.umich.edu MISCREG_DTLBIASID, 1237355Sgblack@eecs.umich.edu MISCREG_TLBIALL, 1247355Sgblack@eecs.umich.edu MISCREG_TLBIMVA, 1257355Sgblack@eecs.umich.edu MISCREG_TLBIASID, 1267355Sgblack@eecs.umich.edu MISCREG_TLBIMVAA, 1277362Sgblack@eecs.umich.edu MISCREG_DFSR, 1287362Sgblack@eecs.umich.edu MISCREG_IFSR, 1297362Sgblack@eecs.umich.edu MISCREG_DFAR, 1307362Sgblack@eecs.umich.edu MISCREG_IFAR, 1317259Sgblack@eecs.umich.edu MISCREG_CP15_UNIMP_START, 1327259Sgblack@eecs.umich.edu MISCREG_CTR = MISCREG_CP15_UNIMP_START, 1337259Sgblack@eecs.umich.edu MISCREG_TCMTR, 1347259Sgblack@eecs.umich.edu MISCREG_MPIDR, 1357259Sgblack@eecs.umich.edu MISCREG_ID_PFR0, 1367259Sgblack@eecs.umich.edu MISCREG_ID_PFR1, 1377259Sgblack@eecs.umich.edu MISCREG_ID_DFR0, 1387259Sgblack@eecs.umich.edu MISCREG_ID_AFR0, 1397259Sgblack@eecs.umich.edu MISCREG_ID_MMFR0, 1407259Sgblack@eecs.umich.edu MISCREG_ID_MMFR1, 1417259Sgblack@eecs.umich.edu MISCREG_ID_MMFR2, 1427259Sgblack@eecs.umich.edu MISCREG_ID_MMFR3, 1437259Sgblack@eecs.umich.edu MISCREG_ID_ISAR0, 1447259Sgblack@eecs.umich.edu MISCREG_ID_ISAR1, 1457259Sgblack@eecs.umich.edu MISCREG_ID_ISAR2, 1467259Sgblack@eecs.umich.edu MISCREG_ID_ISAR3, 1477259Sgblack@eecs.umich.edu MISCREG_ID_ISAR4, 1487259Sgblack@eecs.umich.edu MISCREG_ID_ISAR5, 1497351Sgblack@eecs.umich.edu MISCREG_PAR, 1507259Sgblack@eecs.umich.edu MISCREG_AIDR, 1517259Sgblack@eecs.umich.edu MISCREG_ACTLR, 1527259Sgblack@eecs.umich.edu MISCREG_ADFSR, 1537259Sgblack@eecs.umich.edu MISCREG_AIFSR, 1547259Sgblack@eecs.umich.edu MISCREG_DCIMVAC, 1557259Sgblack@eecs.umich.edu MISCREG_DCISW, 1567259Sgblack@eecs.umich.edu MISCREG_MCCSW, 1577259Sgblack@eecs.umich.edu MISCREG_DCCMVAU, 1587351Sgblack@eecs.umich.edu MISCREG_SCR, 1597351Sgblack@eecs.umich.edu MISCREG_SDER, 1607351Sgblack@eecs.umich.edu MISCREG_NSACR, 1617351Sgblack@eecs.umich.edu MISCREG_TTBCR, 1627351Sgblack@eecs.umich.edu MISCREG_V2PCWPR, 1637351Sgblack@eecs.umich.edu MISCREG_V2PCWPW, 1647351Sgblack@eecs.umich.edu MISCREG_V2PCWUR, 1657351Sgblack@eecs.umich.edu MISCREG_V2PCWUW, 1667351Sgblack@eecs.umich.edu MISCREG_V2POWPR, 1677351Sgblack@eecs.umich.edu MISCREG_V2POWPW, 1687351Sgblack@eecs.umich.edu MISCREG_V2POWUR, 1697351Sgblack@eecs.umich.edu MISCREG_V2POWUW, 1707351Sgblack@eecs.umich.edu MISCREG_PRRR, 1717351Sgblack@eecs.umich.edu MISCREG_NMRR, 1727351Sgblack@eecs.umich.edu MISCREG_VBAR, 1737351Sgblack@eecs.umich.edu MISCREG_MVBAR, 1747351Sgblack@eecs.umich.edu MISCREG_ISR, 1757351Sgblack@eecs.umich.edu MISCREG_FCEIDR, 1767351Sgblack@eecs.umich.edu 1777259Sgblack@eecs.umich.edu 1787259Sgblack@eecs.umich.edu MISCREG_CP15_END, 1797259Sgblack@eecs.umich.edu 1807259Sgblack@eecs.umich.edu // Dummy indices 1817259Sgblack@eecs.umich.edu MISCREG_NOP = MISCREG_CP15_END, 1827259Sgblack@eecs.umich.edu MISCREG_RAZ, 1837259Sgblack@eecs.umich.edu 1846735Sgblack@eecs.umich.edu NUM_MISCREGS 1856261Sgblack@eecs.umich.edu }; 1866261Sgblack@eecs.umich.edu 1877259Sgblack@eecs.umich.edu MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1, 1887259Sgblack@eecs.umich.edu unsigned crm, unsigned opc2); 1897259Sgblack@eecs.umich.edu 1906261Sgblack@eecs.umich.edu const char * const miscRegName[NUM_MISCREGS] = { 1917259Sgblack@eecs.umich.edu "cpsr", "spsr", "spsr_fiq", "spsr_irq", "spsr_svc", 1927259Sgblack@eecs.umich.edu "spsr_mon", "spsr_und", "spsr_abt", 1937351Sgblack@eecs.umich.edu "fpsr", "fpsid", "fpscr", "fpexc", "mvfr0", "mvfr1", 1947351Sgblack@eecs.umich.edu "sev_mailbox", 1957285Sgblack@eecs.umich.edu "sctlr", "dccisw", "dccimvac", "dccmvac", 1967267Sgblack@eecs.umich.edu "contextidr", "tpidrurw", "tpidruro", "tpidrprw", 1977287Sgblack@eecs.umich.edu "cp15isb", "cp15dsb", "cp15dmb", "cpacr", 1987287Sgblack@eecs.umich.edu "clidr", "ccsidr", "csselr", 1997297Sgblack@eecs.umich.edu "icialluis", "iciallu", "icimvau", 2007297Sgblack@eecs.umich.edu "bpimva", "bpiallis", "bpiall", 2017355Sgblack@eecs.umich.edu "midr", "ttbr0", "ttbr1", "tlbtr", "dacr", 2027355Sgblack@eecs.umich.edu "tlbiallis", "tlbimvais", "tlbiasidis", "tlbimvaais", 2037355Sgblack@eecs.umich.edu "itlbiall", "itlbimva", "itlbiasid", 2047355Sgblack@eecs.umich.edu "dtlbiall", "dtlbimva", "dtlbiasid", 2057355Sgblack@eecs.umich.edu "tlbiall", "tlbimva", "tlbiasid", "tlbimvaa", 2067362Sgblack@eecs.umich.edu "dfsr", "ifsr", "dfar", "ifar", 2077355Sgblack@eecs.umich.edu "ctr", "tcmtr", "mpidr", 2087259Sgblack@eecs.umich.edu "id_pfr0", "id_pfr1", "id_dfr0", "id_afr0", 2097259Sgblack@eecs.umich.edu "id_mmfr0", "id_mmfr1", "id_mmfr2", "id_mmfr3", 2107259Sgblack@eecs.umich.edu "id_isar0", "id_isar1", "id_isar2", "id_isar3", "id_isar4", "id_isar5", 2117353Sgblack@eecs.umich.edu "par", "aidr", "actlr", 2127362Sgblack@eecs.umich.edu "adfsr", "aifsr", 2137297Sgblack@eecs.umich.edu "dcimvac", "dcisw", "mccsw", 2147272Sgblack@eecs.umich.edu "dccmvau", 2157352Sgblack@eecs.umich.edu "scr", "sder", "nsacr", "ttbcr", 2167351Sgblack@eecs.umich.edu "v2pcwpr", "v2pcwpw", "v2pcwur", "v2pcwuw", 2177351Sgblack@eecs.umich.edu "v2powpr", "v2powpw", "v2powur", "v2powuw", 2187351Sgblack@eecs.umich.edu "prrr", "nmrr", "vbar", "mvbar", "isr", "fceidr", 2197259Sgblack@eecs.umich.edu "nop", "raz" 2206242Sgblack@eecs.umich.edu }; 2216242Sgblack@eecs.umich.edu 2226242Sgblack@eecs.umich.edu BitUnion32(CPSR) 2236242Sgblack@eecs.umich.edu Bitfield<31> n; 2246242Sgblack@eecs.umich.edu Bitfield<30> z; 2256242Sgblack@eecs.umich.edu Bitfield<29> c; 2266242Sgblack@eecs.umich.edu Bitfield<28> v; 2276242Sgblack@eecs.umich.edu Bitfield<27> q; 2286735Sgblack@eecs.umich.edu Bitfield<26,25> it1; 2296242Sgblack@eecs.umich.edu Bitfield<24> j; 2306242Sgblack@eecs.umich.edu Bitfield<19, 16> ge; 2316735Sgblack@eecs.umich.edu Bitfield<15,10> it2; 2326242Sgblack@eecs.umich.edu Bitfield<9> e; 2336242Sgblack@eecs.umich.edu Bitfield<8> a; 2346242Sgblack@eecs.umich.edu Bitfield<7> i; 2356242Sgblack@eecs.umich.edu Bitfield<6> f; 2366242Sgblack@eecs.umich.edu Bitfield<5> t; 2376242Sgblack@eecs.umich.edu Bitfield<4, 0> mode; 2386242Sgblack@eecs.umich.edu EndBitUnion(CPSR) 2396735Sgblack@eecs.umich.edu 2406750Sgblack@eecs.umich.edu // This mask selects bits of the CPSR that actually go in the CondCodes 2416750Sgblack@eecs.umich.edu // integer register to allow renaming. 2426750Sgblack@eecs.umich.edu static const uint32_t CondCodesMask = 0xF80F0000; 2436750Sgblack@eecs.umich.edu 2446735Sgblack@eecs.umich.edu BitUnion32(SCTLR) 2457360Sgblack@eecs.umich.edu Bitfield<31> ie; // Instruction endianness 2466735Sgblack@eecs.umich.edu Bitfield<30> te; // Thumb Exception Enable 2476735Sgblack@eecs.umich.edu Bitfield<29> afe; // Access flag enable 2486735Sgblack@eecs.umich.edu Bitfield<28> tre; // TEX Remap bit 2496735Sgblack@eecs.umich.edu Bitfield<27> nmfi;// Non-maskable fast interrupts enable 2506735Sgblack@eecs.umich.edu Bitfield<25> ee; // Exception Endianness bit 2516735Sgblack@eecs.umich.edu Bitfield<24> ve; // Interrupt vectors enable 2526735Sgblack@eecs.umich.edu Bitfield<23> rao1;// Read as one 2536735Sgblack@eecs.umich.edu Bitfield<22> u; // Alignment (now unused) 2546735Sgblack@eecs.umich.edu Bitfield<21> fi; // Fast interrupts configuration enable 2557360Sgblack@eecs.umich.edu Bitfield<19> dz; // Divide by Zero fault enable bit 2566735Sgblack@eecs.umich.edu Bitfield<18> rao2;// Read as one 2577360Sgblack@eecs.umich.edu Bitfield<17> br; // Background region bit 2586735Sgblack@eecs.umich.edu Bitfield<16> rao3;// Read as one 2596735Sgblack@eecs.umich.edu Bitfield<14> rr; // Round robin cache replacement 2606735Sgblack@eecs.umich.edu Bitfield<13> v; // Base address for exception vectors 2616735Sgblack@eecs.umich.edu Bitfield<12> i; // instruction cache enable 2626735Sgblack@eecs.umich.edu Bitfield<11> z; // branch prediction enable bit 2636735Sgblack@eecs.umich.edu Bitfield<10> sw; // Enable swp/swpb 2646735Sgblack@eecs.umich.edu Bitfield<6,3> rao4;// Read as one 2656735Sgblack@eecs.umich.edu Bitfield<7> b; // Endianness support (unused) 2666735Sgblack@eecs.umich.edu Bitfield<2> c; // Cache enable bit 2676735Sgblack@eecs.umich.edu Bitfield<1> a; // Alignment fault checking 2686735Sgblack@eecs.umich.edu Bitfield<0> m; // MMU enable bit 2696735Sgblack@eecs.umich.edu EndBitUnion(SCTLR) 2707320Sgblack@eecs.umich.edu 2717320Sgblack@eecs.umich.edu BitUnion32(CPACR) 2727320Sgblack@eecs.umich.edu Bitfield<1, 0> cp0; 2737320Sgblack@eecs.umich.edu Bitfield<3, 2> cp1; 2747320Sgblack@eecs.umich.edu Bitfield<5, 4> cp2; 2757320Sgblack@eecs.umich.edu Bitfield<7, 6> cp3; 2767320Sgblack@eecs.umich.edu Bitfield<9, 8> cp4; 2777320Sgblack@eecs.umich.edu Bitfield<11, 10> cp5; 2787320Sgblack@eecs.umich.edu Bitfield<13, 12> cp6; 2797320Sgblack@eecs.umich.edu Bitfield<15, 14> cp7; 2807320Sgblack@eecs.umich.edu Bitfield<17, 16> cp8; 2817320Sgblack@eecs.umich.edu Bitfield<19, 18> cp9; 2827320Sgblack@eecs.umich.edu Bitfield<21, 20> cp10; 2837320Sgblack@eecs.umich.edu Bitfield<23, 22> cp11; 2847320Sgblack@eecs.umich.edu Bitfield<25, 24> cp12; 2857320Sgblack@eecs.umich.edu Bitfield<27, 26> cp13; 2867320Sgblack@eecs.umich.edu Bitfield<30> d32dis; 2877320Sgblack@eecs.umich.edu Bitfield<31> asedis; 2887320Sgblack@eecs.umich.edu EndBitUnion(CPACR) 2897362Sgblack@eecs.umich.edu 2907362Sgblack@eecs.umich.edu BitUnion32(FSR) 2917362Sgblack@eecs.umich.edu Bitfield<3, 0> fsLow; 2927362Sgblack@eecs.umich.edu Bitfield<7, 4> domain; 2937362Sgblack@eecs.umich.edu Bitfield<10> fsHigh; 2947362Sgblack@eecs.umich.edu Bitfield<11> wnr; 2957362Sgblack@eecs.umich.edu Bitfield<12> ext; 2967362Sgblack@eecs.umich.edu EndBitUnion(FSR) 2976242Sgblack@eecs.umich.edu}; 2986242Sgblack@eecs.umich.edu 2996242Sgblack@eecs.umich.edu#endif // __ARCH_ARM_MISCREGS_HH__ 300