From 7a9f812b381639b96a020bdb1f4783f11f886754 Mon Sep 17 00:00:00 2001 From: Andreas Färber Date: Sun, 27 Jan 2013 20:16:17 +0100 Subject: target-m68k: Rename CPU subtypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the initial conversion of CPU models to QOM types, model names were mapped 1:1 to type names. As a side effect this gained us a type "any", which is now a device. To avoid "-device any" silliness and to pave the way for compiling multiple targets into one executable, adopt a --cpu scheme. No functional changes for -cpu arguments or -cpu ? output. Signed-off-by: Andreas Färber --- target-m68k/helper.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'target-m68k/helper.c') diff --git a/target-m68k/helper.c b/target-m68k/helper.c index f66e12b6ba..5ddcd707fd 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -34,9 +34,9 @@ static gint m68k_cpu_list_compare(gconstpointer a, gconstpointer b) name_a = object_class_get_name(class_a); name_b = object_class_get_name(class_b); - if (strcmp(name_a, "any") == 0) { + if (strcmp(name_a, "any-" TYPE_M68K_CPU) == 0) { return 1; - } else if (strcmp(name_b, "any") == 0) { + } else if (strcmp(name_b, "any-" TYPE_M68K_CPU) == 0) { return -1; } else { return strcasecmp(name_a, name_b); @@ -47,9 +47,14 @@ static void m68k_cpu_list_entry(gpointer data, gpointer user_data) { ObjectClass *c = data; CPUListState *s = user_data; + const char *typename; + char *name; + typename = object_class_get_name(c); + name = g_strndup(typename, strlen(typename) - strlen("-" TYPE_M68K_CPU)); (*s->cpu_fprintf)(s->file, "%s\n", - object_class_get_name(c)); + name); + g_free(name); } void m68k_cpu_list(FILE *f, fprintf_function cpu_fprintf) -- cgit v1.2.3