[Top] [All Lists]

Re: Question about signal syscalls !

To: Franck Bui-Huu <>
Subject: Re: Question about signal syscalls !
From: David Daney <>
Date: Fri, 02 Feb 2007 08:56:38 -0800
Cc: Ralf Baechle <>, linux-mips <>
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <> <> <>
User-agent: Thunderbird (Windows/20061207)
Franck Bui-Huu wrote:
David Daney wrote:
sys_sigreturn does not return to the caller in the conventional sense.

I expect you're talking about this bite of code taken from _sys_sigreturn():

        * Don't let your children do this ...
       __asm__ __volatile__(
               "move\t$29, %0\n\t"
               :/* no outputs */
               :"r" (&regs));

The entire user context (i.e. the value of *all* registers) is replaced
with the values stored in the sigcontext structure on the caller's
stack.  If all registers are being restored from the sigcontext, then
there is no need to save the current values of the registers, because
they will never be used.

But I don't see where _all_ registers are saved. Only static registers
are saved by save_static_function() right before calling
_sys_sigreturn() and I agree I don't why we need to save those.

And now I'm starting to think that we don't need to save static regs in
setup_sigcontext() either...

All registers *must* be saved in the sigcontext. That is part of the contract the kernel has with user code.

On return from an asynchronous signal, *all* registers must contain the same values they had before the process was interrupted.

David Daney

David Daney

<Prev in Thread] Current Thread [Next in Thread>