[lug] FPU exception context

Amar Vattakandy amar.vattakandy at gmail.com
Fri Jun 23 00:35:40 MDT 2006


Hi,

Does anyone have experience with how to handle x87 fpu errors in Linux ? 
This is what I am trying to achieve:

When an FPU error occurs, I would like to jump to a handler. In this 
handler, I would like to add some code to figure out what caused the 
exception, store away information about what exception occurred, etc., 
and then clear the exception and go on with life as if the exception 
never occurred.

I could easily get to a handler using signal.h, but within that handler, 
all I see is an empty fpu context. And when I simple do a return in the 
handler, I get right back into the handler. It seems like the fpu 
context is stored away somewhere and a different process/thread context 
is used to jump into the handler. If this is the case, how do I access 
the saved away context ? Or, am I just mortally confused ?

Could someone lend a helping hand ?

Thanks
Amar



More information about the LUG mailing list