Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - save FPU context: (6 Items)
   
save FPU context  
Hi!

I recently wrote an interrupt handler and it works fine. But I would like to know if  I have/need to save the FPU 
context when an interrupt occurs?

Or is it automatically performed by the kernel? Is there some documentation about that?

Best regards,
Cédric
Re: save FPU context  

Cédric Schaffter wrote:
> Hi!
> 
> I recently wrote an interrupt handler and it works fine. But I would like to know if  I have/need to save the FPU 
context when an interrupt occurs?
> 
> Or is it automatically performed by the kernel? Is there some documentation about that?

I believe that it is being saved for you, but you can pose 
this question in OSTech forum, you will get a better answer 
faster.

AW: save FPU context  
Hi Cédric,

the kernel does not save/restore the FPU context around interrupt
handling, because this would cause a lot of overhead that's usually 
not required.

Saving the FPU context would only be necessary if the FPU was used 
within an interrupt handler, which is hardly ever the case.

If you should really feel an urgent need to do floating pint in 
an ISR, you'll have to do the save/restore yourself. I even think 
there's some documentation regarding this topic.

- Thomas 

> -----Ursprüngliche Nachricht-----
> Von: Cédric Schaffter [mailto:community-noreply@qnx.com]
> Gesendet: 17 November 2008 15:53
> An: general-community
> Betreff: save FPU context
> 
> 
> Hi!
> 
> I recently wrote an interrupt handler and it works fine. But 
> I would like to know if  I have/need to save the FPU context 
> when an interrupt occurs?
> 
> Or is it automatically performed by the kernel? Is there some 
> documentation about that?
> 
> Best regards,
> Cédric
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16664
> 
Re: AW: save FPU context  
Or better still, put the handling into an interrupt service thread, where FPU context will be saved/restored properly! :
-)

Thomas Haupt wrote:
> Hi Cédric,
> 
> the kernel does not save/restore the FPU context around interrupt
> handling, because this would cause a lot of overhead that's usually 
> not required.
> 
> Saving the FPU context would only be necessary if the FPU was used 
> within an interrupt handler, which is hardly ever the case.
> 
> If you should really feel an urgent need to do floating pint in 
> an ISR, you'll have to do the save/restore yourself. I even think 
> there's some documentation regarding this topic.
> 
> - Thomas 
> 
>> -----Ursprüngliche Nachricht-----
>> Von: Cédric Schaffter [mailto:community-noreply@qnx.com]
>> Gesendet: 17 November 2008 15:53
>> An: general-community
>> Betreff: save FPU context
>>
>>
>> Hi!
>>
>> I recently wrote an interrupt handler and it works fine. But 
>> I would like to know if  I have/need to save the FPU context 
>> when an interrupt occurs?
>>
>> Or is it automatically performed by the kernel? Is there some 
>> documentation about that?
>>
>> Best regards,
>> Cédric
>>
>> _______________________________________________
>> General
>> http://community.qnx.com/sf/go/post16664
>>
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16667

-- 
cburgess@qnx.com
Re: AW: save FPU context  
There. And I thought OS people don't monitor this forum.


Colin Burgess wrote:
> Or better still, put the handling into an interrupt service thread, where FPU context will be saved/restored properly!
 :-)
> 
> Thomas Haupt wrote:
>> Hi Cédric,
>>
>> the kernel does not save/restore the FPU context around interrupt
>> handling, because this would cause a lot of overhead that's usually 
>> not required.
>>
>> Saving the FPU context would only be necessary if the FPU was used 
>> within an interrupt handler, which is hardly ever the case.
>>
>> If you should really feel an urgent need to do floating pint in 
>> an ISR, you'll have to do the save/restore yourself. I even think 
>> there's some documentation regarding this topic.
>>
>> - Thomas 
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Cédric Schaffter [mailto:community-noreply@qnx.com]
>>> Gesendet: 17 November 2008 15:53
>>> An: general-community
>>> Betreff: save FPU context
>>>
>>>
>>> Hi!
>>>
>>> I recently wrote an interrupt handler and it works fine. But 
>>> I would like to know if  I have/need to save the FPU context 
>>> when an interrupt occurs?
>>>
>>> Or is it automatically performed by the kernel? Is there some 
>>> documentation about that?
>>>
>>> Best regards,
>>> Cédric
>>>
>>> _______________________________________________
>>> General
>>> http://community.qnx.com/sf/go/post16664
>>>
>>
>> _______________________________________________
>> General
>> http://community.qnx.com/sf/go/post16667
> 
Re: AW: save FPU context  
Thanks for all your answers :)

I have many tasks and all of them computes in floating point (i.g. : sinus) and my fear is to lose coherency or 
performances when the scheduler switches between tasks.

There's an interrupt from parallel port which is used to wake up threads every x [us] with semaphores.

I will ask soon this question in the OSTech section ;)

Best regards,
Cédric