This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]