This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] mips/o32: fix internal_syscall5/6/7
On 2017-08-16 11:54, Adhemerval Zanella wrote:
>
>
> On 16/08/2017 11:46, Maciej W. Rozycki wrote:
> > On Wed, 16 Aug 2017, Adhemerval Zanella wrote:
> >
> >> +ENTRY(__libc_do_syscall)
> >> + move $2, $4
> >> + move $4, $5
> >> + move $5, $6
> >> + move $6, $7
> >
> > I'm not very keen on having a nested syscall function call, but if you do
> > that, then please at least arrange the wrapper's arguments such that you
> > don't have to shuffle them, i.e. I suggest placing the syscall number
> > last.
>
> I aimed for simplicity here since to avoid shuffle it would require three
> specialized wrapper, one for each syscall convention (5/6/7). I can do it,
> but I still prefer to have only one entry point, since I think the possible
> performance gains are not worth the extra maintenance burden.
Thinking about that, if the __libc_do_syscall routine is only used for
syscall with 5/6/7 arguments, the syscall number can be passed as the
5th argument (the first on the stack), between argument 4 and 5. That
way arguments 1 to 4 are already in the right registers and the other
needs to be copied anyway.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net