[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 006/173] cpu/a15mpcore: QOM cast cleanup
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 006/173] cpu/a15mpcore: QOM cast cleanup |
Date: |
Mon, 29 Jul 2013 21:17:43 +0200 |
From: Andreas Färber <address@hidden>
Introduce type constant and cast macro and rename A15MPPrivState::busdev
field to parent_obj to enforce its use.
Prepares for QOM realize.
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/cpu/a15mpcore.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index c736257..4f37964 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -23,8 +23,15 @@
/* A15MP private memory region. */
+#define TYPE_A15MPCORE_PRIV "a15mpcore_priv"
+#define A15MPCORE_PRIV(obj) \
+ OBJECT_CHECK(A15MPPrivState, (obj), TYPE_A15MPCORE_PRIV)
+
typedef struct A15MPPrivState {
- SysBusDevice busdev;
+ /*< private >*/
+ SysBusDevice parent_obj;
+ /*< public >*/
+
uint32_t num_cpu;
uint32_t num_irq;
MemoryRegion container;
@@ -39,7 +46,7 @@ static void a15mp_priv_set_irq(void *opaque, int irq, int
level)
static int a15mp_priv_init(SysBusDevice *dev)
{
- A15MPPrivState *s = FROM_SYSBUS(A15MPPrivState, dev);
+ A15MPPrivState *s = A15MPCORE_PRIV(dev);
SysBusDevice *busdev;
const char *gictype = "arm_gic";
@@ -58,7 +65,7 @@ static int a15mp_priv_init(SysBusDevice *dev)
sysbus_pass_irq(dev, busdev);
/* Pass through inbound GPIO lines to the GIC */
- qdev_init_gpio_in(&s->busdev.qdev, a15mp_priv_set_irq, s->num_irq - 32);
+ qdev_init_gpio_in(DEVICE(dev), a15mp_priv_set_irq, s->num_irq - 32);
/* Memory map (addresses are offsets from PERIPHBASE):
* 0x0000-0x0fff -- reserved
@@ -101,7 +108,7 @@ static void a15mp_priv_class_init(ObjectClass *klass, void
*data)
}
static const TypeInfo a15mp_priv_info = {
- .name = "a15mpcore_priv",
+ .name = TYPE_A15MPCORE_PRIV,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(A15MPPrivState),
.class_init = a15mp_priv_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, 2013/07/29
- [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 <=
- [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
- [Qemu-devel] [PULL 018/173] milkymist-ac97: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 019/173] pl041: Rename pl041_state to PL041State, Andreas Färber, 2013/07/29