[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 01/24] cpu/a9mpcore: Split off instance_init
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH v3 01/24] cpu/a9mpcore: Split off instance_init |
Date: |
Tue, 20 Aug 2013 17:20:53 +0200 |
From: Andreas Färber <address@hidden>
Prepares for QOM realize.
Signed-off-by: Andreas Färber <address@hidden>
---
hw/cpu/a9mpcore.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c
index 3e675e3..acbdab5 100644
--- a/hw/cpu/a9mpcore.c
+++ b/hw/cpu/a9mpcore.c
@@ -34,6 +34,14 @@ static void a9mp_priv_set_irq(void *opaque, int irq, int
level)
qemu_set_irq(qdev_get_gpio_in(s->gic, irq), level);
}
+static void a9mp_priv_initfn(Object *obj)
+{
+ A9MPPrivState *s = A9MPCORE_PRIV(obj);
+
+ memory_region_init(&s->container, obj, "a9mp-priv-container", 0x2000);
+ sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->container);
+}
+
static int a9mp_priv_init(SysBusDevice *dev)
{
A9MPPrivState *s = A9MPCORE_PRIV(dev);
@@ -78,7 +86,6 @@ static int a9mp_priv_init(SysBusDevice *dev)
*
* We should implement the global timer but don't currently do so.
*/
- memory_region_init(&s->container, OBJECT(s), "a9mp-priv-container",
0x2000);
memory_region_add_subregion(&s->container, 0,
sysbus_mmio_get_region(scubusdev, 0));
/* GIC CPU interface */
@@ -94,8 +101,6 @@ static int a9mp_priv_init(SysBusDevice *dev)
memory_region_add_subregion(&s->container, 0x1000,
sysbus_mmio_get_region(gicbusdev, 0));
- sysbus_init_mmio(dev, &s->container);
-
/* Wire up the interrupt from each watchdog and timer.
* For each core the timer is PPI 29 and the watchdog PPI 30.
*/
@@ -134,6 +139,7 @@ static const TypeInfo a9mp_priv_info = {
.name = TYPE_A9MPCORE_PRIV,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(A9MPPrivState),
+ .instance_init = a9mp_priv_initfn,
.class_init = a9mp_priv_class_init,
};
--
1.8.1.4
- [Qemu-devel] [PATCH v3 00/24] arm: ARM11MPCore+A9MPCore+A15MPCore QOM'ification, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 02/24] intc/arm_gic: Extract headers hw/intc/arm_gic{, _common}.h, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 14/24] a9scu: Build only once, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 01/24] cpu/a9mpcore: Split off instance_init,
Andreas Färber <=
- [Qemu-devel] [PATCH v3 03/24] cpu/a9mpcore: Embed GICState, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 10/24] cpu/a15mpcore: Split off instance_init, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 08/24] cpu/a9mpcore: Convert to QOM realize, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 11/24] cpu/a15mpcore: Embed GICState, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 04/24] misc/a9scu: QOM cleanups, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 15/24] arm11mpcore: Fix typo in MemoryRegion name, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 05/24] cpu/a9mpcore: Embed A9SCUState, Andreas Färber, 2013/08/20