only print 1 every 1000 spurious interrupts (per interrupt).

This commit is contained in:
Ben Gras 2010-03-22 13:55:51 +00:00
parent 12ef495cac
commit 4b2310a7ee

View File

@ -13,6 +13,8 @@
* disable_irq: disable hook for IRQ. * disable_irq: disable hook for IRQ.
*/ */
#include <assert.h>
#include "kernel.h" #include "kernel.h"
#include "proc.h" #include "proc.h"
#include "archconst.h" #include "archconst.h"
@ -117,13 +119,18 @@ PUBLIC void irq_handle(int irq)
irq_hook_t * hook; irq_hook_t * hook;
/* here we need not to get this IRQ until all the handlers had a say */ /* here we need not to get this IRQ until all the handlers had a say */
assert(irq >= 0 && irq < NR_IRQ_VECTORS);
hw_intr_mask(irq); hw_intr_mask(irq);
hook = irq_handlers[irq]; hook = irq_handlers[irq];
/* Sanity check. */ /* Check for spurious interrupts. */
if(hook == NULL) { if(hook == NULL) {
printf("%s: irq_handle:no handler registered, masking the IRQ...\n", static int nspurious[NR_IRQ_VECTORS];
__FILE__); nspurious[irq]++;
if(nspurious[irq] == 1 || !(nspurious[irq] % 1000)) {
printf("irq_handle: spurious irq %d (count: %d); keeping masked\n",
irq, nspurious[irq]);
}
return; return;
} }