[ECOS] Floating Point Register saves

Paul D. DeRocco pderocco@ix.netcom.com
Tue Sep 28 09:07:00 GMT 2004

> From: David Brennan
> According to the documentation in the i386 hal cdl documentation, it
> states that by default eCos will "save and restore FPU state on every
> thread switch, interrupt and exception." It states this in the option
> for turning off lazy FPU switching. Our application uses floating point
> registers in the DSR context. With Lazy FPU on, we get an SIGFPE. (Which
> I guess is not surprising). So we have turned off lazy FPU switching.
> With lazy FPU off, is it safe to use floating points in DSR (or ISR)
> context? (We got burned by this earlier under VxWorks.)
> If not, is there a preferred way of saving, and restoring the floating
> point registers?

An interrupt handler has to preserve _anything_ that might be used by
interrupted code. With inline assembler, you can save the FPU state with
FSAVE and restore it with FRSTOR.


Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list