target-arm: Implement AArch64 view of CPACR
authorPeter Maydell <peter.maydell@linaro.org>
Wed, 26 Feb 2014 17:20:06 +0000 (17:20 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Wed, 26 Feb 2014 17:20:06 +0000 (17:20 +0000)
Implement the AArch64 view of the CPACR. The AArch64
CPACR is defined to have a lot of RES0 bits, but since
the architecture defines that RES0 bits may be implemented
as reads-as-written and we know that a v8 CPU will have
no registered coprocessors for cp0..cp13 we can safely
implement the whole register this way.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
target-arm/cpu.h
target-arm/helper.c

index 67e935df425a71794a023cedd9b4cf0c062562c2..328c256c3efbe7d0242769756c97cdc879a2edfb 100644 (file)
@@ -172,7 +172,7 @@ typedef struct CPUARMState {
         uint32_t c0_cpuid;
         uint64_t c0_cssel; /* Cache size selection.  */
         uint64_t c1_sys; /* System control register.  */
-        uint32_t c1_coproc; /* Coprocessor access register.  */
+        uint64_t c1_coproc; /* Coprocessor access register.  */
         uint32_t c1_xscaleauxcr; /* XScale auxiliary control register.  */
         uint32_t c1_scr; /* secure config register.  */
         uint64_t ttbr0_el1; /* MMU translation table base 0. */
index 01d1ef6679d17b8d6bd9d82d805aded901585ee6..56219527cadcb01b66e5138ed7463ef8a9000aae 100644 (file)
@@ -458,7 +458,8 @@ static const ARMCPRegInfo v6_cp_reginfo[] = {
      */
     { .name = "WFAR", .cp = 15, .crn = 6, .crm = 0, .opc1 = 0, .opc2 = 1,
       .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0, },
-    { .name = "CPACR", .cp = 15, .crn = 1, .crm = 0, .opc1 = 0, .opc2 = 2,
+    { .name = "CPACR", .state = ARM_CP_STATE_BOTH, .opc0 = 3,
+      .crn = 1, .crm = 0, .opc1 = 0, .opc2 = 2,
       .access = PL1_RW, .fieldoffset = offsetof(CPUARMState, cp15.c1_coproc),
       .resetvalue = 0, .writefn = cpacr_write },
     REGINFO_SENTINEL