Date: Wed, 3 Feb 2010 21:52:21 -0800 (PST) From: Neelkanth Natu <neelnatu@yahoo.com> To: "C. Jayachandran" <c.jayachandran@gmail.com> Cc: freebsd-mips@freebsd.org Subject: Re: mips ptrace.S fix Message-ID: <203531.99897.qm@web34402.mail.mud.yahoo.com>
next in thread | raw e-mail | index | archive | help
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 <neelnatu@yahoo.com> wrote:=0A=0A> From: Neel= kanth Natu <neelnatu@yahoo.com>=0A> Subject: Re: mips ptrace.S fix=0A> To: = "C. Jayachandran" <c.jayachandran@gmail.com>=0A> Cc: "Rui Paulo" <rpaulo@fr= eebsd.org>, 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 <c.jayacha= ndran@gmail.com>=0A> wrote:=0A> =0A> > From: C. Jayachandran <c.jayachandra= n@gmail.com>=0A> > Subject: Re: mips ptrace.S fix=0A> > To: "Neelkanth Natu= " <neelnatu@yahoo.com>=0A> > Cc: "Rui Paulo" <rpaulo@freebsd.org>,=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 <neelnatu@yahoo.com>= =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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?203531.99897.qm>