The maximum length of time interrupts are disabled
Angelo Fraietta
afraiett at bigpond.net.au
Mon Mar 8 18:02:04 UTC 2004
Fabrizio Sebastiani wrote:
> Hi all,
> I have a question a general arch-indipendent question (Im using
> sparc-rtems 4.0.0 for ERC32)
> about the maximum length of time interrupts are disabled, regarding
> invocation of rtems_interrupt_{disable,enable} routines.
> My question is how can I be sure that one critical section never
> miss an interrupt?
> Suppose to have such a tipical code:
>
> rtems_isr_level il;
>
> rtems_interrupt_disable(il);
> // ... critical section ....
> rtems_interrupt_enable(il);
>
> Its clear to me that critical section have to perform the minimum
> actions in order to be "fast";
> Suppose that an interrupt comes while the CPU is executing the
> critical section.
> How i can be sure that my critical section does not take too much time
> before the re-enabling of the interrupt? How i can be sure that no
> critical sections will
> miss some interrupt that was coming inside them?
> I found some infos in the RTEMS docs:
> For example, as explained in
> http://www.rtems.com/onlinedocs/releases/4.0.0/doc/c_user/a00078.html
> says that I should have a look at the spart architecture supplement:
> http://www.rtems.org/onlinedocs/releases/rtemsdocs-4.6.0/share/rtems/html/supplements/sparc/sparc00032.html
>
> In this link there is only a statement that is obscure to me and
> it doesnt seem to answer to my original question:
I had this vey problem in that I missessome interrupts because I
disabled interrupts, when All I needed to do was modify what I was doing.
First see if you need to disable interrupts. If you just want to stop
another task from being prempted, I think that you can change the
priority of your task to be the highest (check on that)
If you need to disable interrupts, make sure the code that s within that
section is as small as possible.
Here asre a couple of articles that I found helpful.
http://www.embedded.com/story/OEG20010918S0052
http://www.embedded.com/story/OEG20020426S0100
--
Angelo Fraietta
PO Box 859
Hamilton NSW 2303
Home Page
http://www.users.bigpond.com/angelo_f/
There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
Bernard of Clairvaux (1090 - 1153)
More information about the users
mailing list