Mask interrupts from inside the ISR

Leon Pollak leonp at plris.com
Thu Jan 22 13:24:06 UTC 2009


Thomas,

Thank you very much for your detailed and excellent analysis of the situation.

1. Do we need something special to reenable interrupt sources? This will be 
done obviously outside the interrupt code and therefore may be done by normal 
means, no?

2. Just now I tested that adding:
         /* restore interrupt masks */
         m8260.simr_h = old_simr_h & global_simr_h;
         m8260.simr_l = old_simr_l & global_simr_l;
(where global_xx are initialized to 0xffffffff and are set in ISR) works.
Doing this way will promise that all nested calls will also mask the 
interrupt.

Now, the problem I see is to decide when to reurn the global_xx to the 
0xffffffff value.

And, probably, to invent some more fine way to set/unset these global_xx vars.

Any advices?

Thank you again for the great help.








On Thursday January 22 2009, Thomas Doerfler wrote:
> Leon,
>
> Leon Pollak wrote:
> > On Wednesday January 21 2009, Thomas Doerfler wrote:
> >> it really depends on WHERE you want to block the interrupt. In typical
> >
> > ...........
> > In MPC8260 most of the interrupts are exactly in these registers which
> > are "cached" by the dispatcher.
>
> Please note, that at a given time there may be multiple instances of the
> "dispatcher" code active, and each reads out the previous value of the
> mask register, stores it in a local variable on the stack and then
> modifies the mask register. So you cannot simply move the stored/caches
> mask register value into a global mask variable.
>
> On the other hand, it might be feasible to define a "global mask
> interrupt source" function/macro, which:
> - modifies the mask register directly
> - and also modifies a global mask variable
>
> The dispatcher code would have to observe this global mask variable, and
> when restoring the previous mask register value, it would have to make
> sure that bits that are set in the global mask variable will NOT be
> reenabled in the mask register.
>
> Note that we would need a similar function/macro to reenable interrupt
> sources, and the interaction between the "disable" "enable" and
> dispatcher functions will be quite complicated.
>
> The better way would ALWAYS be to have an additional disable facility
> for (internal and external) interrupts.
>
> wkr,
> Thomas.
>
> > Anyway, I need to block the IRQ3, which is definitely cached and I do not
> > see any other way, except taking out these masks to the "global" area and
> > providing a function to change their value.
> >
> > But I would like to have the society opinion on the issue before I do
> > this...
> >
> > Thanks a lot.



More information about the users mailing list