Port-amiga archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: setjmp, sigsetjmp, siglongjmp,_setjmp



is%beverly.rhein.de@localhost (Ignatios Souvatzis) writes:

> 
> c) i386 doesn't save FP, either.

The C calling convention on the i386 *requires* the floating point
stack to be empty on entry and exit from a function (except when the
function returns a floating point value on the stack).  Thus there's
no need to save the FP stack.  It might be reasonable to save the
`environment' (the control and status words).  Doing so from
user-level code would of course cause a FPU context switch even if the
process isn't using the FPU, which is undesirable.  There are
(complicated) ways to solve this.

> 1. it should 
> 
> (and this is a complicated issue for the m68k port, as we 
> 
> 2. might have to save the user invisible context, too, which requires
> conditional code, as we have 2 and a half different Motorola FPUs
> (68881/68882/680[46]0) 
> 
> 3. worse, some SUN3's come with totally different FPU's not from the
> Motorola world.
> 
> This sounds like the clean solution would be to call the kernel to do
> this. 

SVR4 has getcontext() and setcontext() system calls for things like
this.

If you plan to do this, you should also make sure that sendsig() and
sigreturn() deal with the FPU (possibly using the same backend for
consistency).




Home | Main Index | Thread Index | Old Index