arm_gic: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
3e5dd364d9
commit
285b4432da
|
@ -639,6 +639,7 @@ static const MemoryRegionOps gic_cpu_ops = {
|
||||||
|
|
||||||
void gic_init_irqs_and_distributor(GICState *s, int num_irq)
|
void gic_init_irqs_and_distributor(GICState *s, int num_irq)
|
||||||
{
|
{
|
||||||
|
SysBusDevice *sbd = SYS_BUS_DEVICE(s);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = s->num_irq - GIC_INTERNAL;
|
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) {
|
if (s->revision != REV_NVIC) {
|
||||||
i += (GIC_INTERNAL * s->num_cpu);
|
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++) {
|
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,
|
memory_region_init_io(&s->iomem, OBJECT(s), &gic_dist_ops, s,
|
||||||
"gic_dist", 0x1000);
|
"gic_dist", 0x1000);
|
||||||
|
|
|
@ -110,7 +110,7 @@ static void arm_gic_common_realize(DeviceState *dev, Error **errp)
|
||||||
|
|
||||||
static void arm_gic_common_reset(DeviceState *dev)
|
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;
|
int i;
|
||||||
memset(s->irq_state, 0, GIC_MAXIRQ * sizeof(gic_irq_state));
|
memset(s->irq_state, 0, GIC_MAXIRQ * sizeof(gic_irq_state));
|
||||||
for (i = 0 ; i < s->num_cpu; i++) {
|
for (i = 0 ; i < s->num_cpu; i++) {
|
||||||
|
|
|
@ -70,7 +70,10 @@ typedef struct gic_irq_state {
|
||||||
} gic_irq_state;
|
} gic_irq_state;
|
||||||
|
|
||||||
typedef struct GICState {
|
typedef struct GICState {
|
||||||
SysBusDevice busdev;
|
/*< private >*/
|
||||||
|
SysBusDevice parent_obj;
|
||||||
|
/*< public >*/
|
||||||
|
|
||||||
qemu_irq parent_irq[NCPU];
|
qemu_irq parent_irq[NCPU];
|
||||||
bool enabled;
|
bool enabled;
|
||||||
bool cpu_enabled[NCPU];
|
bool cpu_enabled[NCPU];
|
||||||
|
|
Loading…
Reference in a new issue