2 * Copyright (c) 2010 ARM Limited
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
14 * Copyright (c) 2009 The Regents of The University of Michigan
15 * All rights reserved.
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution;
24 * neither the name of the copyright holders nor the names of its
25 * contributors may be used to endorse or promote products derived from
26 * this software without specific prior written permission.
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 #ifndef __ARCH_ARM_MISCREGS_HH__
43 #define __ARCH_ARM_MISCREGS_HH__
45 #include "base/bitunion.hh"
84 MISCREG_SCTLR = MISCREG_CP15_START,
105 MISCREG_CP15_UNIMP_START,
106 MISCREG_CTR = MISCREG_CP15_UNIMP_START,
148 MISCREG_NOP = MISCREG_CP15_END,
154 MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1,
155 unsigned crm, unsigned opc2);
157 const char * const miscRegName[NUM_MISCREGS] = {
158 "cpsr", "spsr", "spsr_fiq", "spsr_irq", "spsr_svc",
159 "spsr_mon", "spsr_und", "spsr_abt",
160 "fpsr", "fpsid", "fpscr", "fpexc",
161 "sctlr", "dccisw", "dccimvac", "dccmvac",
162 "contextidr", "tpidrurw", "tpidruro", "tpidrprw",
163 "cp15isb", "cp15dsb", "cp15dmb", "cpacr",
164 "clidr", "ccsidr", "csselr",
165 "icialluis", "iciallu", "icimvau",
166 "bpimva", "bpiallis", "bpiall",
167 "ctr", "tcmtr", "mpuir", "mpidr", "midr",
168 "id_pfr0", "id_pfr1", "id_dfr0", "id_afr0",
169 "id_mmfr0", "id_mmfr1", "id_mmfr2", "id_mmfr3",
170 "id_isar0", "id_isar1", "id_isar2", "id_isar3", "id_isar4", "id_isar5",
172 "dfsr", "ifsr", "adfsr", "aifsr", "dfar", "ifar",
173 "drbar", "irbar", "drsr", "irsr", "dracr", "iracr",
175 "dcimvac", "dcisw", "mccsw",
198 // This mask selects bits of the CPSR that actually go in the CondCodes
199 // integer register to allow renaming.
200 static const uint32_t CondCodesMask = 0xF80F0000;
202 // These otherwise unused bits of the PC are used to select a mode
203 // like the J and T bits of the CPSR.
204 static const Addr PcJBitShift = 33;
205 static const Addr PcTBitShift = 34;
206 static const Addr PcModeMask = (ULL(1) << PcJBitShift) |
207 (ULL(1) << PcTBitShift);
210 Bitfield<30> te; // Thumb Exception Enable
211 Bitfield<29> afe; // Access flag enable
212 Bitfield<28> tre; // TEX Remap bit
213 Bitfield<27> nmfi;// Non-maskable fast interrupts enable
214 Bitfield<25> ee; // Exception Endianness bit
215 Bitfield<24> ve; // Interrupt vectors enable
216 Bitfield<23> rao1;// Read as one
217 Bitfield<22> u; // Alignment (now unused)
218 Bitfield<21> fi; // Fast interrupts configuration enable
219 Bitfield<18> rao2;// Read as one
220 Bitfield<17> ha; // Hardware access flag enable
221 Bitfield<16> rao3;// Read as one
222 Bitfield<14> rr; // Round robin cache replacement
223 Bitfield<13> v; // Base address for exception vectors
224 Bitfield<12> i; // instruction cache enable
225 Bitfield<11> z; // branch prediction enable bit
226 Bitfield<10> sw; // Enable swp/swpb
227 Bitfield<6,3> rao4;// Read as one
228 Bitfield<7> b; // Endianness support (unused)
229 Bitfield<2> c; // Cache enable bit
230 Bitfield<1> a; // Alignment fault checking
231 Bitfield<0> m; // MMU enable bit
235 #endif // __ARCH_ARM_MISCREGS_HH__