diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-17 12:00:51 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-04-25 10:51:35 +0200 |
commit | 61dcd775785b07a5e0c3858b67aa356b87543710 (patch) | |
tree | 3167ec34ad1cb53a941f485c216698c154093990 | |
parent | d0a6acf456a2497ce9f70f8366a5b405745ba279 (diff) | |
download | hqemu-61dcd775785b07a5e0c3858b67aa356b87543710.zip hqemu-61dcd775785b07a5e0c3858b67aa356b87543710.tar.gz |
target-i386: Pass X86CPU to cpu_x86_register()
Avoids an x86_env_get_cpu() call there, to work with QOM properties.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
-rw-r--r-- | target-i386/cpu.c | 3 | ||||
-rw-r--r-- | target-i386/cpu.h | 2 | ||||
-rw-r--r-- | target-i386/helper.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index e1517e6..3dc0f80 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -905,8 +905,9 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg) } } -int cpu_x86_register (CPUX86State *env, const char *cpu_model) +int cpu_x86_register(X86CPU *cpu, const char *cpu_model) { + CPUX86State *env = &cpu->env; x86_def_t def1, *def = &def1; memset(def, 0, sizeof(*def)); diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 4bb4592..b5b9a50 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -901,7 +901,7 @@ int cpu_x86_signal_handler(int host_signum, void *pinfo, void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx); -int cpu_x86_register (CPUX86State *env, const char *cpu_model); +int cpu_x86_register(X86CPU *cpu, const char *cpu_model); void cpu_clear_apic_feature(CPUX86State *env); void host_cpuid(uint32_t function, uint32_t count, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx); diff --git a/target-i386/helper.c b/target-i386/helper.c index 87954f0..0b22582 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1176,7 +1176,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) cpu_set_debug_excp_handler(breakpoint_handler); #endif } - if (cpu_x86_register(env, cpu_model) < 0) { + if (cpu_x86_register(cpu, cpu_model) < 0) { object_delete(OBJECT(cpu)); return NULL; } |