[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH target-arm v4 06/12] arm/highbank: Use object_new()
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH target-arm v4 06/12] arm/highbank: Use object_new() rather than cpu_arm_init() |
Date: |
Tue, 10 Dec 2013 18:56:27 -0800 |
To allow the machine model to set device properties before CPU
realization.
Signed-off-by: Peter Crosthwaite <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
---
changed since v1:
use error_report rather than fprintf(stderr
hw/arm/highbank.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index fe98ef1..1d19d8f 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -26,6 +26,7 @@
#include "hw/boards.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
+#include "qemu/error-report.h"
#define SMP_BOOT_ADDR 0x100
#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++) {
+ ObjectClass *oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model);
ARMCPU *cpu;
- cpu = cpu_arm_init(cpu_model);
- if (cpu == NULL) {
- fprintf(stderr, "Unable to find CPU definition\n");
+ Error *err = NULL;
+
+ 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);
}
--
1.8.5.1
- [Qemu-devel] [PATCH target-arm v4 00/12] Fix Support for ARM CBAR and reset-hivecs, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 01/12] qom: Make uintXX added properties writable, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 02/12] qom: Add object_property_add_bool_ptr(), Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 03/12] target-arm/helper.c: Allow cp15.c15 dummy override, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 04/12] target-arm: Define and use ARM_FEATURE_CBAR, Peter Crosthwaite, 2013/12/10
- Re: [Qemu-devel] [PATCH target-arm v4 00/12] Fix Support for ARM CBAR and reset-hivecs, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 05/12] target-arm/cpu: Convert reset CBAR to a property, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 06/12] arm/highbank: Use object_new() rather than cpu_arm_init(),
Peter Crosthwaite <=
- [Qemu-devel] [PATCH target-arm v4 07/12] arm/highbank: Fix CBAR initialisation, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 08/12] arm/xilinx_zynq: Use object_new() rather than cpu_arm_init(), Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 09/12] arm/xilinx_zynq: Implement CBAR initialisation, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 10/12] arm/highbank.c: Fix MPCore periphbase name, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 11/12] ARM: cpu: add "reset_hivecs" property, Peter Crosthwaite, 2013/12/10
- [Qemu-devel] [PATCH target-arm v4 12/12] ARM: arm_cpu_reset: make it possible to use high vectors for reset_exc, Peter Crosthwaite, 2013/12/10