linux-mips
[Top] [All Lists]

Re: Question about signal syscalls !

To: "David Daney" <ddaney@avtrex.com>
Subject: Re: Question about signal syscalls !
From: "Franck Bui-Huu" <vagabon.xyz@gmail.com>
Date: Fri, 2 Feb 2007 17:36:30 +0100
Cc: "Ralf Baechle" <ralf@linux-mips.org>, linux-mips <linux-mips@linux-mips.org>
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=MLf1c2TKqs114cF8FixPEo8CJ2CM2jqWzh9cCSZwdNZRADi8ZgUJ6z+caF9cH337pk8ixSYjF4pbD4eOsLVfG7LT4NgtWRRXZ93LyRWtZgvD0GC3DUjC0usz0XdmHc/feOEgwJx3xJQHXhluuf/i3X5dYGyXPxWt8Cp8QYbQh5Q=
In-reply-to: <45C3611D.7000702@avtrex.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <cda58cb80702010243y4a36026i6945f2a5cd3791d0@mail.gmail.com> <20070201135734.GB12728@linux-mips.org> <cda58cb80702010654w74527a34k4ed229b499b8f9b2@mail.gmail.com> <45C21CFE.9060804@avtrex.com> <cda58cb80702020055t6eb2578fn5d1e4370e9ebda08@mail.gmail.com> <45C3611D.7000702@avtrex.com>
Sender: linux-mips-bounce@linux-mips.org
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"
               "j\tsyscall_exit"
               :/* 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...

--
              Franck

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