From e5fe7a34d421eb97fc3b69f58d8e91f4679ffb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 2 May 2012 19:37:34 +0200 Subject: [PATCH] pc: Pass X86CPU to pc_cpu_reset() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows us to use cpu_reset() in place of cpu_state_reset(). Signed-off-by: Andreas Färber Reviewed-by: Igor Mammedov --- hw/pc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 11339215a7..8368701efb 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -926,9 +926,10 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level) static void pc_cpu_reset(void *opaque) { - CPUX86State *env = opaque; + X86CPU *cpu = opaque; + CPUX86State *env = &cpu->env; - cpu_state_reset(env); + cpu_reset(CPU(cpu)); env->halted = !cpu_is_bsp(env); } @@ -946,8 +947,8 @@ static X86CPU *pc_new_cpu(const char *cpu_model) if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) { env->apic_state = apic_init(env, env->cpuid_apic_id); } - qemu_register_reset(pc_cpu_reset, env); - pc_cpu_reset(env); + qemu_register_reset(pc_cpu_reset, cpu); + pc_cpu_reset(cpu); return cpu; }