Signed-off-by: Andreas Färber <afaerber@suse.de>
{
LM32CPU *cpu = LM32_CPU(obj);
CPULM32State *env = &cpu->env;
+ static bool tcg_initialized;
cpu_exec_init(env);
env->flags = 0;
+
+ if (tcg_enabled() && !tcg_initialized) {
+ tcg_initialized = true;
+ lm32_translate_init();
+ }
}
static void lm32_cpu_class_init(ObjectClass *oc, void *data)
LM32CPU *cpu;
CPULM32State *env;
const LM32Def *def;
- static int tcg_initialized;
def = cpu_lm32_find_by_name(cpu_model);
if (!def) {
env->num_wps = def->num_watchpoints;
env->cfg = cfg_by_def(def);
- if (tcg_enabled() && !tcg_initialized) {
- tcg_initialized = 1;
- lm32_translate_init();
- }
-
object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
return cpu;