aboutsummaryrefslogtreecommitdiff
path: root/target-cris/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-cris/cpu.c')
-rw-r--r--target-cris/cpu.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/target-cris/cpu.c b/target-cris/cpu.c
index 34c4f75a44..fedf64191d 100644
--- a/target-cris/cpu.c
+++ b/target-cris/cpu.c
@@ -70,8 +70,18 @@ static void cris_cpu_initfn(Object *obj)
{
CRISCPU *cpu = CRIS_CPU(obj);
CPUCRISState *env = &cpu->env;
+ static bool tcg_initialized;
cpu_exec_init(env);
+
+ if (tcg_enabled() && !tcg_initialized) {
+ tcg_initialized = true;
+ if (env->pregs[PR_VR] < 32) {
+ cris_initialize_crisv10_tcg();
+ } else {
+ cris_initialize_tcg();
+ }
+ }
}
static void cris_cpu_class_init(ObjectClass *oc, void *data)