From dec9c2d4306d7b4f8ffff482ac42dc468ed2a61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 29 Mar 2012 04:50:31 +0000 Subject: target-arm: Minimalistic CPU QOM'ification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce only one non-abstract type TYPE_ARM_CPU and do not touch cp15 registers to not interfere with Peter's ongoing remodelling. Embed CPUARMState as first (additional) field of ARMCPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber Signed-off-by: Peter Maydell --- target-arm/helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'target-arm/helper.c') diff --git a/target-arm/helper.c b/target-arm/helper.c index 1ce8105ab3..dd8e3067d0 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -278,6 +278,10 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) } } +/* TODO Move contents into arm_cpu_reset() in cpu.c, + * once cpu_reset_model_id() is eliminated, + * and then forward to cpu_reset() here. + */ void cpu_state_reset(CPUARMState *env) { uint32_t id; @@ -400,6 +404,7 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) CPUARMState *cpu_arm_init(const char *cpu_model) { + ARMCPU *cpu; CPUARMState *env; uint32_t id; static int inited = 0; @@ -407,7 +412,8 @@ CPUARMState *cpu_arm_init(const char *cpu_model) id = cpu_arm_find_by_name(cpu_model); if (id == 0) return NULL; - env = g_malloc0(sizeof(CPUARMState)); + cpu = ARM_CPU(object_new(TYPE_ARM_CPU)); + env = &cpu->env; cpu_exec_init(env); if (tcg_enabled() && !inited) { inited = 1; -- cgit v1.2.3