diff options
author | Andreas Färber <afaerber@suse.de> | 2012-05-02 18:49:27 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-06-04 23:00:42 +0200 |
commit | 608911acac53f08dfaaf1878f56d4e32ee572ce4 (patch) | |
tree | 14ef9fd6958e3203bcdb81bff8c4a61166145734 /hw/pc.c | |
parent | b47ed9969fb12527c40aa507e165061c20e21836 (diff) | |
download | qemu-608911acac53f08dfaaf1878f56d4e32ee572ce4.zip qemu-608911acac53f08dfaaf1878f56d4e32ee572ce4.tar.gz qemu-608911acac53f08dfaaf1878f56d4e32ee572ce4.tar.bz2 |
pc: Use cpu_x86_init() to obtain X86CPU
Needed for pc_cpu_reset().
Also change return type to X86CPU.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r-- | hw/pc.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -932,21 +932,23 @@ static void pc_cpu_reset(void *opaque) env->halted = !cpu_is_bsp(env); } -static CPUX86State *pc_new_cpu(const char *cpu_model) +static X86CPU *pc_new_cpu(const char *cpu_model) { + X86CPU *cpu; CPUX86State *env; - env = cpu_init(cpu_model); - if (!env) { + cpu = cpu_x86_init(cpu_model); + if (cpu == NULL) { fprintf(stderr, "Unable to find x86 CPU definition\n"); exit(1); } + env = &cpu->env; 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); - return env; + return cpu; } void pc_cpus_init(const char *cpu_model) |