linux-mips
[Top] [All Lists]

Re: [PATCH, RFC] MIPS: Implement the getcontext API

To: "Maciej W. Rozycki" <macro@codesourcery.com>
Subject: Re: [PATCH, RFC] MIPS: Implement the getcontext API
From: David Daney <ddaney@caviumnetworks.com>
Date: Tue, 03 Mar 2009 08:56:25 -0800
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, libc-ports@sourceware.org, "Maciej W. Rozycki" <macro@linux-mips.org>
In-reply-to: <alpine.DEB.1.10.0902282326580.4064@tp.orcam.me.uk>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <alpine.DEB.1.10.0902282326580.4064@tp.orcam.me.uk>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.19 (X11/20090105)
Maciej W. Rozycki wrote:
Hello,

 Here is code to implement the getcontext API for MIPS.
[...]

The conclusion is what I am requesting is to get the structure of the stack frame used by sigreturn(2) fixed in its current form and make sure the syscall only ever uses data from the ucontext_t structure within. A new syscall would have to be introduced if the kernel required a change in the way sigreturn(2) behaves in the future. For the purpose of glibc the structure of the stack frame is defined in the kernel_rt_sigframe.h header provided with the patch.


Note the libgcc currently makes the assumption that the layout of the stack for signal handlers is fixed. The DWARF2 unwinder needs this information to be able to unwind through signal frames (see gcc/config/mips/linux-unwind.h), so it is already a de facto part of the ABI.

When (and if) we move the sigreturn trampoline to a vdso we should be able to maintain the ABI.


Furthermore I am requesting that the kernel recognises the special meaning of the value of one stored in the slot designated for the $zero register and never places such a value itself there.

Seems reasonable to me as currently a zero is unconditionally stored there.

David Daney

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