xtensa: cleanup cpu type name composition
use new XTENSA_CPU_TYPE_NAME to compose CPU type name to bring xtensa in line with all other targets that will similar macro. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <1507211474-188400-25-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
633cd13556
commit
a5247d761c
@ -83,7 +83,7 @@ static ObjectClass *xtensa_cpu_class_by_name(const char *cpu_model)
|
||||
ObjectClass *oc;
|
||||
char *typename;
|
||||
|
||||
typename = g_strdup_printf("%s-" TYPE_XTENSA_CPU, cpu_model);
|
||||
typename = g_strdup_printf(XTENSA_CPU_TYPE_NAME("%s"), cpu_model);
|
||||
oc = object_class_by_name(typename);
|
||||
g_free(typename);
|
||||
if (oc == NULL || !object_class_dynamic_cast(oc, TYPE_XTENSA_CPU) ||
|
||||
|
@ -469,11 +469,15 @@ void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
|
||||
#define cpu_signal_handler cpu_xtensa_signal_handler
|
||||
#define cpu_list xtensa_cpu_list
|
||||
|
||||
#define XTENSA_CPU_TYPE_SUFFIX "-" TYPE_XTENSA_CPU
|
||||
#define XTENSA_CPU_TYPE_NAME(model) model XTENSA_CPU_TYPE_SUFFIX
|
||||
|
||||
#ifdef TARGET_WORDS_BIGENDIAN
|
||||
#define XTENSA_DEFAULT_CPU_MODEL "fsf"
|
||||
#else
|
||||
#define XTENSA_DEFAULT_CPU_MODEL "dc232b"
|
||||
#endif
|
||||
#define XTENSA_DEFAULT_CPU_TYPE XTENSA_CPU_TYPE_NAME(XTENSA_DEFAULT_CPU_MODEL)
|
||||
|
||||
#define cpu_init(cpu_model) cpu_generic_init(TYPE_XTENSA_CPU, cpu_model)
|
||||
|
||||
|
@ -76,7 +76,7 @@ void xtensa_register_core(XtensaConfigList *node)
|
||||
|
||||
node->next = xtensa_cores;
|
||||
xtensa_cores = node;
|
||||
type.name = g_strdup_printf("%s-" TYPE_XTENSA_CPU, node->config->name);
|
||||
type.name = g_strdup_printf(XTENSA_CPU_TYPE_NAME("%s"), node->config->name);
|
||||
type_register(&type);
|
||||
g_free((gpointer)type.name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user