aboutsummaryrefslogtreecommitdiff
path: root/hw/alpha/dp264.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 /hw/alpha/dp264.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 'hw/alpha/dp264.c')
-rw-r--r--hw/alpha/dp264.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 3b307ad873..1c5a177102 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -51,7 +51,7 @@ static int clipper_pci_map_irq(PCIDevice *d, int irq_num)
static void clipper_init(MachineState *machine)
{
ram_addr_t ram_size = machine->ram_size;
- const char *cpu_model = machine->cpu_model;
+ const char *cpu_model = machine->cpu_model ? machine->cpu_model : "ev67";
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
@@ -67,7 +67,11 @@ static void clipper_init(MachineState *machine)
/* Create up to 4 cpus. */
memset(cpus, 0, sizeof(cpus));
for (i = 0; i < smp_cpus; ++i) {
- cpus[i] = cpu_alpha_init(cpu_model ? cpu_model : "ev67");
+ cpus[i] = ALPHA_CPU(cpu_generic_init(TYPE_ALPHA_CPU, cpu_model));
+ if (!cpus[i]) {
+ error_report("Unable to find CPU definition");
+ exit(1);
+ }
}
cpus[0]->env.trap_arg0 = ram_size;