Subject: Re: N32 support (patch proposal)
To: Wayne Knowles <wdk@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: port-mips
Date: 01/03/2002 21:25:04
> setregs() calls setregs_o32() which calls setregs1() which does exactly
> what setregs() used to do!!
> This makes the common case suffer thru 2 extra function calls that do
> absolutely nothing.

I did it that way because if I ever have something to do in n32 that
should not be done in n32, I just have to move it from setregs1 to
setregs_o32. I'm not sure that we need to set t9 on n32, for instance.

Next, setregs_o32 has this name to highlight this is o32. NetBSD native
binaries need this to be called setregs, so if we suppress the function,
then we end up with the o32 setregs function called setregs, and the n32
setregs function called setregs_n32. This looks a bit weird.

However, I'm not satisfied either with the way I did it in the patch, it
should be improved.

> Could you not stick with the original setregs() and have setregs_{o,n}32
> call it directly???  This removes 2 levels of function calls when
> executing NetBSD binaries.

What about inline'ing setregs1 and defining setregs as a macro, equal to
setregs_o32? It seems to me that it will solve the performance issue
while keeping the function names as clear as possible.

> setregs_{o,n}32 may be better suited in the compat_irix sources which is
> the reason for the requirement.

I don't know, I understood that the goal was to get general N32 support
for Mips. After all, we might need it for something else, who knows? And
most of N32 support (syscall handler...) will not be in compat_irix
sources anyway, so I'm not sure it's useful to move setregs function to
compat_irix.

-- 
Emmanuel Dreyfus
UNIX *is* user friendly. It is just a bit selective about his friends
manu@netbsd.org