diff options
-rw-r--r-- | hw/intc/arm_gic.c | 5 | ||||
-rw-r--r-- | hw/intc/arm_gic_common.c | 2 | ||||
-rw-r--r-- | hw/intc/gic_internal.h | 5 |
3 files changed, 8 insertions, 4 deletions
diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 8e340049c3..d431b7a881 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -639,6 +639,7 @@ static const MemoryRegionOps gic_cpu_ops = { void gic_init_irqs_and_distributor(GICState *s, int num_irq) { + SysBusDevice *sbd = SYS_BUS_DEVICE(s); int i; i = s->num_irq - GIC_INTERNAL; @@ -652,9 +653,9 @@ void gic_init_irqs_and_distributor(GICState *s, int num_irq) if (s->revision != REV_NVIC) { i += (GIC_INTERNAL * s->num_cpu); } - qdev_init_gpio_in(&s->busdev.qdev, gic_set_irq, i); + qdev_init_gpio_in(DEVICE(s), gic_set_irq, i); for (i = 0; i < NUM_CPU(s); i++) { - sysbus_init_irq(&s->busdev, &s->parent_irq[i]); + sysbus_init_irq(sbd, &s->parent_irq[i]); } memory_region_init_io(&s->iomem, OBJECT(s), &gic_dist_ops, s, "gic_dist", 0x1000); diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c index 08560f23a3..709b5c2984 100644 --- a/hw/intc/arm_gic_common.c +++ b/hw/intc/arm_gic_common.c @@ -110,7 +110,7 @@ static void arm_gic_common_realize(DeviceState *dev, Error **errp) static void arm_gic_common_reset(DeviceState *dev) { - GICState *s = FROM_SYSBUS(GICState, SYS_BUS_DEVICE(dev)); + GICState *s = ARM_GIC_COMMON(dev); int i; memset(s->irq_state, 0, GIC_MAXIRQ * sizeof(gic_irq_state)); for (i = 0 ; i < s->num_cpu; i++) { diff --git a/hw/intc/gic_internal.h b/hw/intc/gic_internal.h index 99a3bc362b..14264373fe 100644 --- a/hw/intc/gic_internal.h +++ b/hw/intc/gic_internal.h @@ -70,7 +70,10 @@ typedef struct gic_irq_state { } gic_irq_state; typedef struct GICState { - SysBusDevice busdev; + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ + qemu_irq parent_irq[NCPU]; bool enabled; bool cpu_enabled[NCPU]; |