aboutsummaryrefslogtreecommitdiff
path: root/target/alpha/cpu.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2017-08-24 18:31:32 +0200
committerEduardo Habkost <ehabkost@redhat.com>2017-09-01 11:54:24 -0300
commit82a3d1f81f8e401c6c34cba541970197aba2bb9a (patch)
treee9fbaedc3e1bdd5bc7784834a58de65a27ebad2d /target/alpha/cpu.c
parent6ad76dfd137b4d43c88f88a3cd27312f066c63ac (diff)
alpha: replace cpu_alpha_init() with cpu_generic_init()
cpu_alpha_init() used to provide default fallback if invalid (i.e. non existent) cpu_model were provided. dp264 machine provides its own default so sole user of fallback is [bsd|linux]-user targets which specifies 'any' cpu model that fallbacks to "ev67" in cpu_alpha_init(). Push fallback handling into alpha_cpu_class_by_name() and replace cpu_alpha_init() with cpu_generic_init(). Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Richard Henderson <rth@twiddle.net> Message-Id: <1503592308-93913-10-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target/alpha/cpu.c')
-rw-r--r--target/alpha/cpu.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index 76150f48d3..1ea597b9dd 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -155,24 +155,14 @@ static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
if (oc != NULL && object_class_is_abstract(oc)) {
oc = NULL;
}
- return oc;
-}
-
-AlphaCPU *cpu_alpha_init(const char *cpu_model)
-{
- AlphaCPU *cpu;
- ObjectClass *cpu_class;
- cpu_class = alpha_cpu_class_by_name(cpu_model);
- if (cpu_class == NULL) {
- /* Default to ev67; no reason not to emulate insns by default. */
- cpu_class = object_class_by_name(TYPE("ev67"));
+ /* TODO: remove match everything nonsense */
+ /* Default to ev67; no reason not to emulate insns by default. */
+ if (!oc) {
+ oc = object_class_by_name(TYPE("ev67"));
}
- cpu = ALPHA_CPU(object_new(object_class_get_name(cpu_class)));
-
- object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
- return cpu;
+ return oc;
}
static void ev4_cpu_initfn(Object *obj)