|
From: <we...@cw...> - 2002-04-22 17:19:22
|
[A bit more explanation.] Quoting we...@cw...: > Yes, I agree. The problem is that the irq is unmasked then the > interrupt flag is set then we go on to do a lot more processing. > The same interrupt can then occur again before we have executed the handler eventually overflowing the stack for a frequently occuring event. > 1. Set per-interrupt flag. > 2. If per-interrupt flag was already set, increment per-interrupt > counter and > return. > 3. Enable interrupts. > 4. Call device handler. > 5. Check the per-interrupt counter, if greater than zero then goto to > step 4. > 6. Clear the per-interrupt flag. > 7. Execute DPCs, APCs and thread dispatching. > This is safe since: a) no more one (and a bit) instances of each interrupt handler can be active at a time; b) DPCs and thread dispatches is done at DISPATCH_LEVEL, APCs at APC_LEVEL so these can never be executed. The per-interrupt flag can be reduced to just a check that the irql level is currently less than the priority of the interrupt and the interrupt handler epilog can also check for queued instances of lower priority interrupts. |