Pass the previously returned IRQ back to arm_get_next_irq() so that

the implementation can guarantee forward progress in the event of
a stuck interrupt or interrupt storm. This is especially critical
for fast interrupt handlers, as they can cause a hard hang in that
case. When first called, arm_get_next_irq() is passed -1.

Obtained from:	Juniper Networks, Inc.
This commit is contained in:
Marcel Moolenaar 2009-06-09 18:18:41 +00:00
parent 7d34f41a7a
commit 272489fe59
9 changed files with 10 additions and 10 deletions

View File

@ -120,7 +120,8 @@ arm_handler_execute(struct trapframe *frame, int irqnb)
int i;
PCPU_INC(cnt.v_intr);
while ((i = arm_get_next_irq()) != -1) {
i = -1;
while ((i = arm_get_next_irq(i)) != -1) {
intrcnt[intrcnt_tab[i]]++;
event = intr_events[i];
if (intr_event_handle(event, frame) != 0) {

View File

@ -702,9 +702,8 @@ arm_mask_irq(uintptr_t nb)
}
int
arm_get_next_irq()
arm_get_next_irq(int last __unused)
{
int status;
int irq;

View File

@ -56,7 +56,7 @@
#include <machine/psl.h>
int arm_get_next_irq(void);
int arm_get_next_irq(int);
void arm_mask_irq(uintptr_t);
void arm_unmask_irq(uintptr_t);
void arm_setup_irqhandler(const char *, int (*)(void*), void (*)(void*),

View File

@ -137,7 +137,7 @@ static devclass_t mv_ic_devclass;
DRIVER_MODULE(ic, mbus, mv_ic_driver, mv_ic_devclass, 0, 0);
int
arm_get_next_irq(void)
arm_get_next_irq(int last __unused)
{
int irq;

View File

@ -108,7 +108,7 @@ static uint32_t sa11x0_irq_mask = 0xfffffff;
extern vm_offset_t saipic_base;
int
arm_get_next_irq()
arm_get_next_irq(int last __unused)
{
int irq;

View File

@ -240,7 +240,7 @@ i80321_iintsrc_read(void)
}
int
arm_get_next_irq()
arm_get_next_irq(int last __unused)
{
int irq;

View File

@ -295,7 +295,7 @@ arm_unmask_irq(uintptr_t nb)
}
int
arm_get_next_irq(void)
arm_get_next_irq(int last __unused)
{
uint32_t val;
val = intpnd0_read() & intr_enabled0;

View File

@ -202,7 +202,7 @@ ixp435_irq_read(void)
}
int
arm_get_next_irq(void)
arm_get_next_irq(int last __unused)
{
uint32_t irq;

View File

@ -128,7 +128,7 @@ static devclass_t pxa_icu_devclass;
DRIVER_MODULE(pxaicu, pxa, pxa_icu_driver, pxa_icu_devclass, 0, 0);
int
arm_get_next_irq()
arm_get_next_irq(int last __unused)
{
int irq;