summaryrefslogtreecommitdiffstats
path: root/sys/sys/interrupt.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-02-22 02:18:32 +0000
committerjhb <jhb@FreeBSD.org>2001-02-22 02:18:32 +0000
commitbfd047a3c936c2ea237d09f71e53f3b02aae1497 (patch)
tree4b98153f7f2c6e9e7c78153cbc3f699eb673ed87 /sys/sys/interrupt.h
parent0d396b87d337a6f2a1fea3ae75887fe04277c9ab (diff)
downloadFreeBSD-src-bfd047a3c936c2ea237d09f71e53f3b02aae1497.zip
FreeBSD-src-bfd047a3c936c2ea237d09f71e53f3b02aae1497.tar.gz
Work around a race condition where an interrupt handler can be removed from
an interrupt thread while the interrupt thread is blocked on Giant waiting to execute the interrupt handler being removed. The result was that the intrhand structure would be free'd, and we would call 0xdeadc0de. The work around is to check to see if the interrupt thread is idle when removing a handler. If not, then we mark the interrupt handler as being dead using the new IH_DEAD flag and don't remove it from the interrupt threads' list of handlers. When the interrupt thread resumes, it will see a dead handler while traversing the list of handlers and will remove the handler then.
Diffstat (limited to 'sys/sys/interrupt.h')
-rw-r--r--sys/sys/interrupt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h
index 1bc48d6..9c44d81 100644
--- a/sys/sys/interrupt.h
+++ b/sys/sys/interrupt.h
@@ -50,6 +50,7 @@ struct intrhand {
#define IH_FAST 0x00000001 /* Fast interrupt. */
#define IH_EXCLUSIVE 0x00000002 /* Exclusive interrupt. */
#define IH_ENTROPY 0x00000004 /* Device is a good entropy source. */
+#define IH_DEAD 0x00000008 /* Handler should be removed. */
#define IH_MPSAFE 0x80000000 /* Handler does not need Giant. */
/*
OpenPOWER on IntegriCloud