FP context switching on i386

Eric Valette eric.valette at free.fr
Sat Oct 3 20:05:49 UTC 2009


Thomas Doerfler wrote:
> Eric Valette schrieb:
>> Till Straumann wrote:
>>> Thomas Doerfler wrote:
>>>> Till,
>>>>
>>>> although I am not at all familiar with i386 ABI stuff, I would guess
>>>> that we have to save the context during a task switch, at least when it
>>>> was forced due to a interrupt (e.g. timer) event. In these cases there
>>>> is no function call involved for the function that uses the FP context.
>>>>   
>>> I think you're right, Thanks.
>> The most efficient way is to do  is lasy FP saving: you disable the 387
>> while noting the task that was using it and get an exception is someone
>> wants to use FPU registers...
> 
> Sebastian is currently implementing this for PowerPC in the current
> environment. It is a bit tricky to make sure that the FPU stays disabled
> when restoring a previously saved MSR :-)
> 
> How is the FPU controlled in i386?

Do not remember exactly. Have no data book handy here. Its clear that if
it is and MSR bit, extra care shall be taken when restoring next
runnable thread MSR.

-- eric





More information about the users mailing list