From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753943AbbCKOe0 (ORCPT ); Wed, 11 Mar 2015 10:34:26 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:41173 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753866AbbCKOeU (ORCPT ); Wed, 11 Mar 2015 10:34:20 -0400 Message-ID: <550051D4.7040508@vanguardiasur.com.ar> Date: Wed, 11 Mar 2015 11:31:48 -0300 From: Ezequiel Garcia Organization: VanguardiaSur User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ley Foon Tan , Chung-Lin Tang CC: Chung-Lin Tang , Arnd Bergmann , Tobias Klauser , Walter Goossens , Linux-Arch , "nios2-dev@lists.rocketboards.org" , "linux-kernel@vger.kernel.org" Subject: Re: nios2: is the ptrace ABI correct? References: <10088870.tldQegtTla@wuerfel> <54EDB2FC.4050901@vanguardiasur.com.ar> <10841724.NbdcAaCe1a@wuerfel> <54F03184.7080600@codesourcery.com> <54F052B1.4070300@vanguardiasur.com.ar> <54FDD041.3080500@codesourcery.com> <54FDD219.1060707@gmail.com> <54FDD2D8.8090509@vanguardiasur.com.ar> <54FE8C79.2000104@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/11/2015 04:48 AM, Ley Foon Tan wrote: > On Tue, Mar 10, 2015 at 2:17 PM, Chung-Lin Tang wrote: >> On 2015/3/10 10:54 AM, Ley Foon Tan wrote: >>> On Tue, Mar 10, 2015 at 1:05 AM, Ezequiel Garcia >>> wrote: >>>> >>>> >>>> On 03/09/2015 02:02 PM, Chung-Lin Tang wrote: >>>>> On 2015/3/10 12:54 AM, Chung-Lin Tang wrote: >>>>>> It appears that some of the ways nios2 has organized the >>>>>> ucontext/pt_regs/etc. are remnants of the pre-generic code, some >>>>>> basically because the port was based off m68k. >>>>>> >>>>>> I've re-organized the headers a bit: nios2/include/asm/ucontext.h is >>>>>> deleted, and re-definition of struct sigcontext now allows use of >>>>>> uapi/asm-generic/ucontext.h directly. Note that the reorg, despite >>>>>> effectively renaming some fields, is still binary compatible. I'll >>>>>> probably update the corresponding glibc definitions later. >>>>>> >>>>>> struct pt_regs is now not exported, and all exported register sets are >>>>>> now supposed to follow the 49 register set defined as in GDB now. >>>>>> >>>>>> Tobias, Ley Foon, how do you think this looks? >>>>> >>>>> Sorry, accidentally attached unrelated GCC patch instead, this one's the >>>>> correct one. >>>>> >>>> >>>> Looks good. I'm wondering if... >>>> >>>> +/* User structures for general purpose registers. */ >>>> +struct user_pt_regs { >>>> + __u32 regs[49]; >>>> }; >>>> >>>> Can we expose the registers explicitly here? Like this: >>>> >>>> struct user_pt_regs { >>>> __u32 r0; >>>> __u32 r1; >>>> ... >>>> __u32 sp; >>>> __u32 gp; >>>> __u32 estatus; >>>> }; >>>> >>>> It looks self-documenting and thus easier to use. >>> >>> Hi Chung-Lin, >>> >>> Your patch look good to me. >>> Do you have any problem to change the struct user_pt_regs based on >>> Ezequiel's suggestion? >> >> Well, exposing the register names like that sort of defeats the purpose of >> the PTR_* defines. >> >> Judging from the overall trend of style in arch/*/include/uapi/asm/ptrace.h >> across ports, I would prefer to stay with the array field. >> > Okay, I will include your patch. > That'd be great. I'll wait until Linus takes the change, and then will submit the strace support to strace mailing list. Thanks for the help! -- Ezequiel Garcia, VanguardiaSur www.vanguardiasur.com.ar