[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 43/66] target-ppc: Get model name from type name
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 43/66] target-ppc: Get model name from type name |
Date: |
Fri, 8 Mar 2013 21:06:45 +0100 |
From: Andreas Färber <address@hidden>
We are about to drop the redundant name field along with ppc_def_t.
Signed-off-by: Andreas Färber <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/translate_init.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 9d4831f..7eb565d 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -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;
--
1.6.0.2
- [Qemu-ppc] [PATCH 39/66] target-ppc: Extract MPC8240 alias, (continued)
- [Qemu-ppc] [PATCH 39/66] target-ppc: Extract MPC8240 alias, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 01/66] pseries: Add cleanup hook for PAPR virtual LAN device, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 30/66] target-ppc: Extract MPC83xx aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 40/66] target-ppc: Extract 405GPe alias, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 38/66] target-ppc: Extract MPC5200/MPC5200B aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 47/66] target-ppc: Register all types for TARGET_PPCEMB, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 41/66] target-ppc: Extract 970 aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 35/66] target-ppc: Extract MPC82xx aliases to *_HiP4, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 54/66] target-ppc: Change "POWER7" CPU alias, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 59/66] target-ppc: Fix PPC_DUMP_SPR_ACCESS build, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 43/66] target-ppc: Get model name from type name,
Alexander Graf <=
- [Qemu-ppc] [PATCH 28/66] target-ppc: Extract MPC85xx aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 37/66] target-ppc: Extract MPC52xx alias, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 36/66] target-ppc: Extract MPC82xx_HiP{3, 4} aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 34/66] target-ppc: Extract MPC8247/MPC8248/MPC8270-80 aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 61/66] PPC: xnu kernel expects FLUSH to be cleared on STOP, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 53/66] target-ppc: Fix remaining microcontroller typos among models, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 55/66] pseries: Implement h_read hcall, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 44/66] target-ppc: Convert CPU definitions, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 63/66] target-ppc: List alias names alongside CPU models, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 56/66] Save memory allocation in the elf loader, Alexander Graf, 2013/03/08