qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [Qemu-devel] [PATCH v2 07/22] hw/intc/arm_gicv3: Move irq


From: Shannon Zhao
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH v2 07/22] hw/intc/arm_gicv3: Move irq lines into GICv3CPUState structure
Date: Tue, 7 Jun 2016 16:33:19 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0


On 2016/5/26 22:55, Peter Maydell wrote:
> 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 <address@hidden>

Reviewed-by: Shannon Zhao <address@hidden>

> ---
>  hw/intc/arm_gicv3_common.c         | 7 ++-----
>  include/hw/intc/arm_gicv3_common.h | 5 ++---
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
> index bf6949f..1557833 100644
> --- a/hw/intc/arm_gicv3_common.c
> +++ b/hw/intc/arm_gicv3_common.c
> @@ -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,
> diff --git a/include/hw/intc/arm_gicv3_common.h 
> b/include/hw/intc/arm_gicv3_common.h
> index 6d4327b..f01b616 100644
> --- a/include/hw/intc/arm_gicv3_common.h
> +++ b/include/hw/intc/arm_gicv3_common.h
> @@ -135,6 +135,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 */
> @@ -169,9 +171,6 @@ struct GICv3State {
>      SysBusDevice parent_obj;
>      /*< public >*/
>  
> -    qemu_irq *parent_irq;
> -    qemu_irq *parent_fiq;
> -
>      MemoryRegion iomem_dist; /* Distributor */
>      MemoryRegion iomem_redist; /* Redistributors */
>  
> 

-- 
Shannon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]