From owner-freebsd-mips@FreeBSD.ORG Thu Feb 4 05:52:23 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 2B900106566C for ; Thu, 4 Feb 2010 05:52:23 +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 DF5618FC25 for ; Thu, 4 Feb 2010 05:52:22 +0000 (UTC) Received: (qmail 726 invoked by uid 60001); 4 Feb 2010 05:52:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1265262742; bh=WlF6+4Mhqi02LAsplwvKvxWGDbrNm/HmylQ6UaMP7hg=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=G01WqhKqmnxhet/N5hv4CbC7eyenEEUUwrGeSHPZe28MgQQPsWRgmr95hGQ189neBc8l5huSer4xUVfeN/3UXCY2iO2v40Okh4by0CLoIaZx+Gmf3Ify/LI2tSZDz9y99taSHNdKrSeC6+Sa/m7ahH86bys26C4SFZmO3KukwLk= 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:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Zl2e6yXscsZwiHmfHUCI1bJQCkuYFBu4ZkoNLlK0eOu48b4hx5gsHY8ZEMy4qM8PfKxJW5FZlxIZ7NrZiKNiNjthPj3zcThmkDbBBWdkK4pzb50ev9LrUwkrACGNUU0Sn0HRQD6wKtbS/8X3tqLLgYSMIGWhzI5i2Q3y5evQA+M=; Message-ID: <203531.99897.qm@web34402.mail.mud.yahoo.com> X-YMail-OSG: 2IZKsroVM1nM9Y3l00YXrykE6FH4ddPcUIVsG19eqQwVJo70Q_xk5fK4RyhUUayLQRFiJBSrk8bFs72Vc8b_QD5BBrsP6UCU8K5S6bCe6Qc327hyVMDzEPj78_dhjdRXnBI_b4OzF7JcYmpvi7ZNdOyOQUo2vz.5oJQkjMdouqKTOHzV5qny1OYpNInp.bd_Q.xPYgVsEMLJp0NmMdwB_nIxF329ZQEcXEeDYXTKWVlcRckwDHb.HfVc1ZQMnpjmt3imYkmAV.rByTP2R3QewcxYE.7rswQCPtn.N8nhJg.wJ7oRBKK_wuBkuegU0Duv2LvcsEHh7EXt2hA0ruPqXsvkgVd4MvzL8OQTrZXM Received: from [198.95.226.230] by web34402.mail.mud.yahoo.com via HTTP; Wed, 03 Feb 2010 21:52:21 PST X-Mailer: YahooMailClassic/9.1.10 YahooMailWebService/0.8.100.260964 Date: Wed, 3 Feb 2010 21:52:21 -0800 (PST) From: Neelkanth Natu To: "C. Jayachandran" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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: Thu, 04 Feb 2010 05:52:23 -0000 Hi,=0A=0AI have committed JC's original patch to restore the 'gp' register= =0Aafter the 'jalr'.=0A=0Ahttp://svn.freebsd.org/viewvc/base?view=3Drevisio= n&revision=3D203475=0A=0ASorry about the churn.=0A=0Abest=0ANeel=0A=0A--- O= n Wed, 2/3/10, Neelkanth Natu wrote:=0A=0A> From: Neel= kanth Natu =0A> Subject: Re: mips ptrace.S fix=0A> To: = "C. Jayachandran" =0A> Cc: "Rui Paulo" , freebsd-mips@freebsd.org=0A> Date: Wednesday, February 3, 2010,= 6:56 PM=0A> Hi JC,=0A> =0A> --- On Wed, 2/3/10, C. Jayachandran =0A> wrote:=0A> =0A> > From: C. Jayachandran =0A> > Subject: Re: mips ptrace.S fix=0A> > To: "Neelkanth Natu= " =0A> > Cc: "Rui Paulo" ,=0A> free= bsd-mips@freebsd.org=0A> > Date: Wednesday, February 3, 2010, 6:09 PM=0A> >= On Thu, Feb 4, 2010 at 1:01 AM,=0A> > Neelkanth Natu = =0A> > wrote:=0A> > > Your patch looks good. I have a few comments=0A> thou= gh.=0A> > See inline:=0A> > >=0A> > > Index: lib/libc/mips/sys/ptrace.S=0A>= > >=0A> >=0A> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A> > > = --- lib/libc/mips/sys/ptrace.S=A0 (revision=0A> 203379)=0A> > > +++ lib/lib= c/mips/sys/ptrace.S=A0 (working=0A> copy)=0A> > > @@ -42,14 +42,26 @@=0A> >= >=A0 #endif /* LIBC_SCCS and not lint */=0A> > >=0A> > >=A0 LEAF(ptrace)= =0A> > > +=A0 =A0 =A0=A0=A0.frame=A0=0A> sp,40,ra=0A> > >=0A> > >>> space m= issing after the ','=0A> > >=0A> > > +=A0 =A0=0A> =A0=A0=A0.mask=A0=A0=A00x= 80000000, -8=0A> > >=A0 #ifdef __ABICALLS__=0A> > >=A0 =A0 =A0 =A0 .set=A0 = =A0=0A> noreorder=0A> > >=A0 =A0 =A0 =A0 .cpload t9=0A> > >=A0 =A0 =A0 =A0 = .set=A0 =A0=0A> reorder=0A> > >=A0 #endif=0A> > > +=A0 =A0 =A0=A0=A0subu=A0= =0A> =A0 sp, sp, 40=0A> > > +=A0 =A0 =A0=A0=A0sw=A0 =A0=0A> =A0 ra,=A0 32(s= p)=0A> > > +#ifdef __ABICALLS__=0A> > > +=A0 =A0 =A0=A0=A0.cprestore 16=0A>= > > +#endif=0A> > >=A0 =A0 =A0 =A0 la=A0 =A0 =A0=0A> t9, _C_LABEL(__error)= =A0=A0=A0#=0A> > locate address of errno=0A> > > -=A0 =A0 =A0=A0=A0jalr=A0= =0A> =A0 t9=0A> > > +=A0 =A0 =A0=A0=A0jalr=A0=0A> =A0 t9=0A> > >=0A> > >>> = this change is not required - the newly=0A> added=0A> > line has a tab at t= he end.=0A> > >=0A> > > +#ifdef __ABICALLS__=0A> > > +=A0 =A0 =A0=A0=A0lw= =A0 =A0=0A> =A0 gp, 16(sp)=0A> > > +#endif=0A> > >=0A> > >>> this is redund= ant - the assembler will=0A> > generate exactly the same line of=0A> > >>> = code due to the .cprestore directive=0A> above.=0A> > =0A> > Are you sure a= bout this?=A0 I think the assembler=0A> > generates the gp load=0A> > only = for the 'jal' and 'bal' not for 'jalr'.=0A> > =0A> > Probably the two lines= (la and jalr) can be replaced by=0A> a=0A> > jal.=0A> > =0A> =0A> You are r= ight. My eyes glossed over between the 'jal' and=0A> 'jalr'. I think=0A> co= mbining the two instructions into a single 'jal' is the=0A> way to go.=0A> = =0A> best=0A> Neel=0A> =0A> > Regards,=0A> > JC.=0A> > =0A> =0A> =0A> =A0 = =A0 =A0 =0A> =0A=0A=0A