]> Git Repo - qemu.git/blobdiff - target-lm32/helper.c
arm_boot: Pass ARMCPU to do_cpu_reset()
[qemu.git] / target-lm32 / helper.c
index 78076e4603e464f1f22c9c75adc6a02282c6d924..d0bc1931d8db672955f254b5c00664ba5f2d7aa4 100644 (file)
@@ -194,6 +194,7 @@ static uint32_t cfg_by_def(const LM32Def *def)
 
 CPULM32State *cpu_lm32_init(const char *cpu_model)
 {
+    LM32CPU *cpu;
     CPULM32State *env;
     const LM32Def *def;
     static int tcg_initialized;
@@ -203,16 +204,14 @@ CPULM32State *cpu_lm32_init(const char *cpu_model)
         return NULL;
     }
 
-    env = g_malloc0(sizeof(CPULM32State));
+    cpu = LM32_CPU(object_new(TYPE_LM32_CPU));
+    env = &cpu->env;
 
     env->features = def->features;
     env->num_bps = def->num_breakpoints;
     env->num_wps = def->num_watchpoints;
     env->cfg = cfg_by_def(def);
-    env->flags = 0;
 
-    cpu_exec_init(env);
-    cpu_state_reset(env);
     qemu_init_vcpu(env);
 
     if (tcg_enabled() && !tcg_initialized) {
@@ -237,14 +236,6 @@ void cpu_lm32_set_phys_msb_ignore(CPULM32State *env, int value)
 
 void cpu_state_reset(CPULM32State *env)
 {
-    if (qemu_loglevel_mask(CPU_LOG_RESET)) {
-        qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
-        log_cpu_state(env, 0);
-    }
-
-    tlb_flush(env, 1);
-
-    /* reset cpu state */
-    memset(env, 0, offsetof(CPULM32State, breakpoints));
+    cpu_reset(ENV_GET_CPU(env));
 }
 
This page took 0.026598 seconds and 4 git commands to generate.