aboutsummaryrefslogtreecommitdiff
path: root/target-cris/translate.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-04-11 23:12:05 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2012-04-24 16:04:56 +0200
commite739a48e58c41fc0d3caa24103abef9988c77cdf (patch)
treee4da9051b0f07bc556362b5e3aeecac33089fe8b /target-cris/translate.c
parent092dfc7714ad7983aeb0cada5d5983e9fde8d84c (diff)
target-cris: QOM'ify CPU
Embed CPUCRISState as first member of QOM CRISCPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-cris/translate.c')
-rw-r--r--target-cris/translate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/target-cris/translate.c b/target-cris/translate.c
index 7224f46993..26c3f0bf86 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -3505,11 +3505,13 @@ static uint32_t vr_by_name(const char *name)
CPUCRISState *cpu_cris_init (const char *cpu_model)
{
+ CRISCPU *cpu;
CPUCRISState *env;
static int tcg_initialized = 0;
int i;
- env = g_malloc0(sizeof(CPUCRISState));
+ cpu = CRIS_CPU(object_new(TYPE_CRIS_CPU));
+ env = &cpu->env;
env->pregs[PR_VR] = vr_by_name(cpu_model);
cpu_exec_init(env);