aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-03-22 20:07:50 +0000
committerPeter Maydell <peter.maydell@linaro.org>2012-03-23 13:44:18 +0000
commitdc2d1c34fb295d66e66c6b6523e3c5ecba877f0a (patch)
treee92046898fa8cd818d169ca6c4f87fc364b94fb1
parenta530186ebc45903b10c9465368f1f7dda8e243af (diff)
downloadqemu-arm-cp15-on-qom.2.tar.gz
target-arm: TODO markerscp15-on-qom.2
Add some TODO comments as a sketch of where things are going to need to change...
-rw-r--r--target-arm/cpu.c24
-rw-r--r--target-arm/helper.c8
2 files changed, 32 insertions, 0 deletions
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index c1c814e21b..c68dde05e4 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -67,6 +67,15 @@ static void arm_cpu_reset(CPUState *c)
klass->parent_reset(c);
+ /* TODO: where we are doing things for cp15 reset here we should
+ * make sure it is handled via the cp infrastructure instead,
+ * and get rid of the code here.
+ * TODO: we should be able to get rid of these copy-values-across-memset
+ * hacks, either because the reset is handled in the cp15 infrastructure
+ * or (for env->features) by moving the field in CPUARMState to the back
+ * where it won't be trashed.
+ */
+
id = env->cp15.c0_cpuid;
tmp = env->cp15.c15_config_base_address;
memset(env, 0, offsetof(CPUARMState, breakpoints));
@@ -199,6 +208,21 @@ static void arm_cpu_postconfig_init(ARMCPU *cpu)
/* CPU models */
+/* TODO:
+ * these functions should set up the reset values for more registers,
+ * particularly the c0 ID registers which we have not yet converted.
+ * We should set here fields in ARMCPU. Then in register_cp_regs_for_features()
+ * we should define cp15 regs with the 'resetvalue' field set from those
+ * ARMCPU fields. That makes the env->cp15 fields redundant.
+ * TODO:
+ * c1_sys (aka the SCTLR) should have its reset value set up like this too.
+ * TODO:
+ * maybe we should handle the AUXCR that way too?
+ * TODO: FPSID, MVFR0, MVFR1 aren't cp15 registers but we should put their
+ * reset values in ARMCPU too, and reset from those in arm_cpu_reset.
+ *
+ * When all the above have been dealt with we can get rid of cpu_model_id_reset.
+ */
static void arm926_initfn(Object *obj)
{
ARMCPU *cpu = ARM_CPU(obj);
diff --git a/target-arm/helper.c b/target-arm/helper.c
index a7ce44a690..b6867b3366 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1160,6 +1160,14 @@ void register_cp_regs_for_features(ARMCPU *cpu)
}
/* Some cp15 registers are truly implementation specific */
+ /* TODO: instead of this we should be doing this in the
+ * implementation specific initfns in cpu.c.
+ * ISSUES: (a) can we just move the structs across or do
+ * any of them rely on functions declared static in this file?
+ * (b) check for overlaps with generic register defs, do we
+ * need to register them after the per-feature regs above or
+ * can we get away with doing the imp-def ones first?
+ */
switch (ARM_CPUID(env)) {
case ARM_CPUID_ARM1026:
define_arm_cp_regs(env, arm1026_cp_reginfo);