Subject: Re: Kernel calls - args in registers
To: Travis Hassloch x231 <>
From: Terry Lambert <>
List: tech-kern
Date: 11/19/1996 15:30:34
> > of course, if you're going to pass syscall arguments in registers (and
> > do the syscall.c-equivalent in hand-massaged assembler) you might find
> > that you'll get a bigger *system* performance gain (at least on "CISC"
> > systems like the i386 and m68k) by using a more RISC-like calling
> > convention with the first few arguments in registers..
> I've been looking at this a bit lately, and noticed that, as you
> point out, gcc doesn't use registers on the x86 by default (IMHO it should
> have, at least if you can configure that for free Unixes -- it's not like we
> had a historical baggage commercial compiler to be call-level compatible
> with).

What about processor emulation environments?

For instance, running my NetScape binaries on an Alpha using a processor
emulator that converts traps to native kernel calls?

I think that in this situation, calling in registers would complicate
(and in some cases, because of alignment, make nearly impossible) such
cross-processor ABI emulation.

I find it extremely unlikely that NetScape will be porting to BSD or
Linux on a PowerMAC (for example) any time soon, and this ABI/processor
hybridization is about the only way you will be able to use commercial
apps on that platform.

FWIW: I agree on intra-kernel calling; I'd go so far as to suggest using
callee-pop conventions, in fact.

					Terry Lambert
Any opinions in this posting are my own and not those of my present
or previous employers.