aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2017-10-05 15:51:05 +0200
committerEduardo Habkost <ehabkost@redhat.com>2017-10-27 16:04:27 +0200
commit1d4bfc5496387124e56df6fd49481e1821403456 (patch)
tree5e86db66ff45ac778585f7d8c456a18cc596f522 /target
parent0f550c5cc7869b3099d55e27f4eb8b7787df5150 (diff)
sparc: cleanup cpu type name composition
introduce SPARC_CPU_TYPE_NAME macro and use it to construct cpu type names. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <1507211474-188400-32-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target')
-rw-r--r--target/sparc/cpu.c2
-rw-r--r--target/sparc/cpu.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index 47d0927707..c7adc281de 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -712,7 +712,7 @@ static bool sparc_cpu_has_work(CPUState *cs)
static char *sparc_cpu_type_name(const char *cpu_model)
{
- char *name = g_strdup_printf("%s-" TYPE_SPARC_CPU, cpu_model);
+ char *name = g_strdup_printf(SPARC_CPU_TYPE_NAME("%s"), cpu_model);
char *s = name;
/* SPARC cpu model names happen to have whitespaces,
diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index bf2b8931cc..9fde547fac 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -658,6 +658,9 @@ int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
#define cpu_init(cpu_model) cpu_generic_init(TYPE_SPARC_CPU, cpu_model)
#endif
+#define SPARC_CPU_TYPE_SUFFIX "-" TYPE_SPARC_CPU
+#define SPARC_CPU_TYPE_NAME(model) model SPARC_CPU_TYPE_SUFFIX
+
#define cpu_signal_handler cpu_sparc_signal_handler
#define cpu_list sparc_cpu_list