All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
	Paul Brook <paul@codesourcery.com>
Subject: [Qemu-devel] [PATCH 26/33] target-arm: Convert cp15 crn=0 crm={1, 2} feature registers
Date: Wed, 20 Jun 2012 13:27:14 +0100	[thread overview]
Message-ID: <1340195241-16620-27-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1340195241-16620-1-git-send-email-peter.maydell@linaro.org>

Convert the cp15 crn=0 crm={1,2} features registers to
the new cp reg framework.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/cpu.c    |   14 -----------
 target-arm/cpu.h    |    2 -
 target-arm/helper.c |   62 ++++++++++++++++++++++++++++++++++++++++++++------
 3 files changed, 54 insertions(+), 24 deletions(-)

diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index d84db53..f9b3046 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -77,20 +77,6 @@ static void arm_cpu_reset(CPUState *s)
     env->vfp.xregs[ARM_VFP_MVFR0] = cpu->mvfr0;
     env->vfp.xregs[ARM_VFP_MVFR1] = cpu->mvfr1;
     env->cp15.c0_cachetype = cpu->ctr;
-    env->cp15.c0_c1[0] = cpu->id_pfr0;
-    env->cp15.c0_c1[1] = cpu->id_pfr1;
-    env->cp15.c0_c1[2] = cpu->id_dfr0;
-    env->cp15.c0_c1[3] = cpu->id_afr0;
-    env->cp15.c0_c1[4] = cpu->id_mmfr0;
-    env->cp15.c0_c1[5] = cpu->id_mmfr1;
-    env->cp15.c0_c1[6] = cpu->id_mmfr2;
-    env->cp15.c0_c1[7] = cpu->id_mmfr3;
-    env->cp15.c0_c2[0] = cpu->id_isar0;
-    env->cp15.c0_c2[1] = cpu->id_isar1;
-    env->cp15.c0_c2[2] = cpu->id_isar2;
-    env->cp15.c0_c2[3] = cpu->id_isar3;
-    env->cp15.c0_c2[4] = cpu->id_isar4;
-    env->cp15.c0_c2[5] = cpu->id_isar5;
     env->cp15.c0_clid = cpu->clidr;
     memcpy(env->cp15.c0_ccsid, cpu->ccsidr, ARRAY_SIZE(cpu->ccsidr));
 
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 02d86ca..0953543 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -111,8 +111,6 @@ typedef struct CPUARMState {
         uint32_t c0_ccsid[16]; /* Cache size.  */
         uint32_t c0_clid; /* Cache level.  */
         uint32_t c0_cssel; /* Cache size selection.  */
-        uint32_t c0_c1[8]; /* Feature registers.  */
-        uint32_t c0_c2[8]; /* Instruction set registers.  */
         uint32_t c1_sys; /* System control register.  */
         uint32_t c1_coproc; /* Coprocessor access register.  */
         uint32_t c1_xscaleauxcr; /* XScale auxiliary control register.  */
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 00934cd..11b2ad9 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -825,6 +825,60 @@ void register_cp_regs_for_features(ARMCPU *cpu)
 
     define_arm_cp_regs(cpu, cp_reginfo);
     if (arm_feature(env, ARM_FEATURE_V6)) {
+        /* The ID registers all have impdef reset values */
+        ARMCPRegInfo v6_idregs[] = {
+            { .name = "ID_PFR0", .cp = 15, .crn = 0, .crm = 1,
+              .opc1 = 0, .opc2 = 0, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_pfr0 },
+            { .name = "ID_PFR1", .cp = 15, .crn = 0, .crm = 1,
+              .opc1 = 0, .opc2 = 1, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_pfr1 },
+            { .name = "ID_DFR0", .cp = 15, .crn = 0, .crm = 1,
+              .opc1 = 0, .opc2 = 2, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_dfr0 },
+            { .name = "ID_AFR0", .cp = 15, .crn = 0, .crm = 1,
+              .opc1 = 0, .opc2 = 3, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_afr0 },
+            { .name = "ID_MMFR0", .cp = 15, .crn = 0, .crm = 1,
+              .opc1 = 0, .opc2 = 4, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_mmfr0 },
+            { .name = "ID_MMFR1", .cp = 15, .crn = 0, .crm = 1,
+              .opc1 = 0, .opc2 = 5, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_mmfr1 },
+            { .name = "ID_MMFR2", .cp = 15, .crn = 0, .crm = 1,
+              .opc1 = 0, .opc2 = 6, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_mmfr2 },
+            { .name = "ID_MMFR3", .cp = 15, .crn = 0, .crm = 1,
+              .opc1 = 0, .opc2 = 7, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_mmfr3 },
+            { .name = "ID_ISAR0", .cp = 15, .crn = 0, .crm = 2,
+              .opc1 = 0, .opc2 = 0, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_isar0 },
+            { .name = "ID_ISAR1", .cp = 15, .crn = 0, .crm = 2,
+              .opc1 = 0, .opc2 = 1, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_isar1 },
+            { .name = "ID_ISAR2", .cp = 15, .crn = 0, .crm = 2,
+              .opc1 = 0, .opc2 = 2, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_isar2 },
+            { .name = "ID_ISAR3", .cp = 15, .crn = 0, .crm = 2,
+              .opc1 = 0, .opc2 = 3, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_isar3 },
+            { .name = "ID_ISAR4", .cp = 15, .crn = 0, .crm = 2,
+              .opc1 = 0, .opc2 = 4, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_isar4 },
+            { .name = "ID_ISAR5", .cp = 15, .crn = 0, .crm = 2,
+              .opc1 = 0, .opc2 = 5, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_isar5 },
+            /* 6..7 are as yet unallocated and must RAZ */
+            { .name = "ID_ISAR6", .cp = 15, .crn = 0, .crm = 2,
+              .opc1 = 0, .opc2 = 6, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_ISAR7", .cp = 15, .crn = 0, .crm = 2,
+              .opc1 = 0, .opc2 = 7, .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            REGINFO_SENTINEL
+        };
+        define_arm_cp_regs(cpu, v6_idregs);
         define_arm_cp_regs(cpu, v6_cp_reginfo);
     } else {
         define_arm_cp_regs(cpu, not_v6_cp_reginfo);
@@ -2064,14 +2118,6 @@ uint32_t HELPER(get_cp15)(CPUARMState *env, uint32_t insn)
                 default:
                     goto bad_reg;
                 }
-            case 1:
-                if (!arm_feature(env, ARM_FEATURE_V6))
-                    goto bad_reg;
-                return env->cp15.c0_c1[op2];
-            case 2:
-                if (!arm_feature(env, ARM_FEATURE_V6))
-                    goto bad_reg;
-                return env->cp15.c0_c2[op2];
             case 3: case 4: case 5: case 6: case 7:
                 return 0;
             default:
-- 
1.7.1

  parent reply	other threads:[~2012-06-20 12:57 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20 12:26 [Qemu-devel] [PULL 00/33] target-arm queue Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 01/33] target-arm: Fix 11MPCore cache type register value Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 02/33] target-arm: initial coprocessor register framework Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 03/33] hw/pxa2xx: Convert cp14 perf registers to new scheme Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 04/33] hw/pxa2xx.c: Convert CLKCFG and PWRMODE cp14 regs Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 05/33] hw/pxa2xx_pic: Convert coprocessor registers to new scheme Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 06/33] target-arm: Remove old cpu_arm_set_cp_io infrastructure Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 07/33] target-arm: Add register_cp_regs_for_features() Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 08/33] target-arm: Convert debug registers to cp_reginfo Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 09/33] target-arm: Convert TEECR, TEEHBR to new scheme Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 10/33] target-arm: Convert WFI/barriers special cases to cp_reginfo Peter Maydell
2012-06-20 12:26 ` [Qemu-devel] [PATCH 11/33] target-arm: Convert TLS registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 12/33] target-arm: Convert performance monitor registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 13/33] target-arm: Convert generic timer cp15 regs Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 14/33] target-arm: Convert cp15 c3 register Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 15/33] target-arm: Convert MMU fault status cp15 registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 16/33] target-arm: Convert cp15 crn=2 registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 17/33] target-arm: Convert cp15 crn=13 registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 18/33] target-arm: Convert cp15 crn=10 registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 19/33] target-arm: Convert cp15 crn=15 registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 20/33] target-arm: Convert cp15 MMU TLB control Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 21/33] target-arm: Convert cp15 VA-PA translation registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 22/33] target-arm: convert cp15 crn=7 registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 23/33] target-arm: Convert cp15 crn=6 registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 24/33] target-arm: Convert cp15 crn=9 registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 25/33] target-arm: Convert cp15 crn=1 registers Peter Maydell
2012-06-20 12:27 ` Peter Maydell [this message]
2012-06-20 12:27 ` [Qemu-devel] [PATCH 27/33] target-arm: Convert cp15 cache ID registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 28/33] target-arm: Convert MPIDR Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 29/33] target-arm: Convert final ID registers Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 30/33] target-arm: Remove c0_cachetype CPUARMState field Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 31/33] target-arm: Move block cache ops to new cp15 framework Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 32/33] target-arm: Remove remaining old cp15 infrastructure Peter Maydell
2012-06-20 12:27 ` [Qemu-devel] [PATCH 33/33] target-arm: Remove ARM_CPUID_* macros Peter Maydell
2012-06-24 12:27 ` [Qemu-devel] [PULL 00/33] target-arm queue Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340195241-16620-27-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.