Re: FP emulator patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >         if (current->used_math) {               /* Using the FPU again.
*/
> >                 lazy_fpu_switch(last_task_used_math);
> >         } else {                                /* First time FPU user.
*/
> >                 init_fpu();
> >                 current->used_math = 1;
> >         }
> >         last_task_used_math = current;
> >
...
> > BTW, do I see another bug here in do_cpu()?  It seems that before we
call
> > init_fpu(), we should check last_task_used_math.  If it is not NULL, we
should
> > save the FP state to the last_task_used_math.  Hmm, strange ...
>
> I thought I got all of these... <sigh>

Looks like that should be:

           } else {
                if (last_task_used_math != NULL)
save_fp(last_task_used_math);
                init_fpu()
                current->used_math = 1;
            }

And things will be OK.  What's wierd is that I could have sworn
that I looked at this code long ago, and that there was a save
there.  But even in the 2.2.12-based tree, there is none.

It's quite late here in France.  If one (or more) of you guys could
sketch a code fragment that would copy FP context back and
forth between a thread structure and a sigcontext without passing
through the FPU while I'm sleeping, I'll put together an integrated
patch tomorrow.

            Regards,

            Kevin K.



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux