diff options
Diffstat (limited to 'hw/intc')
| -rw-r--r-- | hw/intc/apic.c | 2 | ||||
| -rw-r--r-- | hw/intc/apic_common.c | 2 | ||||
| -rw-r--r-- | hw/intc/arm_gicv2m.c | 2 | ||||
| -rw-r--r-- | hw/intc/arm_gicv3_its_kvm.c | 2 | ||||
| -rw-r--r-- | hw/intc/ibex_plic.c | 21 | ||||
| -rw-r--r-- | hw/intc/ioapic.c | 2 | ||||
| -rw-r--r-- | hw/intc/ioapic_common.c | 2 | ||||
| -rw-r--r-- | hw/intc/lm32_pic.c | 2 | ||||
| -rw-r--r-- | hw/intc/xics_pnv.c | 2 |
9 files changed, 26 insertions, 11 deletions
diff --git a/hw/intc/apic.c b/hw/intc/apic.c index b6a05e5439..1c8be40d8b 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index 81addd6390..502e94effc 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -7,7 +7,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/intc/arm_gicv2m.c b/hw/intc/arm_gicv2m.c index 596fa66648..d564b857eb 100644 --- a/hw/intc/arm_gicv2m.c +++ b/hw/intc/arm_gicv2m.c @@ -8,7 +8,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index 4ee9875ecc..057cb53f13 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -7,7 +7,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/intc/ibex_plic.c b/hw/intc/ibex_plic.c index 235e6b88ff..341c9db405 100644 --- a/hw/intc/ibex_plic.c +++ b/hw/intc/ibex_plic.c @@ -45,9 +45,10 @@ static void ibex_plic_irqs_set_pending(IbexPlicState *s, int irq, bool level) if (s->claimed[pending_num] & 1 << (irq % 32)) { /* - * The interrupt has been claimed, but not compelted. + * The interrupt has been claimed, but not completed. * The pending bit can't be set. */ + s->hidden_pending[pending_num] |= level << (irq % 32); return; } @@ -133,7 +134,7 @@ static uint64_t ibex_plic_read(void *opaque, hwaddr addr, int pending_num = s->claim / 32; s->pending[pending_num] &= ~(1 << (s->claim % 32)); - /* Set the interrupt as claimed, but not compelted */ + /* Set the interrupt as claimed, but not completed */ s->claimed[pending_num] |= 1 << (s->claim % 32); /* Return the current claimed interrupt */ @@ -176,8 +177,21 @@ static void ibex_plic_write(void *opaque, hwaddr addr, s->claim = 0; } if (s->claimed[value / 32] & 1 << (value % 32)) { + int pending_num = value / 32; + /* This value was already claimed, clear it. */ - s->claimed[value / 32] &= ~(1 << (value % 32)); + s->claimed[pending_num] &= ~(1 << (value % 32)); + + if (s->hidden_pending[pending_num] & (1 << (value % 32))) { + /* + * If the bit in hidden_pending is set then that means we + * received an interrupt between claiming and completing + * the interrupt that hasn't since been de-asserted. + * On hardware this would trigger an interrupt, so let's + * trigger one here as well. + */ + s->pending[pending_num] |= 1 << (value % 32); + } } } @@ -239,6 +253,7 @@ static void ibex_plic_realize(DeviceState *dev, Error **errp) int i; s->pending = g_new0(uint32_t, s->pending_num); + s->hidden_pending = g_new0(uint32_t, s->pending_num); s->claimed = g_new0(uint32_t, s->pending_num); s->source = g_new0(uint32_t, s->source_num); s->priority = g_new0(uint32_t, s->priority_num); diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index bca71b5934..a3021a4de1 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -9,7 +9,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c index 5538b5b86e..3cccfc1556 100644 --- a/hw/intc/ioapic_common.c +++ b/hw/intc/ioapic_common.c @@ -8,7 +8,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/intc/lm32_pic.c b/hw/intc/lm32_pic.c index 0c48a9cd85..991a90bc99 100644 --- a/hw/intc/lm32_pic.c +++ b/hw/intc/lm32_pic.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/intc/xics_pnv.c b/hw/intc/xics_pnv.c index 35f3811264..753c067f17 100644 --- a/hw/intc/xics_pnv.c +++ b/hw/intc/xics_pnv.c @@ -5,7 +5,7 @@ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 of + * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but |