aboutsummaryrefslogtreecommitdiff
path: root/hw/omap.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-07-31 01:42:29 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-07-31 01:42:29 +0000
commitcfa0b71dd84977b9378a9100b759739ef9220ac6 (patch)
tree6cf037fcbd9ab01b734805ad1357d6f66ae51202 /hw/omap.c
parent724d3a8f2932f90e3527752f4b59f3607ceeb863 (diff)
Fix OMAP pic handling of simultaneous interrupts.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3095 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/omap.c')
-rw-r--r--hw/omap.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/hw/omap.c b/hw/omap.c
index fe4f9c40fd..0684a2de28 100644
--- a/hw/omap.c
+++ b/hw/omap.c
@@ -70,16 +70,20 @@ struct omap_intr_handler_s {
static void omap_inth_update(struct omap_intr_handler_s *s)
{
- uint32_t irq = s->new_irq_agr & s->irqs & ~s->mask & ~s->fiq;
- uint32_t fiq = s->new_fiq_agr & s->irqs & ~s->mask & s->fiq;
+ uint32_t irq = s->irqs & ~s->mask & ~s->fiq;
+ uint32_t fiq = s->irqs & ~s->mask & s->fiq;
- qemu_set_irq(s->parent_pic[ARM_PIC_CPU_IRQ], irq);
- if (irq)
- s->new_irq_agr = 0;
+ if (s->new_irq_agr || !irq) {
+ qemu_set_irq(s->parent_pic[ARM_PIC_CPU_IRQ], irq);
+ if (irq)
+ s->new_irq_agr = 0;
+ }
- qemu_set_irq(s->parent_pic[ARM_PIC_CPU_FIQ], fiq);
- if (fiq)
- s->new_fiq_agr = 0;
+ if (s->new_fiq_agr || !irq) {
+ qemu_set_irq(s->parent_pic[ARM_PIC_CPU_FIQ], fiq);
+ if (fiq)
+ s->new_fiq_agr = 0;
+ }
}
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)
if (req) {
rise = ~ih->irqs & (1 << irq);
ih->irqs |= rise;
- ih->stats[irq] ++;
+ ih->stats[irq] += !!rise;
} else {
rise = ih->sens_edge & ih->irqs & (1 << irq);
ih->irqs &= ~rise;