This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Floating Point Register saves
- From: "Paul D. DeRocco" <pderocco at ix dot netcom dot com>
- To: "eCos Discuss" <ecos-discuss at ecos dot sourceware dot org>
- Date: Mon, 27 Sep 2004 20:05:49 -0700
- Subject: RE: [ECOS] Floating Point Register saves
> 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