Timing of events in an ISR

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Tue Oct 19 13:20:02 UTC 2004

Mark VanderVoord wrote:
> OK, all my tasks have been declared with the following
> mode:
> According to the MIPS supplement, interrupt level 0
> means that it should allow all interrupts, so I
> believe that these settings are correct.
> I've also tried to create them all with
> RTEMS_DEFAULT_MODE, with the same effect.
> This morning, I changed the setup so that only this
> task is launched from Init.  Init then suspends itself
> as before.  This also has the same effect.
> Finally, I added a mode change to the init task, right
> before I suspend it, to make its mode preemptable and
> interrupt level 0.  Again, no change.  I can rework
> things so that the Init task is deleted if you think
> that will help, but I believe this test shows that it
> is not the issue.

Can you verify that the task's do indeed have interrupts
enabled AFTER the 1st interrupt occurs?  Random thought
... if the ISR return path may not be restoring interrupt
level correctly, it could accidentally disable interrupts
in the interrupted thread.  Just periodically check the
disable level in the threads.

Another possibility is that interrupts are disabled
in the ISR preemption code (cpukit/score/mips/cpu_asm.S)
around the line 951 in the 4.6 branch version of this
file.  There is a jal _Thread_Dispatch.  Interrupts should
be enable at the same level they were when the ISR was
entered at that point.  Also when you return and fall out
of that path, the interrupt disable level should be back
to the interrupted threads.

Another possibility is a mismatched _ISR_Disable/Enable
call somewhere.  You might want to add a counter to
those routines and see if they match.

Something is not right.  I am suspicious of the MIPS
specific code since that is the easiest place to do this
and it wouldn't impact users on other CPUs.

> Mark S VanderVoord
> Self-Guided Systems, LLC
> _______________________________
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com

Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

More information about the users mailing list