[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-next for-1.6 23/29] strongarm: QOM'ify StrongARM
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-next for-1.6 23/29] strongarm: QOM'ify StrongARMPICState |
Date: |
Wed, 24 Jul 2013 09:48:18 +0200 |
Signed-off-by: Andreas Färber <address@hidden>
---
hw/arm/strongarm.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c
index feaaf45..457f9c7 100644
--- a/hw/arm/strongarm.c
+++ b/hw/arm/strongarm.c
@@ -70,8 +70,14 @@ static struct {
};
/* Interrupt Controller */
-typedef struct {
- SysBusDevice busdev;
+
+#define TYPE_STRONGARM_PIC "strongarm_pic"
+#define STRONGARM_PIC(obj) \
+ OBJECT_CHECK(StrongARMPICState, (obj), TYPE_STRONGARM_PIC)
+
+typedef struct StrongARMPICState {
+ SysBusDevice parent_obj;
+
MemoryRegion iomem;
qemu_irq irq;
qemu_irq fiq;
@@ -168,16 +174,17 @@ static const MemoryRegionOps strongarm_pic_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static int strongarm_pic_initfn(SysBusDevice *dev)
+static int strongarm_pic_initfn(SysBusDevice *sbd)
{
- StrongARMPICState *s = FROM_SYSBUS(StrongARMPICState, dev);
+ DeviceState *dev = DEVICE(sbd);
+ StrongARMPICState *s = STRONGARM_PIC(dev);
- qdev_init_gpio_in(&dev->qdev, strongarm_pic_set_irq, SA_PIC_SRCS);
+ qdev_init_gpio_in(dev, strongarm_pic_set_irq, SA_PIC_SRCS);
memory_region_init_io(&s->iomem, OBJECT(s), &strongarm_pic_ops, s,
"pic", 0x1000);
- sysbus_init_mmio(dev, &s->iomem);
- sysbus_init_irq(dev, &s->irq);
- sysbus_init_irq(dev, &s->fiq);
+ sysbus_init_mmio(sbd, &s->iomem);
+ sysbus_init_irq(sbd, &s->irq);
+ sysbus_init_irq(sbd, &s->fiq);
return 0;
}
@@ -214,7 +221,7 @@ static void strongarm_pic_class_init(ObjectClass *klass,
void *data)
}
static const TypeInfo strongarm_pic_info = {
- .name = "strongarm_pic",
+ .name = TYPE_STRONGARM_PIC,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(StrongARMPICState),
.class_init = strongarm_pic_class_init,
--
1.8.1.4
- [Qemu-devel] [PATCH qom-next for-1.6 11/29] musicpal: QOM'ify musicpal_gpio_state, (continued)
- [Qemu-devel] [PATCH qom-next for-1.6 11/29] musicpal: QOM'ify musicpal_gpio_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 13/29] pxa2xx: QOM'ify PXA2xxSSPState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 14/29] pxa2xx: QOM'ify PXA2xxRTCState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 15/29] pxa2xx: QOM'ify PXA2xxI2CState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 16/29] pxa2xx_gpio: QOM'ify PXA2xxGPIOInfo, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 18/29] spitz: QOM'ify SLNANDState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 17/29] pxa2xx_pic: QOM'ify PXA2xxPICState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 19/29] spitz: QOM'ify SpitzKeyboardState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 20/29] stellaris: QOM'ify gptm_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 22/29] stellaris: QOM'ify stellaris_adc_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 23/29] strongarm: QOM'ify StrongARMPICState,
Andreas Färber <=
- [Qemu-devel] [PATCH qom-next for-1.6 24/29] strongarm: QOM'ify StrongARMRTCState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 21/29] stellaris: QOM'ify stellaris_i2c_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 25/29] strongarm: QOM'ify StrongARMGPIOInfo, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 26/29] strongarm: QOM'ify StrongARMPPCInfo, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 27/29] strongarm: QOM'ify StrongARMUARTState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 28/29] strongarm: QOM'ify StrongARMSSPState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 29/29] versatilepb: QOM'ify vpb_sic_state, Andreas Färber, 2013/07/24