[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 008/173] arm11mpcore: QOM cast cleanups for mpcore_ri
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 008/173] arm11mpcore: QOM cast cleanups for mpcore_rirq_state |
Date: |
Mon, 29 Jul 2013 21:17:45 +0200 |
Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.
Reviewed-by: Hu Tao <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/cpu/arm11mpcore.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c
index 31c9d5a..a786c62 100644
--- a/hw/cpu/arm11mpcore.c
+++ b/hw/cpu/arm11mpcore.c
@@ -161,11 +161,16 @@ static int mpcore_priv_init(SysBusDevice *sbd)
return 0;
}
+#define TYPE_REALVIEW_MPCORE_RIRQ "realview_mpcore"
+#define REALVIEW_MPCORE_RIRQ(obj) \
+ OBJECT_CHECK(mpcore_rirq_state, (obj), TYPE_REALVIEW_MPCORE_RIRQ)
+
/* Dummy PIC to route IRQ lines. The baseboard has 4 independent IRQ
controllers. The output of these, plus some of the raw input lines
are fed into a single SMP-aware interrupt controller on the CPU. */
typedef struct {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
SysBusDevice *priv;
qemu_irq cpuic[32];
qemu_irq rvic[4][64];
@@ -196,9 +201,10 @@ static void mpcore_rirq_set_irq(void *opaque, int irq, int
level)
}
}
-static int realview_mpcore_init(SysBusDevice *dev)
+static int realview_mpcore_init(SysBusDevice *sbd)
{
- mpcore_rirq_state *s = FROM_SYSBUS(mpcore_rirq_state, dev);
+ DeviceState *dev = DEVICE(sbd);
+ mpcore_rirq_state *s = REALVIEW_MPCORE_RIRQ(dev);
DeviceState *gic;
DeviceState *priv;
int n;
@@ -208,7 +214,7 @@ static int realview_mpcore_init(SysBusDevice *dev)
qdev_prop_set_uint32(priv, "num-cpu", s->num_cpu);
qdev_init_nofail(priv);
s->priv = SYS_BUS_DEVICE(priv);
- sysbus_pass_irq(dev, s->priv);
+ sysbus_pass_irq(sbd, s->priv);
for (i = 0; i < 32; i++) {
s->cpuic[i] = qdev_get_gpio_in(priv, i);
}
@@ -220,8 +226,8 @@ static int realview_mpcore_init(SysBusDevice *dev)
s->rvic[n][i] = qdev_get_gpio_in(gic, i);
}
}
- qdev_init_gpio_in(&dev->qdev, mpcore_rirq_set_irq, 64);
- sysbus_init_mmio(dev, sysbus_mmio_get_region(s->priv, 0));
+ qdev_init_gpio_in(dev, mpcore_rirq_set_irq, 64);
+ sysbus_init_mmio(sbd, sysbus_mmio_get_region(s->priv, 0));
return 0;
}
@@ -240,7 +246,7 @@ static void mpcore_rirq_class_init(ObjectClass *klass, void
*data)
}
static const TypeInfo mpcore_rirq_info = {
- .name = "realview_mpcore",
+ .name = TYPE_REALVIEW_MPCORE_RIRQ,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(mpcore_rirq_state),
.class_init = mpcore_rirq_class_init,
--
1.8.1.4
- [Qemu-devel] [PULL for-1.6 000/173] QOM devices patch queue 2013-07-29, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 001/173] fdc: Fix inheritence for SUNW,fdtwo, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 002/173] ide/piix: QOM casting sweep, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 004/173] cpu/a9mpcore: QOM casting cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 005/173] timer/arm_mptimer: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 003/173] ide: Introduce abstract QOM type for PCIIDEState, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 007/173] arm11mpcore: QOM cast cleanups for ARM11MPCorePriveState, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 008/173] arm11mpcore: QOM cast cleanups for mpcore_rirq_state,
Andreas Färber <=
- [Qemu-devel] [PULL 009/173] pci-bridge: Turn PCIBridge into abstract QOM type, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 006/173] cpu/a15mpcore: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 010/173] pci-bridge-dev: QOM parent field cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 011/173] pci-bridge/i82801b11: Rename parent field, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 012/173] pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 013/173] etraxfs_ser: QOM cast cleanups, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 016/173] cs4231: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 014/173] xilinx_uartlite: Rename xlx_uartlite to XilinxUARTLite, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 015/173] xilinx_uartlite: QOM cast cleanups, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 017/173] audio/marvell_88w8618: QOM cast cleanup, Andreas Färber, 2013/07/29