From owner-freebsd-mips@FreeBSD.ORG Wed Feb 3 19:31:37 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F74D106568B for ; Wed, 3 Feb 2010 19:31:37 +0000 (UTC) (envelope-from neelnatu@yahoo.com) Received: from web34402.mail.mud.yahoo.com (web34402.mail.mud.yahoo.com [66.163.178.151]) by mx1.freebsd.org (Postfix) with SMTP id DF82E8FC0C for ; Wed, 3 Feb 2010 19:31:36 +0000 (UTC) Received: (qmail 53177 invoked by uid 60001); 3 Feb 2010 19:31:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1265225496; bh=KCxOAC3VL3WoBv8XOhHX96ahfEM7/h/RlEG9mp1YLpI=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=dG9c9ORSf+wcMJZNP6IcB+V9FyZu+jotZAK8/1M8tTK9NrGWcDn8ZCBzpKaUGvM5nIKvuszQiKycscrhl/TXcXmPb64Tr69qXJkXD+K3o2xwbjUu+SzMXKgY4+J2bvIz9McFce89ivTdo3ZIgivE3an0pOQagg7DX/CRGx3bxrY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=nCk1/zTVXk5blVlUjq7RgRTMzLXJgPHQclwhkIqkujXP3OpbZcmt+Ghp5m1U+pTQo2GkP+tItiMWq7bFR8p8omPG8Xz+xZZbpKhWtTKahx9/XoYSUp2oo6nkcX9A9Eic3NqmZehWMGBKXYe9p/8ImZV3XVpdEdS7ji3RU5JGzpw=; Message-ID: <296949.49663.qm@web34402.mail.mud.yahoo.com> X-YMail-OSG: 8LED1joVM1nyrynPG2tX3WFV4d.VbPlyQWXva3s5dkBslPVDOMeAX1h5RbntYdiBZjJYBtiSAhDHq7r6861Q9FRJswaZ_jNxz2T5CMDiSRa9UWnAYOGnaTiT7KoSp2vtisJ5nt9GIG3SzQ3AW_.rwvmFA0p1ZOmFU0PwTPIO55M2Z1njxE2yDOnoGGyHFs1uEwWfxfnzWdPvSRH.elh.rQpmyeeMRLMKMQSEyfgoLM_FXti2lyqRv3DSst6pwVSgHMqPd7_o_rD7286EvReCXr0F0HgjEaD6oY0XwA9qsWzokaXVyAMDMXeIMM2.S.FABPkTrYymnfPBA4rXLzF3laEGeXAtoEgeIkN1G8sS3xeq9E5PGsGDg_1GPDaPqY7SCKtoFciKxytk9IX314Y8s6.TBt2AEqVS6G3hgTW1cSKpAmzxsZm5aVOq.fZH0yc5Mja0pBQX Received: from [198.95.226.228] by web34402.mail.mud.yahoo.com via HTTP; Wed, 03 Feb 2010 11:31:36 PST X-Mailer: YahooMailClassic/9.1.10 YahooMailWebService/0.8.100.260964 Date: Wed, 3 Feb 2010 11:31:36 -0800 (PST) From: Neelkanth Natu To: Rui Paulo , "C. Jayachandran" In-Reply-To: <98a59be81002030227u43b0e601q2eebb383debc230b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-mips@freebsd.org Subject: Re: mips ptrace.S fix X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 19:31:37 -0000 Hi JC, Your patch looks good. I have a few comments though. See inline: Index: lib/libc/mips/sys/ptrace.S =================================================================== --- lib/libc/mips/sys/ptrace.S (revision 203379) +++ lib/libc/mips/sys/ptrace.S (working copy) @@ -42,14 +42,26 @@ #endif /* LIBC_SCCS and not lint */ LEAF(ptrace) + .frame sp,40,ra >> space missing after the ',' + .mask 0x80000000, -8 #ifdef __ABICALLS__ .set noreorder .cpload t9 .set reorder #endif + subu sp, sp, 40 + sw ra, 32(sp) +#ifdef __ABICALLS__ + .cprestore 16 +#endif la t9, _C_LABEL(__error) # locate address of errno - jalr t9 + jalr t9 >> this change is not required - the newly added line has a tab at the end. +#ifdef __ABICALLS__ + lw gp, 16(sp) +#endif >> this is redundant - the assembler will generate exactly the same line of >> code due to the .cprestore directive above. sw zero, 0(v0) + lw ra, 32(sp) + addu sp, sp, 40 li v0, SYS_ptrace syscall bne a3, zero, 1f best Neel --- On Wed, 2/3/10, C. Jayachandran wrote: > From: C. Jayachandran > Subject: Re: mips ptrace.S fix > To: "Rui Paulo" > Cc: freebsd-mips@freebsd.org > Date: Wednesday, February 3, 2010, 2:27 AM > On Wed, Feb 3, 2010 at 3:49 PM, Rui > Paulo > wrote: > > On 3 Feb 2010, at 03:06, C. Jayachandran wrote: > > > >> The ptrace system call implementation seems to > have a bug, we need to > >> save ra and gp before calling the __error, and > that will need a stack > >> frame. > >> > >> I've attached a patch that should fix this for o32 > ABI - but it really > >> should be written with ABI-independent macros, any > clue on how to do > >> this which will take care of n32/64 too will be > helpful. > >> > >> I also have some initial patches for making gdb > work on MIPS. . That > >> patch is also attached, but it is work in > progress, only the static > >> executables work now. > > > > I think you forgot the attachments or they were > stripped out. > > I think the attachments were stripped out, may be by the > mailing list > itself. I had them as attachments since I was worried > that gmail will > damage white-space if I did it inline. > > Is there a standard way of submitting patches to the list? > For now I > have the patches at: > http://sites.google.com/site/cjayachandran/files (the > files are > ptrace.S.patch and gdb.patch) > > Thanks, > JC. > _______________________________________________ > freebsd-mips@freebsd.org > mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" >