summaryrefslogtreecommitdiffstats
path: root/hw/arm
diff options
context:
space:
mode:
authorPeter Maydell2019-02-01 15:55:41 +0100
committerPeter Maydell2019-02-01 15:55:41 +0100
commite4c81e3a451f9ce692f2644b395facbbdc3891cb (patch)
tree7a442f74d7ab490cb3cdf5de768e841c158014de /hw/arm
parentarmv7m: Don't assume the NVIC's CPU is CPU 0 (diff)
downloadqemu-e4c81e3a451f9ce692f2644b395facbbdc3891cb.tar.gz
qemu-e4c81e3a451f9ce692f2644b395facbbdc3891cb.tar.xz
qemu-e4c81e3a451f9ce692f2644b395facbbdc3891cb.zip
armv7m: Make cpu object a child of the armv7m container
Rather than just creating the CPUs with object_new, make them child objects of the armv7m container. This will allow the cluster code to find the CPUs if an armv7m object is made a child of a cluster object. object_new_with_props() will do the parenting for us. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20190121185118.18550-3-peter.maydell@linaro.org
Diffstat (limited to 'hw/arm')
-rw-r--r--hw/arm/armv7m.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index f9aa83d20e..0f2c8e066c 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -158,7 +158,12 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion_overlap(&s->container, 0, s->board_memory, -1);
- s->cpu = ARM_CPU(object_new(s->cpu_type));
+ s->cpu = ARM_CPU(object_new_with_props(s->cpu_type, OBJECT(s), "cpu",
+ &err, NULL));
+ if (err != NULL) {
+ error_propagate(errp, err);
+ return;
+ }
object_property_set_link(OBJECT(s->cpu), OBJECT(&s->container), "memory",
&error_abort);