- A kernel thread that touches an interrupt queue must bracket
- its accesses with calls to intq_lock() and intq_unlock().
- These functions take a lock associated with the queue (which
- locks out other kernel threads) and disable interrupts (which
- locks out interrupt handlers).
-
- An external interrupt handler that touches an interrupt queue
- need not take any special precautions. Interrupts are
- disabled in an external interrupt handler, so other code will
- not interfere. The interrupt cannot occur during an update to
- the interrupt queue by a kernel thread because kernel threads
- disable interrupts while touching interrupt queues.
+ These functions can be called from kernel threads or from
+ external interrupt handlers. Except for intq_init(),
+ interrupts must be off in either case.