2 * Copyright (c) 2010-2012 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"
46 #include "base/compiler.hh"
82 MISCREG_FPSCR_QC, // Cumulative saturation flag
83 MISCREG_FPSCR_EXC, // Cumulative FP exception flags
92 MISCREG_DBGDIDR = MISCREG_CP14_START,
101 MISCREG_DBGDTRRX_EXT,
103 MISCREG_DBGDTRTX_EXT,
120 MISCREG_DBGAUTHSTATUS,
127 MISCREG_SCTLR = MISCREG_CP15_START,
217 MISCREG_CP15_UNIMP_START,
218 MISCREG_TCMTR = MISCREG_CP15_UNIMP_START,
241 MISCREG_NOP = MISCREG_CP15_END,
247 MiscRegIndex decodeCP14Reg(unsigned crn, unsigned opc1,
248 unsigned crm, unsigned opc2);
250 MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1,
251 unsigned crm, unsigned opc2);
254 const char * const miscRegName[] = {
255 "cpsr", "cpsr_q", "spsr", "spsr_fiq", "spsr_irq", "spsr_svc",
256 "spsr_mon", "spsr_und", "spsr_abt",
257 "fpsr", "fpsid", "fpscr", "fpscr_qc", "fpscr_exc", "fpexc",
259 "sctlr_rst", "sev_mailbox",
292 "sctlr", "dccisw", "dccimvac", "dccmvac",
293 "contextidr", "tpidrurw", "tpidruro", "tpidrprw",
294 "cp15isb", "cp15dsb", "cp15dmb", "cpacr",
295 "clidr", "ccsidr", "csselr",
296 "icialluis", "iciallu", "icimvau",
297 "bpimva", "bpiallis", "bpiall",
298 "midr", "ttbr0", "ttbr1", "tlbtr", "dacr",
299 "tlbiallis", "tlbimvais", "tlbiasidis", "tlbimvaais",
300 "itlbiall", "itlbimva", "itlbiasid",
301 "dtlbiall", "dtlbimva", "dtlbiasid",
302 "tlbiall", "tlbimva", "tlbiasid", "tlbimvaa",
303 "dfsr", "ifsr", "dfar", "ifar", "mpidr",
304 "prrr", "nmrr", "ttbcr", "id_pfr0", "ctr",
305 "scr", "sder", "par",
306 "v2pcwpr", "v2pcwpw", "v2pcwur", "v2pcwuw",
307 "v2powpr", "v2powpw", "v2powur", "v2powuw",
308 "id_mmfr0", "id_mmfr2", "id_mmfr3", "actlr", "pmcr", "pmccntr",
309 "pmcntenset", "pmcntenclr", "pmovsr",
310 "pmswinc", "pmselr", "pmceid0",
311 "pmceid1", "pmc_other", "pmxevcntr",
312 "pmuserenr", "pmintenset", "pmintenclr",
313 "id_isar0", "id_isar1", "id_isar2", "id_isar3", "id_isar4", "id_isar5",
314 "cpsr_mode", "lockflag", "lockaddr", "id_pfr1",
316 // Unimplemented below
318 "id_dfr0", "id_afr0",
320 "aidr", "adfsr", "aifsr",
321 "dcimvac", "dcisw", "mccsw",
324 "vbar", "mvbar", "isr", "fceidr", "l2latency",
329 static_assert(sizeof(miscRegName) / sizeof(*miscRegName) == NUM_MISCREGS,
330 "The miscRegName array and NUM_MISCREGS are inconsistent.");
349 // This mask selects bits of the CPSR that actually go in the CondCodes
350 // integer register to allow renaming.
351 static const uint32_t CondCodesMask = 0xF00F0000;
352 static const uint32_t CpsrMaskQ = 0x08000000;
355 Bitfield<31> ie; // Instruction endianness
356 Bitfield<30> te; // Thumb Exception Enable
357 Bitfield<29> afe; // Access flag enable
358 Bitfield<28> tre; // TEX Remap bit
359 Bitfield<27> nmfi;// Non-maskable fast interrupts enable
360 Bitfield<25> ee; // Exception Endianness bit
361 Bitfield<24> ve; // Interrupt vectors enable
362 Bitfield<23> xp; // Extended page table enable bit
363 Bitfield<22> u; // Alignment (now unused)
364 Bitfield<21> fi; // Fast interrupts configuration enable
365 Bitfield<19> dz; // Divide by Zero fault enable bit
366 Bitfield<18> rao2;// Read as one
367 Bitfield<17> br; // Background region bit
368 Bitfield<16> rao3;// Read as one
369 Bitfield<14> rr; // Round robin cache replacement
370 Bitfield<13> v; // Base address for exception vectors
371 Bitfield<12> i; // instruction cache enable
372 Bitfield<11> z; // branch prediction enable bit
373 Bitfield<10> sw; // Enable swp/swpb
374 Bitfield<9,8> rs; // deprecated protection bits
375 Bitfield<6,3> rao4;// Read as one
376 Bitfield<7> b; // Endianness support (unused)
377 Bitfield<2> c; // Cache enable bit
378 Bitfield<1> a; // Alignment fault checking
379 Bitfield<0> m; // MMU enable bit
388 Bitfield<11, 10> cp5;
389 Bitfield<13, 12> cp6;
390 Bitfield<15, 14> cp7;
391 Bitfield<17, 16> cp8;
392 Bitfield<19, 18> cp9;
393 Bitfield<21, 20> cp10;
394 Bitfield<23, 22> cp11;
395 Bitfield<25, 24> cp12;
396 Bitfield<27, 26> cp13;
397 Bitfield<29, 28> rsvd;
403 Bitfield<3, 0> fsLow;
404 Bitfield<7, 4> domain;
423 Bitfield<18, 16> len;
424 Bitfield<21, 20> stride;
425 Bitfield<23, 22> rMode;
436 // This mask selects bits of the FPSCR that actually go in the FpCondCodes
437 // integer register to allow renaming.
438 static const uint32_t FpCondCodesMask = 0xF0000000;
439 // This mask selects the cumulative FP exception flags of the FPSCR.
440 static const uint32_t FpscrExcMask = 0x0000009F;
441 // This mask selects the cumulative saturation flag of the FPSCR.
442 static const uint32_t FpscrQcMask = 0x08000000;
447 Bitfield<29, 0> subArchDefined;
451 Bitfield<3, 0> advSimdRegisters;
452 Bitfield<7, 4> singlePrecision;
453 Bitfield<11, 8> doublePrecision;
454 Bitfield<15, 12> vfpExceptionTrapping;
455 Bitfield<19, 16> divide;
456 Bitfield<23, 20> squareRoot;
457 Bitfield<27, 24> shortVectors;
458 Bitfield<31, 28> roundingModes;
462 Bitfield<3, 0> flushToZero;
463 Bitfield<7, 4> defaultNaN;
464 Bitfield<11, 8> advSimdLoadStore;
465 Bitfield<15, 12> advSimdInteger;
466 Bitfield<19, 16> advSimdSinglePrecision;
467 Bitfield<23, 20> advSimdHalfPrecision;
468 Bitfield<27, 24> vfpHalfPrecision;
469 Bitfield<31, 28> raz;
514 BitUnion32(CONTEXTIDR)
516 Bitfield<31,8> procid;
517 EndBitUnion(CONTEXTIDR)
520 Bitfield<2,0> sataRAMLatency;
521 Bitfield<4,3> reserved_4_3;
522 Bitfield<5> dataRAMSetup;
523 Bitfield<8,6> tagRAMLatency;
524 Bitfield<9> tagRAMSetup;
525 Bitfield<11,10> dataRAMSlice;
526 Bitfield<12> tagRAMSlice;
527 Bitfield<20,13> reserved_20_13;
528 Bitfield<21> eccandParityEnable;
529 Bitfield<22> reserved_22;
530 Bitfield<23> interptCtrlPresent;
531 Bitfield<25,24> numCPUs;
532 Bitfield<30,26> reserved_30_26;
533 Bitfield<31> l2rstDISABLE_monitor;
537 Bitfield<3,0> iCacheLineSize;
538 Bitfield<13,4> raz_13_4;
539 Bitfield<15,14> l1IndexPolicy;
540 Bitfield<19,16> dCacheLineSize;
544 Bitfield<31,29> format;
548 #endif // __ARCH_ARM_MISCREGS_HH__