diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -87,8 +87,6 @@ #include "pic_if.h" -#define MAX_STRAY_LOG 5 - static MALLOC_DEFINE(M_INTR, "intr", "interrupt handler data"); struct powerpc_intr { @@ -660,11 +658,11 @@ stray: stray_count++; - if (stray_count <= MAX_STRAY_LOG) { + if (stray_count <= INTR_STRAY_LOG_MAX) { printf("stray irq %d\n", i ? i->irq : -1); - if (stray_count >= MAX_STRAY_LOG) { + if (stray_count >= INTR_STRAY_LOG_MAX) { printf("got %d stray interrupts, not logging anymore\n", - MAX_STRAY_LOG); + INTR_STRAY_LOG_MAX); } } if (i != NULL) diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h --- a/sys/sys/interrupt.h +++ b/sys/sys/interrupt.h @@ -148,6 +148,9 @@ #define SWI_TQ 6 #define SWI_TQ_GIANT 6 +/* Maximum number of stray interrupts to log */ +#define INTR_STRAY_LOG_MAX 5 + struct proc; extern struct intr_event *clk_intr_event; diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c --- a/sys/x86/x86/intr_machdep.c +++ b/sys/x86/x86/intr_machdep.c @@ -72,8 +72,6 @@ #include -#define MAX_STRAY_LOG 5 - typedef void (*mask_fn)(void *); static int intrcnt_index; @@ -355,9 +353,9 @@ if (intr_event_handle(ie, frame) != 0) { isrc->is_pic->pic_disable_source(isrc, PIC_EOI); (*isrc->is_straycount)++; - if (*isrc->is_straycount < MAX_STRAY_LOG) + if (*isrc->is_straycount < INTR_STRAY_LOG_MAX) log(LOG_ERR, "stray irq%d\n", vector); - else if (*isrc->is_straycount == MAX_STRAY_LOG) + else if (*isrc->is_straycount == INTR_STRAY_LOG_MAX) log(LOG_CRIT, "too many stray irq %d's: not logging anymore\n", vector);