Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Feb 2010 07:39:32 +0530
From:      "C. Jayachandran" <c.jayachandran@gmail.com>
To:        Neelkanth Natu <neelnatu@yahoo.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: mips ptrace.S fix
Message-ID:  <98a59be81002031809p70f0154dnd9a1744ade7aac33@mail.gmail.com>
In-Reply-To: <296949.49663.qm@web34402.mail.mud.yahoo.com>
References:  <98a59be81002030227u43b0e601q2eebb383debc230b@mail.gmail.com> <296949.49663.qm@web34402.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 4, 2010 at 1:01 AM, Neelkanth Natu <neelnatu@yahoo.com> wrote:
> Your patch looks good. I have a few comments though. See inline:
>
> Index: lib/libc/mips/sys/ptrace.S
> =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
> --- lib/libc/mips/sys/ptrace.S =C2=A0(revision 203379)
> +++ lib/libc/mips/sys/ptrace.S =C2=A0(working copy)
> @@ -42,14 +42,26 @@
> =C2=A0#endif /* LIBC_SCCS and not lint */
>
> =C2=A0LEAF(ptrace)
> + =C2=A0 =C2=A0 =C2=A0 .frame =C2=A0sp,40,ra
>
>>> space missing after the ','
>
> + =C2=A0 =C2=A0 =C2=A0 .mask =C2=A0 0x80000000, -8
> =C2=A0#ifdef __ABICALLS__
> =C2=A0 =C2=A0 =C2=A0 =C2=A0.set =C2=A0 =C2=A0noreorder
> =C2=A0 =C2=A0 =C2=A0 =C2=A0.cpload t9
> =C2=A0 =C2=A0 =C2=A0 =C2=A0.set =C2=A0 =C2=A0reorder
> =C2=A0#endif
> + =C2=A0 =C2=A0 =C2=A0 subu =C2=A0 =C2=A0sp, sp, 40
> + =C2=A0 =C2=A0 =C2=A0 sw =C2=A0 =C2=A0 =C2=A0ra, =C2=A032(sp)
> +#ifdef __ABICALLS__
> + =C2=A0 =C2=A0 =C2=A0 .cprestore 16
> +#endif
> =C2=A0 =C2=A0 =C2=A0 =C2=A0la =C2=A0 =C2=A0 =C2=A0t9, _C_LABEL(__error) =
=C2=A0 # locate address of errno
> - =C2=A0 =C2=A0 =C2=A0 jalr =C2=A0 =C2=A0t9
> + =C2=A0 =C2=A0 =C2=A0 jalr =C2=A0 =C2=A0t9
>
>>> this change is not required - the newly added line has a tab at the end=
.
>
> +#ifdef __ABICALLS__
> + =C2=A0 =C2=A0 =C2=A0 lw =C2=A0 =C2=A0 =C2=A0gp, 16(sp)
> +#endif
>
>>> this is redundant - the assembler will generate exactly the same line o=
f
>>> code due to the .cprestore directive above.

Are you sure about this?  I think the assembler generates the gp load
only for the 'jal' and 'bal' not for 'jalr'.

Probably the two lines(la and jalr) can be replaced by a jal.

Regards,
JC.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?98a59be81002031809p70f0154dnd9a1744ade7aac33>