Commit cfa0b71dd84977b9378a9100b759739ef9220ac6

Authored by balrog
1 parent 724d3a8f

Fix OMAP pic handling of simultaneous interrupts.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3095 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 13 additions and 9 deletions
hw/omap.c
... ... @@ -70,16 +70,20 @@ struct omap_intr_handler_s {
70 70  
71 71 static void omap_inth_update(struct omap_intr_handler_s *s)
72 72 {
73   - uint32_t irq = s->new_irq_agr & s->irqs & ~s->mask & ~s->fiq;
74   - uint32_t fiq = s->new_fiq_agr & s->irqs & ~s->mask & s->fiq;
  73 + uint32_t irq = s->irqs & ~s->mask & ~s->fiq;
  74 + uint32_t fiq = s->irqs & ~s->mask & s->fiq;
75 75  
76   - qemu_set_irq(s->parent_pic[ARM_PIC_CPU_IRQ], irq);
77   - if (irq)
78   - s->new_irq_agr = 0;
  76 + if (s->new_irq_agr || !irq) {
  77 + qemu_set_irq(s->parent_pic[ARM_PIC_CPU_IRQ], irq);
  78 + if (irq)
  79 + s->new_irq_agr = 0;
  80 + }
79 81  
80   - qemu_set_irq(s->parent_pic[ARM_PIC_CPU_FIQ], fiq);
81   - if (fiq)
82   - s->new_fiq_agr = 0;
  82 + if (s->new_fiq_agr || !irq) {
  83 + qemu_set_irq(s->parent_pic[ARM_PIC_CPU_FIQ], fiq);
  84 + if (fiq)
  85 + s->new_fiq_agr = 0;
  86 + }
83 87 }
84 88  
85 89 static void omap_inth_sir_update(struct omap_intr_handler_s *s)
... ... @@ -124,7 +128,7 @@ static void omap_set_intr(void *opaque, int irq, int req)
124 128 if (req) {
125 129 rise = ~ih->irqs & (1 << irq);
126 130 ih->irqs |= rise;
127   - ih->stats[irq] ++;
  131 + ih->stats[irq] += !!rise;
128 132 } else {
129 133 rise = ih->sens_edge & ih->irqs & (1 << irq);
130 134 ih->irqs &= ~rise;
... ...