qemu-patch-raspberry4/target
Igor Mammedov d5ebe62556 sh4: simplify superh_cpu_class_by_name()
currently for sh4 cpu_model argument for '-cpu' option
could be either 'cpu model' name or cpu_typename.

however typically '-cpu' takes 'cpu model' name and
cpu type for sh4 target isn't advertised publicly
('-cpu help' prints only 'cpu model' names) so we
shouldn't care about this use case (it's more of a bug).

1. Drop '-cpu cpu_typename' to align with the rest of
   targets.
2. Compose searched for typename from cpu model and use
   it with object_class_by_name() directly instead of
   over-complicated
       object_class_get_list()
       g_slist_find_custom() + superh_cpu_name_compare()

With #1 droped, #2 could be used for both lookups which
simplifies superh_cpu_class_by_name() quite a bit.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <1507211474-188400-23-git-send-email-imammedo@redhat.com>
[ehabkost: Include fixup sent by Igor]
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-10-27 16:03:55 +02:00
..
alpha alpha: cleanup cpu type name composition 2017-10-27 16:03:53 +02:00
arm tcg: Avoid setting tcg_initialize if !CONFIG_TCG 2017-10-26 17:47:36 +01:00
cris cris: cleanup cpu type name composition 2017-10-27 16:03:54 +02:00
hppa tcg: Initialize cpu_env generically 2017-10-24 13:53:42 -07:00
i386 tcg: Avoid setting tcg_initialize if !CONFIG_TCG 2017-10-26 17:47:36 +01:00
lm32 lm32: cleanup cpu type name composition 2017-10-27 16:03:54 +02:00
m68k m68k: cleanup cpu type name composition 2017-10-27 16:03:54 +02:00
microblaze tcg: Initialize cpu_env generically 2017-10-24 13:53:42 -07:00
mips tcg: Avoid setting tcg_initialize if !CONFIG_TCG 2017-10-26 17:47:36 +01:00
moxie moxie: cleanup cpu type name composition 2017-10-27 16:03:54 +02:00
nios2 tcg: Initialize cpu_env generically 2017-10-24 13:53:42 -07:00
openrisc openrisc: cleanup cpu type name composition 2017-10-27 16:03:54 +02:00
ppc tcg: Avoid setting tcg_initialize if !CONFIG_TCG 2017-10-26 17:47:36 +01:00
s390x tcg: Avoid setting tcg_initialize if !CONFIG_TCG 2017-10-26 17:47:36 +01:00
sh4 sh4: simplify superh_cpu_class_by_name() 2017-10-27 16:03:55 +02:00
sparc tcg: Initialize cpu_env generically 2017-10-24 13:53:42 -07:00
tilegx tcg: Initialize cpu_env generically 2017-10-24 13:53:42 -07:00
tricore tcg: Initialize cpu_env generically 2017-10-24 13:53:42 -07:00
unicore32 tcg: Initialize cpu_env generically 2017-10-24 13:53:42 -07:00
xtensa tcg: Initialize cpu_env generically 2017-10-24 13:53:42 -07:00