summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target-arm/translate.c1
-rw-r--r--target-i386/helper2.c2
-rw-r--r--target-ppc/translate.c2
-rw-r--r--target-sparc/translate.c1
4 files changed, 4 insertions, 2 deletions
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 00bdbb98ac..3185286bbc 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -815,6 +815,7 @@ CPUARMState *cpu_arm_init(void)
if (!env)
return NULL;
memset(env, 0, sizeof(CPUARMState));
+ cpu_single_env = env;
return env;
}
diff --git a/target-i386/helper2.c b/target-i386/helper2.c
index 455b348a0a..06c732edce 100644
--- a/target-i386/helper2.c
+++ b/target-i386/helper2.c
@@ -75,9 +75,9 @@ CPUX86State *cpu_x86_init(void)
modify_ldt(1, &ldt, sizeof(ldt)); /* write ldt entry */
asm volatile ("movl %0, %%fs" : : "r" ((1 << 3) | 7));
- cpu_single_env = env;
}
#endif
+ cpu_single_env = env;
cpu_reset(env);
return env;
}
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 1489c462f5..a3133fdfcf 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -2994,7 +2994,7 @@ CPUPPCState *cpu_ppc_init(void)
env->nip = 0xFFFFFFFC;
#endif
env->access_type = ACCESS_INT;
-
+ cpu_single_env = env;
return env;
}
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index bcc810b208..fe37c0748f 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -840,6 +840,7 @@ CPUSPARCState *cpu_sparc_init(void)
env->wim = 1;
env->regwptr = env->regbase + (env->cwp * 16);
env->user_mode_only = 1;
+ cpu_single_env = env;
return (env);
}