summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-05-28 17:37:48 +0200
committerRichard Braun <rbraun@sceen.net>2017-05-28 17:57:29 +0200
commit90fd42c78fc54ec81a8979d8cbcc12350cf2ec01 (patch)
treefaf54484fce5ee5041cd04bba7439cbb334581d2 /kern
parent001ea7c0bbe1b5fb440b5e628faa47d8a58f36b7 (diff)
kern/intr: gracefully handle spurious interrupts
Diffstat (limited to 'kern')
-rw-r--r--kern/intr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kern/intr.c b/kern/intr.c
index 0d3a4a8e..ecc2edf2 100644
--- a/kern/intr.c
+++ b/kern/intr.c
@@ -411,6 +411,11 @@ intr_handle(unsigned int intr)
spinlock_lock(&entry->lock);
+ if (intr_entry_empty(entry)) {
+ printf("intr: spurious interrupt %u\n", intr);
+ goto out;
+ }
+
intr_entry_eoi(entry, intr);
list_for_each_entry(&entry->handlers, handler, node) {
@@ -421,5 +426,6 @@ intr_handle(unsigned int intr)
}
}
+out:
spinlock_unlock(&entry->lock);
}