@@ -630,7 +630,7 @@ void gic_dump_info(struct vcpu *v)
list_for_each_entry ( p, &v->arch.vgic.inflight_irqs, inflight )
{
- printk("Inflight irq=%d lr=%u\n", p->irq, p->lr);
+ printk("Inflight irq=%u lr=%u\n", p->irq, p->lr);
}
list_for_each_entry( p, &v->arch.vgic.lr_pending, lr_queue )
@@ -61,6 +61,13 @@ struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq)
return vgic_get_rank(v, rank);
}
+static void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq)
+{
+ INIT_LIST_HEAD(&p->inflight);
+ INIT_LIST_HEAD(&p->lr_queue);
+ p->irq = virq;
+}
+
int domain_vgic_init(struct domain *d)
{
int i;
@@ -101,10 +108,8 @@ int domain_vgic_init(struct domain *d)
return -ENOMEM;
for (i=0; i<d->arch.vgic.nr_spis; i++)
- {
- INIT_LIST_HEAD(&d->arch.vgic.pending_irqs[i].inflight);
- INIT_LIST_HEAD(&d->arch.vgic.pending_irqs[i].lr_queue);
- }
+ vgic_init_pending_irq(&d->arch.vgic.pending_irqs[i], i + 32);
+
for (i=0; i<DOMAIN_NR_RANKS(d); i++)
spin_lock_init(&d->arch.vgic.shared_irqs[i].lock);
@@ -148,10 +153,7 @@ int vcpu_vgic_init(struct vcpu *v)
memset(&v->arch.vgic.pending_irqs, 0, sizeof(v->arch.vgic.pending_irqs));
for (i = 0; i < 32; i++)
- {
- INIT_LIST_HEAD(&v->arch.vgic.pending_irqs[i].inflight);
- INIT_LIST_HEAD(&v->arch.vgic.pending_irqs[i].lr_queue);
- }
+ vgic_init_pending_irq(&v->arch.vgic.pending_irqs[i], i);
INIT_LIST_HEAD(&v->arch.vgic.inflight_irqs);
INIT_LIST_HEAD(&v->arch.vgic.lr_pending);
@@ -409,7 +411,6 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
goto out;
}
- n->irq = irq;
n->priority = priority;
/* the irq is enabled */
@@ -67,7 +67,7 @@ struct pending_irq
#define GIC_IRQ_GUEST_MIGRATING 4
unsigned long status;
struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
- int irq;
+ unsigned int irq;
#define GIC_INVALID_LR ~(uint8_t)0
uint8_t lr;
uint8_t priority;