[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 5/6] target-i386: move reset callback to cpu.c
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH RFC 5/6] target-i386: move reset callback to cpu.c |
Date: |
Tue, 17 Apr 2012 01:37:02 +0200 |
From: Igor Mammedov <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/pc.c | 8 --------
target-i386/cpu.c | 8 ++++++++
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index db381ab..157327a 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -887,13 +887,6 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int
level)
}
}
-static void pc_cpu_reset(void *opaque)
-{
- CPUX86State *env = opaque;
-
- cpu_state_reset(env);
-}
-
void pc_cpus_init(const char *cpu_model)
{
CPUX86State *env;
@@ -904,7 +897,6 @@ void pc_cpus_init(const char *cpu_model)
if (!env) {
exit(1);
}
- qemu_register_reset(pc_cpu_reset, env);
}
}
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index e4dcf52..d92ec58 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1456,6 +1456,13 @@ static void x86_cpu_reset(CPUState *s)
env->halted = !(cpu_get_apic_base(env->apic_state) &
MSR_IA32_APICBASE_BSP);
}
+static void pc_cpu_reset(void *opaque)
+{
+ CPUX86State *env = opaque;
+
+ cpu_reset(ENV_GET_CPU(env));
+}
+
static void mce_init(X86CPU *cpu)
{
CPUX86State *cenv = &cpu->env;
@@ -1574,6 +1581,7 @@ static void x86_cpu_realize(Object *obj, Error **errp)
CPUX86State *env = &cpu->env;
qemu_init_vcpu(env);
+ qemu_register_reset(pc_cpu_reset, env);
cpu_reset(CPU(cpu));
}
--
1.7.7.6
- [Qemu-devel] [PATCH RFC 1/6] target-i386: move cpu halted decision into x86_cpu_reset, (continued)
- [Qemu-devel] [PATCH RFC 1/6] target-i386: move cpu halted decision into x86_cpu_reset, Igor Mammedov, 2012/04/16
- [Qemu-devel] [PATCH RFC 2/6] target-i386: add cpu-model property to x86_cpu, Igor Mammedov, 2012/04/16
- [Qemu-devel] [PATCH RFC 3/6] pc: move apic_mapped intialization into common apic init code, Igor Mammedov, 2012/04/16
- [Qemu-devel] [PATCH RFC 4/6] target-i386: convert cpu to 2-stage initialization, Igor Mammedov, 2012/04/16
- [Qemu-devel] [PATCH RFC 6/6] target-i386: make cpus childs of /machine, Igor Mammedov, 2012/04/16
- [Qemu-devel] [PATCH RFC 5/6] target-i386: move reset callback to cpu.c,
Igor Mammedov <=
Re: [Qemu-devel] [PATCH RFC 0/6] target-i386: use realize for cpu initialization, Andreas Färber, 2012/04/17