mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-25 02:52:06 -06:00
arm/highbank: Use object_new() rather than cpu_arm_init()
To allow the machine model to set device properties before CPU realization. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 8c671e500390c8be0cc363e887e32867d1d1b0d2.1387160489.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
07a5b0d21e
commit
f282f29626
1 changed files with 9 additions and 3 deletions
|
@ -26,6 +26,7 @@
|
||||||
#include "hw/boards.h"
|
#include "hw/boards.h"
|
||||||
#include "sysemu/blockdev.h"
|
#include "sysemu/blockdev.h"
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
|
#include "qemu/error-report.h"
|
||||||
|
|
||||||
#define SMP_BOOT_ADDR 0x100
|
#define SMP_BOOT_ADDR 0x100
|
||||||
#define SMP_BOOT_REG 0x40
|
#define SMP_BOOT_REG 0x40
|
||||||
|
@ -229,10 +230,15 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (n = 0; n < smp_cpus; n++) {
|
for (n = 0; n < smp_cpus; n++) {
|
||||||
|
ObjectClass *oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model);
|
||||||
ARMCPU *cpu;
|
ARMCPU *cpu;
|
||||||
cpu = cpu_arm_init(cpu_model);
|
Error *err = NULL;
|
||||||
if (cpu == NULL) {
|
|
||||||
fprintf(stderr, "Unable to find CPU definition\n");
|
cpu = ARM_CPU(object_new(object_class_get_name(oc)));
|
||||||
|
|
||||||
|
object_property_set_bool(OBJECT(cpu), true, "realized", &err);
|
||||||
|
if (err) {
|
||||||
|
error_report("%s", error_get_pretty(err));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue