diff options
author | Igor Mammedov <imammedo@redhat.com> | 2017-09-13 18:04:56 +0200 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2017-09-19 09:09:32 -0300 |
commit | 311ca98d16bbb6a2a38b38ba898baa4a4d4ab9a7 (patch) | |
tree | 040c5451564ecd2020fcf40ca5fdf30c2eb2d086 /target | |
parent | 6063d4c0f98b35a27ca018393d328a1825412a7e (diff) | |
download | qemu-311ca98d16bbb6a2a38b38ba898baa4a4d4ab9a7.zip qemu-311ca98d16bbb6a2a38b38ba898baa4a4d4ab9a7.tar.gz qemu-311ca98d16bbb6a2a38b38ba898baa4a4d4ab9a7.tar.bz2 |
pc: use generic cpu_model parsing
define default CPU type in generic way in pc_machine_class_init()
and let common machine code to handle cpu_model parsing
Patch also introduces TARGET_DEFAULT_CPU_TYPE define for 2 purposes:
* make foo_machine_class_init() look uniform on every target
* use define in [bsd|linux]-user targets to pick default
cpu type
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <1505318697-77161-5-git-send-email-imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/i386/cpu.c | 3 | ||||
-rw-r--r-- | target/i386/cpu.h | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 69676e1..d0000e4 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -705,9 +705,6 @@ void host_vendor_fms(char *vendor, int *family, int *model, int *stepping) /* CPU class name definitions: */ -#define X86_CPU_TYPE_SUFFIX "-" TYPE_X86_CPU -#define X86_CPU_TYPE_NAME(name) (name X86_CPU_TYPE_SUFFIX) - /* Return type name for a given CPU model name * Caller is responsible for freeing the returned string. */ diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 525d35d..4035a11 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1508,6 +1508,15 @@ uint64_t cpu_get_tsc(CPUX86State *env); #define cpu_init(cpu_model) cpu_generic_init(TYPE_X86_CPU, cpu_model) +#define X86_CPU_TYPE_SUFFIX "-" TYPE_X86_CPU +#define X86_CPU_TYPE_NAME(name) (name X86_CPU_TYPE_SUFFIX) + +#ifdef TARGET_X86_64 +#define TARGET_DEFAULT_CPU_TYPE X86_CPU_TYPE_NAME("qemu64") +#else +#define TARGET_DEFAULT_CPU_TYPE X86_CPU_TYPE_NAME("qemu32") +#endif + #define cpu_signal_handler cpu_x86_signal_handler #define cpu_list x86_cpu_list |