The last parameter, flags, controls all kinds of things:
- _NTO_INTR_FLAGS_END
- Indicates that this handler should go after other handlers that may
be attached to the same interrupt source.
- _NTO_INTR_FLAGS_PROCESS
- Indicates that this handler is associated with the process rather than the thread.
What this boils down to is that if you specify this flag, the interrupt handler
will be automatically dissociated from the interrupt source when the process exits.
If you don't specify this flag, the interrupt handler will be dissociated from the
interrupt source when the thread that created the association in the first place
exits.
- _NTO_INTR_FLAGS_TRK_MSK
- Indicates that the kernel should track the number of times the interrupt has been masked.
This causes a little more work for the kernel, but is required to ensure an orderly
unmasking of the interrupt source should the process or thread exit.