]> Git Repo - qemu.git/commitdiff
hw/intc/arm_gicv3: Move irq lines into GICv3CPUState structure
authorPeter Maydell <[email protected]>
Fri, 17 Jun 2016 14:23:46 +0000 (15:23 +0100)
committerPeter Maydell <[email protected]>
Fri, 17 Jun 2016 14:23:51 +0000 (15:23 +0100)
Move the GICv3 parent_irq and parent_fiq pointers into the
GICv3CPUState structure rather than giving them their own array.
This will make it easy to assert the IRQ and FIQ lines for a
particular CPU interface without having to know or calculate
the CPU index for the GICv3CPUState we are working on.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Shannon Zhao <[email protected]>
Tested-by: Shannon Zhao <[email protected]>
Message-id: 1465915112[email protected]

hw/intc/arm_gicv3_common.c
include/hw/intc/arm_gicv3_common.h

index bf6949f8cd8f05d0cb712a1d6ce8411a01dc8daf..1557833173c8f96b9818692d96832435b60fba00 100644 (file)
@@ -72,14 +72,11 @@ void gicv3_init_irqs_and_mmio(GICv3State *s, qemu_irq_handler handler,
     i = s->num_irq - GIC_INTERNAL + GIC_INTERNAL * s->num_cpu;
     qdev_init_gpio_in(DEVICE(s), handler, i);
 
-    s->parent_irq = g_malloc(s->num_cpu * sizeof(qemu_irq));
-    s->parent_fiq = g_malloc(s->num_cpu * sizeof(qemu_irq));
-
     for (i = 0; i < s->num_cpu; i++) {
-        sysbus_init_irq(sbd, &s->parent_irq[i]);
+        sysbus_init_irq(sbd, &s->cpu[i].parent_irq);
     }
     for (i = 0; i < s->num_cpu; i++) {
-        sysbus_init_irq(sbd, &s->parent_fiq[i]);
+        sysbus_init_irq(sbd, &s->cpu[i].parent_fiq);
     }
 
     memory_region_init_io(&s->iomem_dist, OBJECT(s), ops, s,
index bd364a7e0202e533cb0221c0698990b62a7c2fd3..cc6ac74e63cebaece9777d6ce31832603afd284a 100644 (file)
@@ -134,6 +134,8 @@ typedef struct GICv3CPUState GICv3CPUState;
 struct GICv3CPUState {
     GICv3State *gic;
     CPUState *cpu;
+    qemu_irq parent_irq;
+    qemu_irq parent_fiq;
 
     /* Redistributor */
     uint32_t level;                  /* Current IRQ level */
@@ -168,9 +170,6 @@ struct GICv3State {
     SysBusDevice parent_obj;
     /*< public >*/
 
-    qemu_irq *parent_irq;
-    qemu_irq *parent_fiq;
-
     MemoryRegion iomem_dist; /* Distributor */
     MemoryRegion iomem_redist; /* Redistributors */
 
This page took 0.029813 seconds and 4 git commands to generate.