[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-next for-1.6 17/29] pxa2xx_pic: QOM'ify PXA2xxPI
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-next for-1.6 17/29] pxa2xx_pic: QOM'ify PXA2xxPICState |
Date: |
Wed, 24 Jul 2013 09:48:12 +0200 |
Signed-off-by: Andreas Färber <address@hidden>
---
hw/arm/pxa2xx_pic.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c
index 8929b6d..46d337c 100644
--- a/hw/arm/pxa2xx_pic.c
+++ b/hw/arm/pxa2xx_pic.c
@@ -31,8 +31,15 @@
#define PXA2XX_PIC_SRCS 40
+#define TYPE_PXA2XX_PIC "pxa2xx_pic"
+#define PXA2XX_PIC(obj) \
+ OBJECT_CHECK(PXA2xxPICState, (obj), TYPE_PXA2XX_PIC)
+
typedef struct {
- SysBusDevice busdev;
+ /*< private >*/
+ SysBusDevice parent_obj;
+ /*< public >*/
+
MemoryRegion iomem;
ARMCPU *cpu;
uint32_t int_enabled[2];
@@ -260,9 +267,8 @@ static int pxa2xx_pic_post_load(void *opaque, int
version_id)
DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
{
- CPUARMState *env = &cpu->env;
- DeviceState *dev = qdev_create(NULL, "pxa2xx_pic");
- PXA2xxPICState *s = FROM_SYSBUS(PXA2xxPICState, SYS_BUS_DEVICE(dev));
+ DeviceState *dev = qdev_create(NULL, TYPE_PXA2XX_PIC);
+ PXA2xxPICState *s = PXA2XX_PIC(dev);
s->cpu = cpu;
@@ -284,7 +290,7 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
/* Enable IC coprocessor access. */
- define_arm_cp_regs_with_opaque(arm_env_get_cpu(env), pxa_pic_cp_reginfo,
s);
+ define_arm_cp_regs_with_opaque(cpu, pxa_pic_cp_reginfo, s);
return dev;
}
@@ -321,7 +327,7 @@ static void pxa2xx_pic_class_init(ObjectClass *klass, void
*data)
}
static const TypeInfo pxa2xx_pic_info = {
- .name = "pxa2xx_pic",
+ .name = TYPE_PXA2XX_PIC,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PXA2xxPICState),
.class_init = pxa2xx_pic_class_init,
--
1.8.1.4
- [Qemu-devel] [PATCH qom-next for-1.6 09/29] musicpal: QOM'ify mv88w8618_pit_state, (continued)
- [Qemu-devel] [PATCH qom-next for-1.6 09/29] musicpal: QOM'ify mv88w8618_pit_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 10/29] musicpal: QOM'ify mv88w8618_flashcfg, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 12/29] musicpal: QOM'ify musicpal_key_state, Andreas Färber, 2013/07/24
- [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 <=
- [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, 2013/07/24
- [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