How to mask IRQ

Eric Valette eric.valette at free.fr
Sun May 29 13:26:58 UTC 2005


leonp at plris.com wrote:

> I want to stop to receive the IRQ5 & IRQ4 interrupts at all till some other 
> event occurs, which may be reenable them.

OK. Then you want to manipulate IRQ mask by hand and unfortunately the
current IRQ framework is not well suited for that : the way it is
intended to work is that when an interrupt occurs another set of
interrupt may be maked while handling this particular inetrrupt but
restored when IRQ processing is finished. Allowing IRQ handler to
manipulate the masks is usually the best way to write bad code as nested
interrupt doing the same thing may screw up the values...


> This decision of masking IRQ4-5 I can take only inside the ISR of the IRQ5.

No you can manually manipulate the SIU when you want in fact but yes
execution of an IRQ shall not modify the masks as unpredictable things
can occur due to nesting and the fact that interrupt are enabled when
handler executes...

NB : if you want to make very specific things you could hook up another
handler for the specific interrupt you want...


Hope this helps,

-- eric





More information about the users mailing list