[Top] [All Lists]

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

To: "Maciej W. Rozycki" <>
Subject: Re: [PATCH, RFC] MIPS: Implement the getcontext API
From: David Daney <>
Date: Tue, 03 Mar 2009 08:56:25 -0800
Cc: Ralf Baechle <>,,, "Maciej W. Rozycki" <>
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Thunderbird (X11/20090105)
Maciej W. Rozycki wrote:

 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>