somshekar kadam wrote:
> I was understanding the context switch code of
> Xenomai-2.3.0 for PPC, I got the point that once it
> enters rthal_thread_switch , xnarch_thread_trampoline
> function is executed, register 15 holds this address
> of this function and register 2 holds the
> rthal_thread_trampoline function,
> what I am not able to understand is how does
> rthal_thread_switch function is called,
rthal_thread_switch is called by xnarch_switch_to, which, in turn is
called when the scheduler decides that the task (the newly created one,
in this case) shoudl run.
> I understand from rthal_thread_trampoline
> xnarch_thread_trampoline is called by jumping to
> function using mtlr and in link register has the
> address of xnarch_thread_trampoline stored in reg 15
> and uses blr to jump to it and executes new thread.
> what I dont understand is how it excutes
> rthal_thread_trampoline, may be some pointers on this,
xnarch_init_thread prepares the stack and registers of the newly created
task so that rthal_thread_switch does the right thing. Perhaps Philippe
or Wolfgang will be able to give more details.
Xenomai-core mailing list