diff options
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r-- | target-i386/helper.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c index 3421be2276..d3af6eaf71 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -26,12 +26,6 @@ //#define DEBUG_MMU -/* NOTE: must be called outside the CPU execute loop */ -void cpu_state_reset(CPUX86State *env) -{ - cpu_reset(ENV_GET_CPU(env)); -} - static void cpu_x86_version(CPUX86State *env, int *family, int *model) { int cpuver = env->cpuid_version; @@ -957,7 +951,7 @@ static void breakpoint_handler(CPUX86State *env) if (env->watchpoint_hit->flags & BP_CPU) { env->watchpoint_hit = NULL; if (check_hw_breakpoints(env, 0)) - raise_exception_env(EXCP01_DB, env); + raise_exception(env, EXCP01_DB); else cpu_resume_from_signal(env, NULL); } @@ -966,7 +960,7 @@ static void breakpoint_handler(CPUX86State *env) if (bp->pc == env->eip) { if (bp->flags & BP_CPU) { check_hw_breakpoints(env, 1); - raise_exception_env(EXCP01_DB, env); + raise_exception(env, EXCP01_DB); } break; } @@ -1157,7 +1151,7 @@ int cpu_x86_get_descr_debug(CPUX86State *env, unsigned int selector, return 1; } -CPUX86State *cpu_x86_init(const char *cpu_model) +X86CPU *cpu_x86_init(const char *cpu_model) { X86CPU *cpu; CPUX86State *env; @@ -1183,31 +1177,34 @@ CPUX86State *cpu_x86_init(const char *cpu_model) x86_cpu_realize(OBJECT(cpu), NULL); - return env; + return cpu; } #if !defined(CONFIG_USER_ONLY) -void do_cpu_init(CPUX86State *env) +void do_cpu_init(X86CPU *cpu) { + CPUX86State *env = &cpu->env; int sipi = env->interrupt_request & CPU_INTERRUPT_SIPI; uint64_t pat = env->pat; - cpu_state_reset(env); + cpu_reset(CPU(cpu)); env->interrupt_request = sipi; env->pat = pat; apic_init_reset(env->apic_state); env->halted = !cpu_is_bsp(env); } -void do_cpu_sipi(CPUX86State *env) +void do_cpu_sipi(X86CPU *cpu) { + CPUX86State *env = &cpu->env; + apic_sipi(env->apic_state); } #else -void do_cpu_init(CPUX86State *env) +void do_cpu_init(X86CPU *cpu) { } -void do_cpu_sipi(CPUX86State *env) +void do_cpu_sipi(X86CPU *cpu) { } #endif |