diff options
author | Richard Braun <rbraun@sceen.net> | 2017-05-28 17:37:48 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-05-28 17:57:29 +0200 |
commit | 90fd42c78fc54ec81a8979d8cbcc12350cf2ec01 (patch) | |
tree | faf54484fce5ee5041cd04bba7439cbb334581d2 /kern | |
parent | 001ea7c0bbe1b5fb440b5e628faa47d8a58f36b7 (diff) |
kern/intr: gracefully handle spurious interrupts
Diffstat (limited to 'kern')
-rw-r--r-- | kern/intr.c | 6 |
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); } |