Problems with the blackfin port

Allan Hessenflow allanh-rtems2 at kallisti.com
Tue Apr 1 17:39:13 UTC 2008


Andr? Keller Abadie wrote:
> Actually I did the same thing at first. However, after a few tests I
> found that this too has a flaw.
> If context_switch is called within this thread_dispatch, a context
> will be saved with some isr-specific stuff in the stack.
> The problem is that the thread_dispatch function can also be called by
> other parts of the system, like when you release a semaphore. Whenever
> this call is made and a context switch to a context containing those
> isr stuff in the stack happens, threaddispatch will return to the isr
> and will cause an exception by executing the RTI instruction.
> 
> Does it make sense?

I guess I don't quite understand where there would be a problem.  When
there is ISR specific stuff saved (I assume you mean by the context
save/restore function), it will only be restored when a context switch
is done back to the interrupted task, which will then correctly lead to
an RTI to that task.  This is why self-nesting must be enabled, so
additional preemptive context switches can occur before that original
task is rescheduled.

If you're actively working on this, perhaps it would be useful if I sent
my cpukit/score/cpu/bfin/* that I think solves these problems and get you
to try to poke holes in it...

allan

-- 
Allan N. Hessenflow      allanh at kallisti.com



More information about the users mailing list