target-ppc: Get model name from type name

We are about to drop the redundant name field along with ppc_def_t.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Andreas Färber 2013-02-17 23:16:40 +00:00 committed by Alexander Graf
parent f591784b63
commit de400129da

View File

@ -9979,9 +9979,14 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
ObjectClass *oc = data;
CPUListState *s = user_data;
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
const char *typename = object_class_get_name(oc);
char *name;
name = g_strndup(typename,
strlen(typename) - strlen("-" TYPE_POWERPC_CPU));
(*s->cpu_fprintf)(s->file, "PowerPC %-16s PVR %08x\n",
pcc->info->name, pcc->info->pvr);
name, pcc->info->pvr);
g_free(name);
}
void ppc_cpu_list(FILE *f, fprintf_function cpu_fprintf)
@ -10014,12 +10019,14 @@ static void ppc_cpu_defs_entry(gpointer data, gpointer user_data)
{
ObjectClass *oc = data;
CpuDefinitionInfoList **first = user_data;
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
const char *typename;
CpuDefinitionInfoList *entry;
CpuDefinitionInfo *info;
typename = object_class_get_name(oc);
info = g_malloc0(sizeof(*info));
info->name = g_strdup(pcc->info->name);
info->name = g_strndup(typename,
strlen(typename) - strlen("-" TYPE_POWERPC_CPU));
entry = g_malloc0(sizeof(*entry));
entry->value = info;