Hopefully this is a good compromise. If more than 99% of the interrupts of a

vector are unhandled, it is disabled if it is not a shared interrupt vector
(as before). Otherwise a message is printed to indicate the condition. I
reduced the amount of interrupts to 10000, as with 100000 it would take over
half an hour on my machine to trigger. Feel free to adjust.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24146 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2008-02-26 20:54:04 +00:00
parent 73107b3121
commit 6dffd08db7

View File

@ -309,16 +309,21 @@ int_io_interrupt_handler(int vector, bool levelTriggered)
io_vectors[vector].ignored_count++; io_vectors[vector].ignored_count++;
} }
// disable interrupt when more than 99% are unhandled and this is not a if (io_vectors[vector].trigger_count > 10000) {
// shared interrupt if (io_vectors[vector].ignored_count > 9900) {
if (io_vectors[vector].trigger_count > 100000 if (io_vectors[vector].handler_list.next == NULL
&& !(io_vectors[vector].handler_list.next != NULL || io_vectors[vector].handler_list.next->next == NULL) {
&& io_vectors[vector].handler_list.next->next != NULL)) { // this interrupt vector is not shared, disable it
if (io_vectors[vector].ignored_count > 99000) { io_vectors[vector].enable_count = -100;
io_vectors[vector].enable_count = -100; arch_int_disable_io_interrupt(vector);
arch_int_disable_io_interrupt(vector); dprintf("Disabling unhandled io interrupt %d\n", vector);
dprintf("Disabling unhandled io interrupt %d\n", vector); } else {
// this is a shared interrupt vector, we cannot just disable it
dprintf("More than 99%% interrupts of vector %d are unhandled\n",
vector);
}
} }
io_vectors[vector].trigger_count = 0; io_vectors[vector].trigger_count = 0;
io_vectors[vector].ignored_count = 0; io_vectors[vector].ignored_count = 0;
} }