Re: Math emulator

From: Peter Holzer <hp_at_nospam.org>
Date: Tue Oct 19 1993 - 03:31:34 PDT

You (Andrew Valencia) wrote:
>
> [Peter Holzer <hp@quasi.vmars.tuwien.ac.at> writes:]
> >I don't think it makes much difference, whether the signal handler
> >itself calls sigreturn (or whatever it is called) or falls into it.
>
> I hope you mean it doesn't make much difference for purposes of floating
> point emulation performance. It makes a BIG difference in the simplicity
> of the signal handling model.

Not really. The system call which is called by signal, sigaction, ...
needs to pass two addresses to the kernel: The one of the signal handler
and one of a function which does the cleaning up. The kernel can then
build the stack so that the handler returns into the cleanup function
(alternatively it can only pass the address of the cleanup function
which then calls the signal handler).

> You can't just return to the interrupted code
> stream, because on most architectures you need to do an "iret", not
> just a "ret". Other actions may also be required.

You have to restore all the registers. If you want reliable signals you
also have to restore the signal mask (which probably means a system
call).

> I think Plan9's technique is far preferable, so we'll run with that as
> far as possible.

If it is possible to simulate POSIX signal semantics I have no problem
with that. From what you said I believe that this should be possible.

        hp

-- 
   _  | hp@vmars.tuwien.ac.at | Peter Holzer | TU Vienna | CS/Real-Time Systems
|_|_) |------------------------------------------------------------------------
| |   |  ...and it's finished!  It only has to be written.
__/   |         -- Karl Lehenbauer
Received on Tue Oct 19 03:40:10 1993

This archive was generated by hypermail 2.1.8 : Wed Sep 21 2005 - 19:37:12 PDT