hi! > > 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).
Ok. But that is exactly what I don't understand. I thought that this occurs when rtl_switch_to() returns. At least at the first time when switched to the task rtl_startup() is called immediatly after rtl_switch_to(). I understand your argument for the following switches, where the remainder of rtl_schedule() is carried out, but not for the first switch to a task. Best regards, Franz Hollerer Mario Taschwer wrote: > > 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/ -- Franz Hollerer Dependable Computer Systems Stumpergasse 48/28, A-1060 Wien, Austria Phone: +43 1 5953935-21 mailto:[EMAIL PROTECTED] Fax: +43 1 5953935-18 http://www.decomsys.com ------------------------------------------------------------------------ Austria Usually we don't have kangaroos. -- [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/