diff options
-rw-r--r-- | target-arm/cpu.c | 22 | ||||
-rw-r--r-- | target-arm/helper.c | 8 |
2 files changed, 30 insertions, 0 deletions
diff --git a/target-arm/cpu.c b/target-arm/cpu.c index e788fd7e0b..ed78fe4c78 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -67,6 +67,13 @@ 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 by having the reset be handled in the cp15 infrastructure + */ + id = env->cp15.c0_cpuid; tmp = env->cp15.c15_config_base_address; memset(env, 0, offsetof(CPUARMState, breakpoints)); @@ -203,6 +210,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 fc6412ece4..a97bd8e4b5 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1153,6 +1153,14 @@ void register_cp_regs_for_features(ARMCPU *cpu) define_arm_cp_regs(env, sctlr_cp_reginfo); /* 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); |