]> Zhao Yanbai Git Server - minix.git/commitdiff
spurious and error interrupt apic handlers
authorTomas Hruby <tom@minix3.org>
Tue, 19 Oct 2010 17:07:21 +0000 (17:07 +0000)
committerTomas Hruby <tom@minix3.org>
Tue, 19 Oct 2010 17:07:21 +0000 (17:07 +0000)
- fixed spurious and error interrupt handlers

- not to hog the system the warning isn't reported every time, just
  once every 100 times, similarly for the spurious PIC interrupts

kernel/arch/i386/apic.c
kernel/arch/i386/apic_asm.S
kernel/arch/i386/apic_asm.h

index b4358e467f0a8efc9d0b60cb48bbac220ce71bf8..b5246f425279ba665015432721a73a6cae0bd523 100644 (file)
@@ -715,16 +715,23 @@ PUBLIC int lapic_enable(unsigned cpu)
        return 1;
 }
 
-PRIVATE void apic_spurios_intr(void)
+PUBLIC void apic_spurios_intr_handler(void)
 {
-       printf("WARNING spurious interrupt\n");
-       for(;;);
+       static unsigned x;
+
+       x++;
+       if (x == 1 || (x % 100) == 0)
+               printf("WARNING spurious interrupt(s) %d on cpu %d\n", x, cpuid);
 }
 
-PRIVATE void apic_error_intr(void)
+PUBLIC void apic_error_intr_handler(void)
 {
-       printf("WARNING local apic error interrupt\n");
-       for(;;);
+       static unsigned x;
+
+       x++;
+       if (x == 1 || (x % 100) == 0)
+               printf("WARNING apic error (0x%x) interrupt(s) %d on cpu %d\n",
+                               lapic_errstatus(), x, cpuid);
 }
 
 PRIVATE struct gate_table_s gate_table_ioapic[] = {
index 8dca5b7e328807e9b8bd687a8668a89c4e00d72c..ec51950ed9264589ee14ba52fc786034fa168229 100644 (file)
@@ -67,6 +67,12 @@ ENTRY(apic_hwint##irq)                                                       \
 ENTRY(lapic_timer_int_handler)
        lapic_intr(_C_LABEL(timer_int_handler))
 
+ENTRY(apic_spurios_intr)
+       lapic_intr(_C_LABEL(apic_spurios_intr_handler))
+
+ENTRY(apic_error_intr)
+       lapic_intr(_C_LABEL(apic_error_intr_handler))
+
 #ifdef CONFIG_SMP
 
 ENTRY(apic_ipi_sched_intr)
index cf398e629707ae6f1257a747985a4981015976c4..ff06334da989ce26b9959a23bfe0561a32f922f0 100644 (file)
@@ -72,6 +72,8 @@ _PROTOTYPE( void apic_hwint63, (void) );
 
 /* The local APIC timer tick handlers */
 _PROTOTYPE(void lapic_timer_int_handler, (void));
+_PROTOTYPE(void apic_spurios_intr, (void));
+_PROTOTYPE(void apic_error_intr, (void));
 
 #endif