On Wed, Sep 26, 2001 at 10:38:57AM +0200, Franz Hollerer wrote:
> Hi!
> 
> I have some troubles understanding the scheduler source code.
> Maybe someone can give me some hints. Thx.
> 
> Task switching
> --------------
> 
> Task switching is done in rtl_schedule by calling
> rtl_switch_to(). The switch occurs when the "ret" instruction of
> rtl_switch_to()
> is carried out. At this point a new task runs. The remainder of
> rtl_schedule is
> postponed until the previous task is activated again.

Actually, the switch occurs when the register contents (including the stack
pointer) of the new task are restored. This happens inside rtl_switch_to.

> 
> Right? If so I have problems with the floating point support. Why are
> the
> floating point registers saved and restored after the call to
> rtl_switch_to().
> Isn't it to late to do this here, because the switch to the task has
> already occurred and
> been carried out?

RTLinux only switches the FP context if the new task needs the FPU. Note
that the Linux task is always assumed to use the FPU. The FP switch is not
too late, because the new task will not use the FP registers before
control returns to the application module (or to Linux).

Mario Taschwer

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to